It takes ruby code as input and runs it. => Interpreted => No compiling(*)
- irb
- Ruby comes with an amazing amount of tools out of the box Net::HTTP Net::SMTP/IMAP/POP3 Matrix CSV DRb DateTime FileUtils Logger SOAP (yes, SOAP!) Zlib
See also: http://www.ruby-doc.org/core/ and http://www.ruby-doc.org/stdlib/
- MRI (1.8.6, 1.8.7, 1.9.1, 1.9.2)
- 1.8.7: Safest verison - best compatibility
- 1.9.x: Bleeding edge - faster, will be required by Rails 3.1
- Ruby Enterprise Edition
- Memory optimized MRI 1.8.7
- JRuby
- Rubinius
- IronRuby
- Maglev
- Similar to a package manager in Linux or CPAN in Perl or Python eggs
gem
executable- Find gems
- gem list rspec
- Install gems
- gem install rails
- sudo vs sudon't
- Build gems
- Release gems to rubygems.org
- A Ruby gem for running quick scripts
- rake : Ruby :: make : C
Example: # Rakefile
task :test do
# run testing code
end
task :release do
`gem push mygem.gemspec`
end
rake test
#=> All tests pass!
- Testing is highly valued among the Ruby community - many are passionate about quality software and switched to Ruby because the language reflects their values of pragmatism and beauty. Testing is a practice of pragmatism and helps us write beautiful code.
- More test suites than you can shake a stick at
- RSpec, Cucumber, Test::Unit, Shoulda, Bacon, Coulda, Steak, Riot
- Tests are typically executed by running
rake test
| Date/Time parsing | chronic | | Gem building | jeweler | | Geocoding | geokit | | PDF Generation | prawn | | Workflow engine | ruote | | HTML/XML Parsing | nokogiri | | Web scraping | mechanize |
See also: http://ruby-toolbox.com/
A tool for "locking" a specific set of gems that a ruby program can use. Tries to prevent "DLL Hell." Rails is now intimately involved.
- Gemfile
- bundle update
- Rails, duh!
- Rails is a collection of gems and a script for generating rails apps
- Sinatra
- For simple web apps
- R.I.P. Merb
- Camping
- Nitro
Rack is the bedrock on which most Ruby web frameworks rest. It is a simple library that handles the job of accepting an HTTP request, parsing out parameters and server environment variables, and outputting the response. Go here if you want performance. It's the closest you can get to the web server itself.
- ActiveRecord - America's favorite "ORM"
- Datamapper
- Sequel
- sqlite
- mysql
- postgres
- MS SQL (DBI)
- MongoDB
- CouchDB
- Redis
- Etc, etc, etc.
Can't just copy a folder to your web server. Most servers need to be told where your web app is and which domain it should serve. Passenger for Apache is the quickest and easiest option for servers you manage. Heroku is the best for getting started quickly.