Ruby

Why the Lucky Stiff

 * http://en.wikipedia.org/wiki/Why_the_lucky_stiff
 * http://en.wikipedia.org/wiki/Why%27s_(poignant)_Guide_to_Ruby

General

 * http://johan.kiviniemi.name/blag/ruby-vs-python/
 * http://c2.com/cgi/wiki?PythonVsRuby
 * http://blog.peepcode.com/tutorials/2010/what-pythonistas-think-of-ruby
 * http://code.macournoyer.com/thin/usage/
 * http://rack.rubyforge.org/
 * https://github.com/fauna/mongrel
 * http://www.associatedcontent.com/article/2604373/ruby_vs_python_as_programming_languages.html
 * http://www.infoq.com/news/2008/02/thin-fast-ruby-webserver

One Liners

 * http://reference.jumpingmonkey.org/programming_languages/ruby/ruby-one-liners.html
 * http://hubpages.com/hub/Ruby_one-liners_file_manipulation
 * http://www.rubyinside.com/ruby-command-line-one-liners-141.html

Recursive Globbing
ruby -e 'puts Dir["/usr/lib/**/*.{h,so}"]' Dir.glob("E:/test/foobar/scripts/**/*.xml").each do |f| matches += File.new(f).read.scan('').size puts f end files = Dir["E:/test/foobar/scripts/**/*.xml"] matches = files.inject(0) {|sum,f| sum + File.read(f).scan('').size} printf "%10d matches\n%10d files\n", matches, files.size Dir.glob('*/') Dir.glob('**/*/')
 * http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/252051
 * http://www.ruby-forum.com/topic/122587
 * http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/3fafe43402107b8a

Search and Replace
file_names = ['foo.txt', 'bar.txt']
 * http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=replace+text+in+a+file+with+ruby
 * http://stackoverflow.com/questions/1274605/ruby-search-file-text-for-a-pattern-and-replace-it-with-a-given-value

file_names.each do |file_name| text = File.read(file_name) puts text.gsub(/search_regexp/, "replace string") end ruby -pi.bak -e "gsub(/oldtext/, 'newtext')" *.txt text = File.read(filepath) replace = text.gsub(/aaa/, "Replaced aaa with 111") replace = replace.gsub(/bbb/, "Replace bbb with 222") File.open(filepath, "w") {|file| file.puts replace}
 * http://stackoverflow.com/questions/4048678/ruby-open-file-find-and-replace-multiple-lines
 * http://www.megasolutions.net/ruby/search-a-file-and-replace-text-50116.aspx

Forums

 * http://stackoverflow.com/questions/1274605/ruby-search-file-text-for-a-pattern-and-replace-it-with-a-given-value

Ruby Gems
ruby setup.rb install gem update --system
 * http://stevenharman.net/blog/archive/2008/11/12/installing-rubygems-in-cygwin.aspx
 * 1) Download the RubyGems tarball from Ruby Forge http://rubyforge.org/frs/?group_id=126&release_id=43601
 * 2) Unpack the tarball
 * 3) In a bash terminal, navigate to the unpacked directory
 * 1) Run the following command: