Category: Ruby
Delete Leading Whitespace
May 11, 2009
Delete leading whitespace (spaces/tabs/etc) from beginning of each line ruby -pe ‘gsub(/^\s+/, “”)’ < file.txt
Double space a file using Ruby
April 23, 2009
Double space a file with Ruby using the command ruby -pe ‘puts’ < file.txt
Installing Rails
June 6, 2008
You can install Rails in a Fedora system with these commands… yum -y install ruby ruby-devel ruby-irb ruby-libs ruby-rdoc ruby-ri…
Find if a Variable is Defined in Ruby
December 3, 2007
This will let you find whether a variable is defined in ruby. if(defined? var_name) then print var_name + ” is…
Installing a Ruby Gem
November 1, 2007
Use this command to install a ruby gem in Linux – you must be connected to the net sudo gem…
Recent Comments