• Written for humans not for computers • Easy to read and write • 5.times { puts “Arigato Matz! Have some chunky bacon!”} • [‘riverside’, ‘japan’, ‘america’].each { |locale| puts locale.capitalize } • Popularized by Ruby on Rails Monday, September 27, 2010
Ruby already! • Windows users - are you prejudiced towards Japan or something?! Let’s fix that by installing Ruby: • http://rubyinstaller.org/ - follow the default installation steps and you are good to go. It will install to your programs directory. Monday, September 27, 2010
The best way to tryout and learn Ruby. • Comes packaged with your Ruby Install • To Use: • Mac: open up command line and type: irb • Windows: open up Interactive Ruby program Monday, September 27, 2010
a duck, and quacks like a duck, then it’s probably a duck. "a".respond_to? :size # => true 1.respond_to? :+ # => true 1.respond_to? :inject # => false Monday, September 27, 2010
top of Ruby. It’s kinda like Rails, but much lighter. You use it to build websites with Ruby. • [sudo] gem install sinatra • Gems are just a cool word for ‘libraries’ in the Ruby world. They contain packaged up code that do cool things. Rails is a gem, Sinatra is a gem, and nokogiri is a gem. You can find gems at http://rubygems.org Monday, September 27, 2010