slide1 n.
Skip this Video
Loading SlideShow in 5 Seconds..
Ruby and Rails PowerPoint Presentation
Download Presentation
Ruby and Rails

Loading in 2 Seconds...

  share
play fullscreen
1 / 20
Download Presentation

Ruby and Rails - PowerPoint PPT Presentation

daria
114 Views
Download Presentation

Ruby and Rails

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Ruby and Rails From a perspective James Crisp .NET Practice Lead ThoughtWorks Australia

  2. James Crisp

  3. Runtimes MRI

  4. IronRuby Console Demo

  5. public class CSharpDemo : Demo • { • public void SayHello() • { • for (inti=0; i<5; i++) • { • Console.WriteLine(“Hi from C#!”); • } • } • public IEnumerable<string> Greet( • IEnumerable<guest> guests) • { • return guests.Select(g => “Welcome” • + g.Name); • } • }

  6. class RubyDemo < Demo • def say_hello • 5.times { puts “Hi from Ruby!” } • end • def greet(guests) • guests.collect { |g| “Welcome #{g.name}” } • end • end • >> RubyDemo.new.greet(fred, tina) • => [“Welcome Fred”, “Welcome Tina”]

  7. Tools and Frameworks

  8. c:\> gem install rails

  9. Rake • desc “Generate application code” • task :code_gen do • # do the code generation • end • desc “Compile code” • task :compile => [:code_gen] do • #do the compilation • end • desc “Test application” • task :test => [:compile] do • # run the tests • end

  10. Capistrano desc "Start ferret server" task :start, :role => :app do run "cd #{current_path}; script/ferret_server -e #{stage} start" end desc "Stop ferret server" task :stop, :role => :app do run "cd #{current_path}; script/ferret_server -e #{stage} stop" end

  11. RSpec describe User do it "should be in any roles assigned to it" do user = User.new user.assign_role("assigned role") user.shouldbe_in_role("assigned role") end ... end

  12. Routing Table Controller Method Model View

  13. Rails Project Demo

  14. See also... Rails & screencasts http://rubyonrails.org Ruby / Rails API http://gotapi.com John Lam's blog for Iron Ruby http://www.iunknown.com/ Slides for this talk http://www.jamescrisp.org

  15. Image References http://upload.wikimedia.org/wikipedia/en/2/27/Microsoft_.NET_Logo.png - .net logo http://en.wikipedia.org/wiki/Image:Ruby-(programming-language)-logo-2008.png http://www.pragprog.com/images/covers/original/rails3.jpg – agile development with rails http://flickr.com/photos/rrrodrigo/2394122680/ - Matz http://flickr.com/photos/maguisso/1028956186/ - Ruby book http://media.xircles.codehaus.org/_projects/jruby/_logos/medium.png – JRuby logo http://www.atdot.net/yarv/ - YARV logo http://www.ironruby.net/@api/deki/site/logo.png – IronRuby logo

  16. Questions?