String#to_range
1 2 class String; def to_range; Range.new(*self.split("-").map{|i|i.to_i}); end; end
DZone Snippets > willcodeforfoo > ruby
13402 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
1 2 class String; def to_range; Range.new(*self.split("-").map{|i|i.to_i}); end; end
1 >> local_variables 2 # => ["_"] 3 4 >> a = "Kevin" 5 # => "Kevin" 6 7 >> local_variables 8 # => ["_", "a"]
sudo port install curl
cd src
curl -O http://rubyforge.iasi.roedu.net/files/curb/curb-0.1.0.tar.gz
tar -zxvf curb-0.1.0.tar.gz
cd curb-0.1.0.tar.gz
ruby extconf.rb --with-curl-lib=/opt/local/lib/ --with-curl-include=/opt/local/include/
ruby tests/alltests.rb
sudo make install