Yet Another Ruby Framework - Como o Rails funciona por dentro

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

5 Favorites

Yet Another Ruby Framework - Como o Rails funciona por dentro - Presentation Transcript

  1. Yet Another Ruby Framework Como o Rails funciona por dentro por Carlos Brando
  2. http://www.nomedojogo.com/
  3. http://www.rubyinside.com.br/
  4. Yet Another Ruby Framework Como o Rails funciona por dentro por Carlos Brando
  5. Ruby on Rails não é uma linguagem de programação
  6. Paradigma MVC Framework Web Basecamp
  7. Ruby on Rails é um framework
  8. Rails não serve para tudo!
  9. XML + JS
  10. Sociably
  11. Arquitetura
  12. Push-based
  13. MVC
  14. Pull-based
  15. require "rack" options = { :Port => 3000, :Host => "0.0.0.0", :environment => (ENV['SOCIABLY_ENV'] || "development").dup, :config => SOCIABLY_ROOT + "/config.ru", :detach => false, :debugger => false, :path => nil } # ... begin server = Rack::Handler::Mongrel rescue LoadError => e server = Rack::Handler::WEBrick end # .. server.run(ApplicationController, options.merge(:AccessLog => [])) ruby script/server
  16. Banco de Dados
  17. ORM Mapeamento objeto-relacional
  18. config.database_library = :datamapper init.rb ou environment.rb def initialize_database case Sociably.configuration.database_library when :datamapper require 'datamapper' DataMapper.setup(:default, database_options[SOCIABLY_ENV]) when :activerecord # ... end end initializer.rb
  19. Geradores de código
  20. Templates
  21. ERB vs. Haml
  22. Haml #profile .left.column #date= print_date #address= current_user.address .right.column #email= current_user.email #bio= current_user.bio ERB <div id="profile"> <div class="left column"> <div id="date"><%= print_date %></div> <div id="address"><%= current_user.address %></div> </div> <div class="right column"> <div id="email"><%= current_user.email %></div> <div id="bio"><%= current_user.bio %></div> </div> </div>
  23. <p> Olá, <%= evento %>! </p> require "erb" erb = <<END _erbout = '' <p> Olá, <%= evento %>! _erbout.concat " <p>n" </p> _erbout.concat " Ol303241, " END _erbout.concat(( evento ).to_s) def evento "Rails Summit" _erbout.concat "!n" end _erbout.concat " </p>n" instance = ::ERB.new(erb) _erbout puts instance.src
  24. require "erb" erb = <<END _erbout = '' <p> Olá, <%= evento %>! _erbout.concat " <p>n" </p> _erbout.concat " Ol303241, " END _erbout.concat(( evento ).to_s) def evento "Rails Summit" _erbout.concat "!n" end _erbout.concat " </p>n" instance = ::ERB.new(erb) _erbout puts instance.src eval(instance.src, binding)
  25. <p> Olá, Rails Summit! </p> eval(instance.src, binding)
  26. Demo
  27. @carlosbrando www.nomedojogo.com

+ eduardobrandoeduardobrando, 3 months ago

custom

1433 views, 5 favs, 7 embeds more stats

“Yet Another Ruby Framework – Como o Rails func more

More info about this presentation

© All Rights Reserved

  • Total Views 1433
    • 726 on SlideShare
    • 707 from embeds
  • Comments 1
  • Favorites 5
  • Downloads 38
Most viewed embeds
  • 637 views on http://www.nomedojogo.com
  • 52 views on http://andrefaria.com
  • 13 views on http://www.rubyonrails.pro.br
  • 2 views on http://busk.com
  • 1 views on resource://brief-content

more

All embeds
  • 637 views on http://www.nomedojogo.com
  • 52 views on http://andrefaria.com
  • 13 views on http://www.rubyonrails.pro.br
  • 2 views on http://busk.com
  • 1 views on resource://brief-content
  • 1 views on http://rubyonrails.pro.br
  • 1 views on http://andrefaria.wordpress.com

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories