Download presentation
Presentation is loading. Please wait.
Published byDustin Basil Horton Modified over 9 years ago
1
Ruby and Rails James Crisp.NET Practice Lead ThoughtWorks Australia From aperspective
2
James Crisp
6
Runtimes MRI
7
IronRuby Console Demo
8
public class CSharpDemo : Demo { public void SayHello() { for (int i=0; i<5; i++) { Console.WriteLine(“Hi from C#!”); }} public IEnumerable Greet( public IEnumerable Greet( IEnumerable guests) { return guests.Select(g => “Welcome” + g.Name); }}
9
class RubyDemo < Demo def say_hello 5.times { puts “Hi from Ruby!” } end def greet(guests) def greet(guests) guests.collect { |g| “Welcome #{g.name}” } endend >> RubyDemo.new.greet(fred, tina) => [“Welcome Fred”, “Welcome Tina”]
10
Tools and Frameworks
11
c:\> gem install rails
12
desc “Generate application code” task :code_gen do # do the code generation # do the code generationend desc “Compile code” task :compile => [:code_gen] do #do the compilation #do the compilationend desc “Test application” task :test => [:compile] do # run the tests # run the testsend Rake
13
Capistrano desc "Start ferret server" task :start, :role => :app do run "cd #{current_path}; script/ferret_server -e #{stage} start" 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" run "cd #{current_path}; script/ferret_server -e #{stage} stop"end
14
RSpec describe User do it "should be in any roles assigned to it" do it "should be in any roles assigned to it" do user = User.new user = User.new user.assign_role("assigned role") user.assign_role("assigned role") user.should be_in_role("assigned role") user.should be_in_role("assigned role") end end...end
16
Routing Table Controller Method ModelView
17
Rails Project Demo
18
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
19
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 Image References
20
Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.