What's up in Ruby for Java Developers   Tours JUG 2011.04 Thomas Queste www.tomsquest.com
Rspec <ul><li>Junit : loooong test methods </li></ul><ul><li>public myMethod_ should DoSomething_ when Something() </li></ul>
Rspec <ul><li>Rspec  : test contexts </li></ul><ul><li>describe ”MyClass” </li></ul><ul><li>describe ”MyMethod” </li></ul>...
Rspec <ul><li>Search </li></ul><ul><li>#find_offers </li></ul><ul><li>when a spread type is specified </li></ul><ul><li>sh...
Factory Girl <ul><li>Generate test data </li></ul><ul><li>my_user = Factory(:user) </li></ul><ul><li>Factory.define :user ...
Active Record <ul><li>Relations </li></ul><ul><ul><li>class Article < ActiveRecord::Base </li></ul></ul><ul><ul><li>has_ma...
Migration <ul><li>Versionned database </li></ul><ul><ul><li>class CreateArticles <  ActiveRecord::Migration </li></ul></ul...
Bundler <ul><li>Dependency management </li></ul><ul><ul><li>gem 'rails', '3.0.6' </li></ul></ul><ul><ul><li>gem 'formtasti...
Heroku <ul><li>Simple Cloud deployment </li></ul><ul><ul><li>heroku create myapp </li></ul></ul><ul><ul><li>git push herok...
GitHub <ul><li>Souce management </li></ul><ul><li>Social </li></ul><ul><li>Fork/Pull Request </li></ul><ul><li>... </li></ul>
Thanks Thomas Queste www.tomsquest.com @ThomasQueste [email_address]
Upcoming SlideShare
Loading in …5
×

What's up in ruby for Java developers

1,378 views
1,326 views

Published on

Show to Java developers how things are developed in Ruby and the Ruby/Rails equivalent of Java frameworks.

Presentation I gave at the Tours Java User Group (Wednesday, the 20th of April 2010).

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,378
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

What's up in ruby for Java developers

  1. 1. What's up in Ruby for Java Developers Tours JUG 2011.04 Thomas Queste www.tomsquest.com
  2. 2. Rspec <ul><li>Junit : loooong test methods </li></ul><ul><li>public myMethod_ should DoSomething_ when Something() </li></ul>
  3. 3. Rspec <ul><li>Rspec : test contexts </li></ul><ul><li>describe ”MyClass” </li></ul><ul><li>describe ”MyMethod” </li></ul><ul><li>context ”With something” </li></ul><ul><li>it ”should do something” </li></ul><ul><li>context ”With something else” </li></ul><ul><li>it ”should do something else” </li></ul>
  4. 4. Rspec <ul><li>Search </li></ul><ul><li>#find_offers </li></ul><ul><li>when a spread type is specified </li></ul><ul><li>should filter by spread_type </li></ul><ul><li>for the currency pair 'EUR/USD' </li></ul><ul><li>should search by min spread </li></ul><ul><li>should search by typical spread </li></ul><ul><li>should search by min OR typical spread </li></ul><ul><li>should ignore a spread of 0 </li></ul>
  5. 5. Factory Girl <ul><li>Generate test data </li></ul><ul><li>my_user = Factory(:user) </li></ul><ul><li>Factory.define :user do |b| </li></ul><ul><li>email ” [email_address] ” </li></ul><ul><li># email Faker::Internet.email </li></ul><ul><li>end </li></ul>
  6. 6. Active Record <ul><li>Relations </li></ul><ul><ul><li>class Article < ActiveRecord::Base </li></ul></ul><ul><ul><li>has_many :authors </li></ul></ul><ul><li>Query </li></ul><ul><ul><li>Article </li></ul></ul><ul><ul><li>.where( :language => ”en” ) </li></ul></ul><ul><ul><li>.order(”updated_at desc”) </li></ul></ul>
  7. 7. Migration <ul><li>Versionned database </li></ul><ul><ul><li>class CreateArticles < ActiveRecord::Migration </li></ul></ul><ul><ul><li>def self.up </li></ul></ul><ul><ul><li>create_table :articles do |t| </li></ul></ul><ul><ul><li>t.string :title </li></ul></ul><ul><ul><li>t.text :body </li></ul></ul><ul><ul><li>t.timestamps </li></ul></ul><ul><ul><li>end </li></ul></ul><ul><ul><li>end </li></ul></ul><ul><ul><li>def self.down </li></ul></ul><ul><ul><li>drop_table :articles </li></ul></ul><ul><ul><li>end </li></ul></ul><ul><ul><li>end </li></ul></ul>
  8. 8. Bundler <ul><li>Dependency management </li></ul><ul><ul><li>gem 'rails', '3.0.6' </li></ul></ul><ul><ul><li>gem 'formtastic', '~> 1.1.0' </li></ul></ul><ul><ul><li>group :test do </li></ul></ul><ul><ul><li>gem 'factory_girl_rails' </li></ul></ul><ul><ul><li>end </li></ul></ul>
  9. 9. Heroku <ul><li>Simple Cloud deployment </li></ul><ul><ul><li>heroku create myapp </li></ul></ul><ul><ul><li>git push heroku master </li></ul></ul><ul><li>Addons </li></ul><ul><ul><li>heroku addons:add sendgrid </li></ul></ul>
  10. 10. GitHub <ul><li>Souce management </li></ul><ul><li>Social </li></ul><ul><li>Fork/Pull Request </li></ul><ul><li>... </li></ul>
  11. 11. Thanks Thomas Queste www.tomsquest.com @ThomasQueste [email_address]

×