Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Hardcore!



Tuesday, June 15, 2010
- Dave Thomas



Tuesday, June 15, 2010
core

Tuesday, June 15, 2010
Duck Typing
        "when I see a bird that walks like a duck and swims like a
        duck and quacks like a duck, I call...
Rails 2


Tuesday, June 15, 2010
I started exploring
                         alternatives to Rails



Tuesday, June 15, 2010
!

Tuesday, June 15, 2010
HISS!!!
                             jason seifer
                         YouTube search: rails vs. django


Tuesday, Jun...
December 23rd, 2008




Tuesday, June 15, 2010
Tuesday, June 15, 2010
+   =


                                 RAILS 3



Tuesday, June 15, 2010
What makes
                         Rails 3 amazing?
                         (and why did it take so long?)



Tuesday, J...
“THE GREAT
                         DECOUPLING”


Tuesday, June 15, 2010
Tuesday, June 15, 2010
Core components
                         are easily customizable.




Tuesday, June 15, 2010
Core components
                         are easily replaceable.



                                         OO
Tuesday, J...
LET’S EXPLORE
                SOME RAILS CORE
                         FOR THE SAKE OF KNOWING!




Tuesday, June 15, 2010
THE RAILS STACK

                                      Network

                                       Rack

             ...
LET’S DO
                    USELESS THINGS


Tuesday, June 15, 2010
Take this code with
                           a grain of salt




Tuesday, June 15, 2010
Let’s write a useless
                   DSL for our views.
                         WRITING A TEMPLATE HANDLER



Tuesday...
WRITING A TEMPLATE HANDLER




Tuesday, June 15, 2010
WRITING A TEMPLATE HANDLER




Tuesday, June 15, 2010
WHAT ACTION VIEW EXPECTS




Tuesday, June 15, 2010
Tuesday, June 15, 2010
Tuesday, June 15, 2010
Tuesday, June 15, 2010
MAKING THE DSL




Tuesday, June 15, 2010
my_cool_dsl.rb

Tuesday, June 15, 2010
my_cool_handler.rb




Tuesday, June 15, 2010
views/hello/index.cool




Tuesday, June 15, 2010
http://localhost:3000/hello




Tuesday, June 15, 2010
Let’s accept useless
                    connections.
                         WRITING A “TELNET SERVER”




Tuesday, June...
A simple way.
                         ACT LIKE A RACK SERVER




Tuesday, June 15, 2010
TALK LIKE A RACK SERVER




                                telnet_server.rb


Tuesday, June 15, 2010
my_cool_handler.rb




Tuesday, June 15, 2010
z




                             my_cool_dsl.rb

Tuesday, June 15, 2010
Tuesday, June 15, 2010
CONSISTENCY!

Tuesday, June 15, 2010
hello_controller.rb    views/hello/index.cool




                         via telnet             via browser



Tuesday, ...
DRY!

Tuesday, June 15, 2010
Let’s make this
                          uselessness
                          configurable.
                         WORK...
WHAT IS A RAILTIE?
                      The interface between the
                Rails framework and its components




...
WHAT CAN YOUR RAILTIE DO?

                 • Allow you to accept configuration from application.rb
                 • Set ...
Organized!




Tuesday, June 15, 2010
railtie.rb




Tuesday, June 15, 2010
lib/super_cool/view_dsl.rb




Tuesday, June 15, 2010
config/application.rb




Tuesday, June 15, 2010
Results!

Tuesday, June 15, 2010
Let’s let others be just
                 as useless.
                                MAKING THIS A
                      ...
ANATOMY OF OUR GEM




Tuesday, June 15, 2010
ANATOMY OF OUR GEM




Tuesday, June 15, 2010
package it with the usual tools...




Tuesday, June 15, 2010
Tuesday, June 15, 2010
IRC bot framework
                                             Modular enterprise app

                              FOOD ...
RESOURCES

                         http://github.com/rails/rails
                         bundle open rails
             ...
RAILS CODE IS GOOD CODE




Tuesday, June 15, 2010
RAILS CODE IS REUSABLE CODE




Tuesday, June 15, 2010
And the more use cases you find
                         for customizing Rails 3 internals,
                          the b...
Be inspired to look where
                         you might’ve not looked before

                                 and le...
Thanks!

                               twitter @digx
                                     +
                         rick...
Upcoming SlideShare
Loading in …5
×

Hardcore Extending Rails 3 - From RailsConf '10

3,002 views

Published on

Rick Martinez's presentation on some useless, but inspiring, ways to extend Rails 3.

Published in: Technology, Education

Hardcore Extending Rails 3 - From RailsConf '10

  1. 1. Hardcore! Tuesday, June 15, 2010
  2. 2. - Dave Thomas Tuesday, June 15, 2010
  3. 3. core Tuesday, June 15, 2010
  4. 4. Duck Typing "when I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck." Tuesday, June 15, 2010
  5. 5. Rails 2 Tuesday, June 15, 2010
  6. 6. I started exploring alternatives to Rails Tuesday, June 15, 2010
  7. 7. ! Tuesday, June 15, 2010
  8. 8. HISS!!! jason seifer YouTube search: rails vs. django Tuesday, June 15, 2010
  9. 9. December 23rd, 2008 Tuesday, June 15, 2010
  10. 10. Tuesday, June 15, 2010
  11. 11. + = RAILS 3 Tuesday, June 15, 2010
  12. 12. What makes Rails 3 amazing? (and why did it take so long?) Tuesday, June 15, 2010
  13. 13. “THE GREAT DECOUPLING” Tuesday, June 15, 2010
  14. 14. Tuesday, June 15, 2010
  15. 15. Core components are easily customizable. Tuesday, June 15, 2010
  16. 16. Core components are easily replaceable. OO Tuesday, June 15, 2010
  17. 17. LET’S EXPLORE SOME RAILS CORE FOR THE SAKE OF KNOWING! Tuesday, June 15, 2010
  18. 18. THE RAILS STACK Network Rack Railties ActionDispatch ActionController ActionView ActiveModel Tuesday, June 15, 2010
  19. 19. LET’S DO USELESS THINGS Tuesday, June 15, 2010
  20. 20. Take this code with a grain of salt Tuesday, June 15, 2010
  21. 21. Let’s write a useless DSL for our views. WRITING A TEMPLATE HANDLER Tuesday, June 15, 2010
  22. 22. WRITING A TEMPLATE HANDLER Tuesday, June 15, 2010
  23. 23. WRITING A TEMPLATE HANDLER Tuesday, June 15, 2010
  24. 24. WHAT ACTION VIEW EXPECTS Tuesday, June 15, 2010
  25. 25. Tuesday, June 15, 2010
  26. 26. Tuesday, June 15, 2010
  27. 27. Tuesday, June 15, 2010
  28. 28. MAKING THE DSL Tuesday, June 15, 2010
  29. 29. my_cool_dsl.rb Tuesday, June 15, 2010
  30. 30. my_cool_handler.rb Tuesday, June 15, 2010
  31. 31. views/hello/index.cool Tuesday, June 15, 2010
  32. 32. http://localhost:3000/hello Tuesday, June 15, 2010
  33. 33. Let’s accept useless connections. WRITING A “TELNET SERVER” Tuesday, June 15, 2010
  34. 34. A simple way. ACT LIKE A RACK SERVER Tuesday, June 15, 2010
  35. 35. TALK LIKE A RACK SERVER telnet_server.rb Tuesday, June 15, 2010
  36. 36. my_cool_handler.rb Tuesday, June 15, 2010
  37. 37. z my_cool_dsl.rb Tuesday, June 15, 2010
  38. 38. Tuesday, June 15, 2010
  39. 39. CONSISTENCY! Tuesday, June 15, 2010
  40. 40. hello_controller.rb views/hello/index.cool via telnet via browser Tuesday, June 15, 2010
  41. 41. DRY! Tuesday, June 15, 2010
  42. 42. Let’s make this uselessness configurable. WORKING WITH RAILTIES Tuesday, June 15, 2010
  43. 43. WHAT IS A RAILTIE? The interface between the Rails framework and its components Tuesday, June 15, 2010
  44. 44. WHAT CAN YOUR RAILTIE DO? • Allow you to accept configuration from application.rb • Set up initializers in your extension’s context • Tell Rails about generators and rake tasks • Build engines, plugins, and applications Engines, plugins, and applications are all subclasses of Railtie in Rails 3 Tuesday, June 15, 2010
  45. 45. Organized! Tuesday, June 15, 2010
  46. 46. railtie.rb Tuesday, June 15, 2010
  47. 47. lib/super_cool/view_dsl.rb Tuesday, June 15, 2010
  48. 48. config/application.rb Tuesday, June 15, 2010
  49. 49. Results! Tuesday, June 15, 2010
  50. 50. Let’s let others be just as useless. MAKING THIS A DISTRIBUTABLE FRAMEWORK Tuesday, June 15, 2010
  51. 51. ANATOMY OF OUR GEM Tuesday, June 15, 2010
  52. 52. ANATOMY OF OUR GEM Tuesday, June 15, 2010
  53. 53. package it with the usual tools... Tuesday, June 15, 2010
  54. 54. Tuesday, June 15, 2010
  55. 55. IRC bot framework Modular enterprise app FOOD FOR THOUGHT MUD game framework Modular view system A pluggable admin panel Tuesday, June 15, 2010
  56. 56. RESOURCES http://github.com/rails/rails bundle open rails bundle open actionpack bundle open ... etc ... http://railsapi.com/ Tuesday, June 15, 2010
  57. 57. RAILS CODE IS GOOD CODE Tuesday, June 15, 2010
  58. 58. RAILS CODE IS REUSABLE CODE Tuesday, June 15, 2010
  59. 59. And the more use cases you find for customizing Rails 3 internals, the better they will be written in the future Tuesday, June 15, 2010
  60. 60. Be inspired to look where you might’ve not looked before and learn! Tuesday, June 15, 2010
  61. 61. Thanks! twitter @digx + rick.martinez@gmail.com Tuesday, June 15, 2010

×