Tag: ruby

  • What Gets Added When I Require a File in Ruby?

    Let’s say you want to know what symbols are added when you require something in ruby. For example, I was curious if I could get a list of symbols that were added when I required ‘english’. I simply used Symbol.all_symbols to save off the old symbol array and the new one and then subtracted the…

  • I love treating primitives as objects #ruby

    #script to generate a .csv testing results file puts “Day,User ID,Action,Start Time,End Time” (1..28).each{ |day| puts “#{day},system,1. Load Step,hh:mm:ss,hh:mm:ss” puts “#{day},system,1a. Raw Data Load,hh:mm:ss,hh:mm:ss” puts “#{day},system,1b. Cube Build,hh:mm:ss,hh:mm:ss” (1..8).each { |user| (1..15).each { |report| puts “#{day},#{user},2. Report #{report},hh:mm:ss,hh:mm:ss” } } (1..5).each { |user| puts “#{day},#{user},3. Query,hh:mm:ss,hh:mm:ss” } }

  • rush: the ruby shell

    rush. rush is a replacement for the unix shell (bash, zsh, etc) which uses pure Ruby syntax. Grep through files, find and kill processes, copy files – everything you do in the shell, now in Ruby. Install rush If you’re running windows and have Ruby installed, go to Start->Ruby-{version}->RubyGems->RubyGems Package manager and type in “gem…