railties @ encontro guru sc (nao apresentado) - 2010.09.18
Upcoming SlideShare
Loading in...5
×
 

railties @ encontro guru sc (nao apresentado) - 2010.09.18

on

  • 500 views

Railties presentation prepared for GuruSC meeting (not presented).

Railties presentation prepared for GuruSC meeting (not presented).

Statistics

Views

Total Views
500
Views on SlideShare
498
Embed Views
2

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 2

http://www.hanrss.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

railties @ encontro guru sc (nao apresentado) - 2010.09.18 railties @ encontro guru sc (nao apresentado) - 2010.09.18 Presentation Transcript

  • RAILTIES OU COMO DESENVOLVER PLUGINS/GEMS PARA RAILS Carlos Antonio blog.plataformatec.com.br @cantoniodasilvaSunday, November 6, 11
  • $ WHOAMI Carlos Antonio blog.plataformatec.com.br @cantoniodasilvaSunday, November 6, 11
  • CARLOS ANTONIO DA SILVA @cantoniodasilva Carlos Antonio blog.plataformatec.com.br @cantoniodasilvaSunday, November 6, 11
  • BSI NA UNIDAVI - RIO DO SUL GP NO SENAC - RIO DO SUL/ FLORIANÓPOLIS Carlos Antonio blog.plataformatec.com.br @cantoniodasilvaSunday, November 6, 11
  • TRABALHO NA Carlos Antonio blog.plataformatec.com.br @cantoniodasilvaSunday, November 6, 11
  • DEVISE Carlos Antonio blog.plataformatec.com.br @cantoniodasilvaSunday, November 6, 11
  • SIMPLE_FORM Carlos Antonio blog.plataformatec.com.br @cantoniodasilvaSunday, November 6, 11
  • RESPONDERS Carlos Antonio blog.plataformatec.com.br @cantoniodasilvaSunday, November 6, 11
  • Railties? Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • Railties? WTF??? Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • Initialization Application Railties Engine? Generators Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • Initialization? HOOKS Application Railties Engine Generators Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • Railties GENERATORS Hooks module FooBar class Railtie < Rails::Railtie config.generators.orm = :foo_bar? end end Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • Railties RAKE TASKS Hooks module FooBar class Railtie < Rails::Railtie rake_tasks do load foo_bar/foo.rake? end end end Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • Railties INIT Hooks module FooBar class Railtie < Rails::Railtie # initialization hooks config.before_configuration {} config.before_eager_load {}? config.before_initialize {} config.after_initialize {} config.to_prepare {} end end Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • Railties INIT Hooks module FooBar class Railtie < Rails::Railtie initializer foo_bar.do_whatever do |app| puts "Im initializing!"? # load your stuff here end end end Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • FRAMEWORK LOADING ActiveSupport.on_load(:active_record) do include FooBar::ActiveRecordExtensions end? Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • E O QUE EU FAÇO COM ESSE NEGÓCIO DE FRAMEWORK LOADING? Carlos Antonio blog.plataformatec.com.br @cantoniodasilvaSunday, November 6, 11
  • Railties INIT Hooks module FooBar class Railtie < Rails::Railtie initializer foo_bar.do_whatever do |app| ActiveSupport.on_load(:active_record) do? include FooBar::ActiveRecordExtensions end end end end Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • EXEMPLO REAL??? Carlos Antonio blog.plataformatec.com.br @cantoniodasilvaSunday, November 6, 11
  • module Responders autoload :FlashResponder, responders/flash_responder autoload :HttpCacheResponder, responders/http_cache_responder autoload :CollectionResponder, responders/collection_responder require responders/controller_method class Railtie < ::Rails::Railtie config.responders = ActiveSupport::OrderedOptions.new config.generators.scaffold_controller = :responders_controller # Add load paths straight to I18n, so engines and application can overwrite it. require active_support/i18n I18n.load_path << File.expand_path(../responders/locales/en.yml, __FILE__)? initializer "responders.flash_responder" do |app| if app.config.responders.flash_keys Responders::FlashResponder.flash_keys = app.config.responders.flash_keys end end end end Carlos Antonio blog.plataformatec.com.br @cantoniodasilva Sunday, November 6, 11
  • @cantoniodasilva ?! blog.plataformatec.com.br Obrigado !Sunday, November 6, 11