SlideShare a Scribd company logo
1 of 28
Onde mora a
  produtividade
do Ruby on Rails?

          Fabio Kung
  fabio.kung@caelum.com.br
     fabiokung @ twitter
Scaffold
Ruby
Dinamismo
“Skilled programmers can write
better programmers than they can
              hire”
                      -- Giles Bowkett
Expressividade
Domain Specific Languages
10.days.ago
rufus-scheduler
rufus-scheduler

scheduler.in '20m' do
  puts "go home"
end

scheduler.every '5m' do
  puts "check blood pressure"
end
<div class="listitemchk">
  <h3 class="smller">
    <a href="URL_DO_PERFIL">QUEM_POSTOU</a>:
  </h3>
  <div class="para ">
    TEXTO DO RECADO
    <div class="selr">
       ...
    </div>
  </div>
</div>
<div class="listitemchk">
      <h3 class="smller">
        <a href="URL_DO_PERFIL">QUEM_POSTOU</a>:
      </h3>
      <div class="para ">
        TEXTO DO RECADO
        <div class="selr">
           ...
        </div>
      </div>
    </div>




doc = Hpricot(texto)
doc / "div.listitemchk" / "h3.smller" / "a"
doc / "div.listitemchk" / "div.para"
User.select { |m| m.name == 'jon' && m.age == 21 }

"SELECT * FROM users WHERE users.name = 'jon' AND users.age = 21"
User.select { |m| m.name == 'jon' && m.age == 21 }

"SELECT * FROM users WHERE users.name = 'jon' AND users.age = 21"




User.select { |u| [1, 2, 3, 4].include? u.id }
# SELECT * FROM users WHERE users.id IN (1,2,3,4)



User.select { |u| u.friends.name =~ /bi/ }
# SELECT * FROM users LEFT OUTER JOIN ... WHERE friends.name ~ 'bi'
class Company < ActiveRecord::Base

  has_many :jobs

  validates_presence_of :name
  validates_presence_of :contact_name
  validates_presence_of :ddd, :phone

  validates_uniqueness_of :cnpj
  validates_uniqueness_of :razao_social

  validates_numericality_of :ddd, :phone

  validates_unchangeable :email
  validates_unchangeable :cnpj

  acts_as_authentic

end
Novos paradigmas
Erlang, Scala, ...
YAWS
MapReduce
Enumerable
Ecossistema
TATFT
(Test All The Fucking Time)
TDD

class PostTest < ActiveSupport::TestCase

  def test_title
    post = Post.new :title => "Post 1"
    assert_equal "Post 1!", post.title
  end

end
BDD

class PostTest < ActiveSupport::TestCase

  def test_title_is_required
    post = Post.new
    assert ! post.valid?
  end

end
Dúvidas?




                       Obrigado!
fabio.kung@caelum.com.br
    http://fabiokung.com
     twitter: fabiokung

More Related Content

Similar to Onde mora a produtividade do Ruby on Rails

Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power StackRails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power StackDavid Copeland
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)James Titcumb
 
JSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedJSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedKazuho Oku
 
FamilySearch Reference Client
FamilySearch Reference ClientFamilySearch Reference Client
FamilySearch Reference ClientDallan Quass
 
Stop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in DrupalStop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in DrupalBjörn Brala
 
Api's and ember js
Api's and ember jsApi's and ember js
Api's and ember jsEdwin Cruz
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overviewYehuda Katz
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the FinishYehuda Katz
 
Eve - REST API for Humans™
Eve - REST API for Humans™Eve - REST API for Humans™
Eve - REST API for Humans™Nicola Iarocci
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBen Limmer
 
RedisConf18 - Redis Memory Optimization
RedisConf18 - Redis Memory OptimizationRedisConf18 - Redis Memory Optimization
RedisConf18 - Redis Memory OptimizationRedis Labs
 
Java Web Development with Stripes
Java Web Development with StripesJava Web Development with Stripes
Java Web Development with StripesSamuel Santos
 
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK - Nicola Iarocci - Co...
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK -  Nicola Iarocci - Co...RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK -  Nicola Iarocci - Co...
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK - Nicola Iarocci - Co...Codemotion
 
Intro to-rails-webperf
Intro to-rails-webperfIntro to-rails-webperf
Intro to-rails-webperfNew Relic
 
Simple Web Apps With Sinatra
Simple Web Apps With SinatraSimple Web Apps With Sinatra
Simple Web Apps With Sinatraa_l
 
Spca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_librariesSpca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_librariesNCCOMMS
 

Similar to Onde mora a produtividade do Ruby on Rails (20)

Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power StackRails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power Stack
 
Built in filters
Built in filtersBuilt in filters
Built in filters
 
Postman On Steroids
Postman On SteroidsPostman On Steroids
Postman On Steroids
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
 
JSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedJSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons Learned
 
AngularJS
AngularJSAngularJS
AngularJS
 
FamilySearch Reference Client
FamilySearch Reference ClientFamilySearch Reference Client
FamilySearch Reference Client
 
Stop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in DrupalStop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in Drupal
 
Api's and ember js
Api's and ember jsApi's and ember js
Api's and ember js
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overview
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the Finish
 
Eve - REST API for Humans™
Eve - REST API for Humans™Eve - REST API for Humans™
Eve - REST API for Humans™
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profit
 
RedisConf18 - Redis Memory Optimization
RedisConf18 - Redis Memory OptimizationRedisConf18 - Redis Memory Optimization
RedisConf18 - Redis Memory Optimization
 
Java Web Development with Stripes
Java Web Development with StripesJava Web Development with Stripes
Java Web Development with Stripes
 
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK - Nicola Iarocci - Co...
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK -  Nicola Iarocci - Co...RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK -  Nicola Iarocci - Co...
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK - Nicola Iarocci - Co...
 
Intro to-rails-webperf
Intro to-rails-webperfIntro to-rails-webperf
Intro to-rails-webperf
 
Simple Web Apps With Sinatra
Simple Web Apps With SinatraSimple Web Apps With Sinatra
Simple Web Apps With Sinatra
 
Spca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_librariesSpca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_libraries
 

More from Fabio Kung

Linux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environmentLinux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environmentFabio Kung
 
Dicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no CloudDicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no CloudFabio Kung
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionFabio Kung
 
Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Fabio Kung
 
Cloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como ServiçoCloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como ServiçoFabio Kung
 
Usando o Cloud
Usando o CloudUsando o Cloud
Usando o CloudFabio Kung
 
Storage para virtualização
Storage para virtualizaçãoStorage para virtualização
Storage para virtualizaçãoFabio Kung
 
Automacao devops
Automacao devopsAutomacao devops
Automacao devopsFabio Kung
 
DSLs Internas e Ruby
DSLs Internas e RubyDSLs Internas e Ruby
DSLs Internas e RubyFabio Kung
 
Ruby, muito mais que reflexivo
Ruby, muito mais que reflexivoRuby, muito mais que reflexivo
Ruby, muito mais que reflexivoFabio Kung
 
SOA não precisa ser buzzword
SOA não precisa ser buzzwordSOA não precisa ser buzzword
SOA não precisa ser buzzwordFabio Kung
 
JRuby on Rails
JRuby on RailsJRuby on Rails
JRuby on RailsFabio Kung
 

More from Fabio Kung (12)

Linux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environmentLinux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environment
 
Dicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no CloudDicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no Cloud
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
 
Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!
 
Cloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como ServiçoCloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como Serviço
 
Usando o Cloud
Usando o CloudUsando o Cloud
Usando o Cloud
 
Storage para virtualização
Storage para virtualizaçãoStorage para virtualização
Storage para virtualização
 
Automacao devops
Automacao devopsAutomacao devops
Automacao devops
 
DSLs Internas e Ruby
DSLs Internas e RubyDSLs Internas e Ruby
DSLs Internas e Ruby
 
Ruby, muito mais que reflexivo
Ruby, muito mais que reflexivoRuby, muito mais que reflexivo
Ruby, muito mais que reflexivo
 
SOA não precisa ser buzzword
SOA não precisa ser buzzwordSOA não precisa ser buzzword
SOA não precisa ser buzzword
 
JRuby on Rails
JRuby on RailsJRuby on Rails
JRuby on Rails
 

Recently uploaded

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Onde mora a produtividade do Ruby on Rails

  • 1. Onde mora a produtividade do Ruby on Rails? Fabio Kung fabio.kung@caelum.com.br fabiokung @ twitter
  • 5. “Skilled programmers can write better programmers than they can hire” -- Giles Bowkett
  • 8.
  • 11. rufus-scheduler scheduler.in '20m' do puts "go home" end scheduler.every '5m' do puts "check blood pressure" end
  • 12. <div class="listitemchk"> <h3 class="smller"> <a href="URL_DO_PERFIL">QUEM_POSTOU</a>: </h3> <div class="para "> TEXTO DO RECADO <div class="selr"> ... </div> </div> </div>
  • 13. <div class="listitemchk"> <h3 class="smller"> <a href="URL_DO_PERFIL">QUEM_POSTOU</a>: </h3> <div class="para "> TEXTO DO RECADO <div class="selr"> ... </div> </div> </div> doc = Hpricot(texto) doc / "div.listitemchk" / "h3.smller" / "a" doc / "div.listitemchk" / "div.para"
  • 14. User.select { |m| m.name == 'jon' && m.age == 21 } "SELECT * FROM users WHERE users.name = 'jon' AND users.age = 21"
  • 15. User.select { |m| m.name == 'jon' && m.age == 21 } "SELECT * FROM users WHERE users.name = 'jon' AND users.age = 21" User.select { |u| [1, 2, 3, 4].include? u.id } # SELECT * FROM users WHERE users.id IN (1,2,3,4) User.select { |u| u.friends.name =~ /bi/ } # SELECT * FROM users LEFT OUTER JOIN ... WHERE friends.name ~ 'bi'
  • 16. class Company < ActiveRecord::Base has_many :jobs validates_presence_of :name validates_presence_of :contact_name validates_presence_of :ddd, :phone validates_uniqueness_of :cnpj validates_uniqueness_of :razao_social validates_numericality_of :ddd, :phone validates_unchangeable :email validates_unchangeable :cnpj acts_as_authentic end
  • 18.
  • 20. YAWS
  • 24. TATFT (Test All The Fucking Time)
  • 25. TDD class PostTest < ActiveSupport::TestCase def test_title post = Post.new :title => "Post 1" assert_equal "Post 1!", post.title end end
  • 26. BDD class PostTest < ActiveSupport::TestCase def test_title_is_required post = Post.new assert ! post.valid? end end
  • 27.
  • 28. Dúvidas? Obrigado! fabio.kung@caelum.com.br http://fabiokung.com twitter: fabiokung