Merb
Plugins
 1 0 1
Matt
   Aimonetti             Me



irc:   m a t t e t t i
Merb::Slices
Merb::Slices


      reusable
Merb::Slices


      reusable

               overwritable
Merb::Slices


reusable overwritable
     mini apps
Merb::Slices

         osimer
          than
        generated
          code
Merb::Slices
            login form
        password reminder
                blog
               forum
         event reg...
Merb::Slices

When?
      target application
           content
Merb::Plugins
Merb::Plugins


  NOT DataMapper plugins!
Merb::Plugins



        When?
Merb::Plugins

When?
    target extending the
         framework
Merb::Plugins


        Merb::Plugins
              !=
        Rails Plugins
Merb::Plugins


          alias_method_chain
                   =
                  evil
Merb::Plugins


       provides :hooks
Merb::Plugins



      Merb::BootLoader
Merb::Plugins



Merb::BootLoader.before_app_loads
Merb::BootLoader.after_app_loads
Merb::Plugins

        Merb API
          @private
          @public
          @plugin/overridable
Merb::Plugins

         Merb API
  if it fails your expectations
          contact us (srly)
Merb::Plugins


Merb::Plugins.config[:merb_osim]
Merb::Plugins

  Merb::Plugins.add_rakefiles
   quot;merb_osim/merbtasksquot;
Merb::Plugins


   test through the stack!
default_options = {
  :environment => 'test',
  :adapter => 'runner',
  :merb_root => File.dirname(__FILE__) / 'full-stack...
Merb::Plugins


      ¿ORM?
Merb::Plugins
             no rules
          but make sure
    you develop a clean API
   to let other people extend
    ...
Merb::Plugins



     Merb ORM   interfacerb 1.x
                       M e
Merb::Plugins


       e x t l i b
 http://github.com/sam/extlib
Merb::Plugins


      v e r s i o n
 dependency quot;merb-corequot;, quot;= 1.0quot;
dependency quot;merb-corequot;, quot;...
Merb::Plugins
    e x a m p l e s
  http://github.com/wycats/merb-more
 http://github.com/wycats/merb-plugins
Merb::Plugins

       ¿ h e l p ?
        irc://irc.freenode.net/merb
 http://groups.google.com/group/merb
T h a n k s
Upcoming SlideShare
Loading in …5
×

Merb Plugins 101

4,361 views

Published on

Best practices to write a Merb Plugin. Learn when you should use Plugins and when you should use Slices.

Presentation given by Matt Aimonetti during MerbCamp 2008

Published in: Technology, Art & Photos
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
4,361
On SlideShare
0
From Embeds
0
Number of Embeds
59
Actions
Shares
0
Downloads
51
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Merb Plugins 101

  1. Merb Plugins 1 0 1
  2. Matt Aimonetti Me irc: m a t t e t t i
  3. Merb::Slices
  4. Merb::Slices reusable
  5. Merb::Slices reusable overwritable
  6. Merb::Slices reusable overwritable mini apps
  7. Merb::Slices osimer than generated code
  8. Merb::Slices login form password reminder blog forum event registration admin interface tune up ...
  9. Merb::Slices When? target application content
  10. Merb::Plugins
  11. Merb::Plugins NOT DataMapper plugins!
  12. Merb::Plugins When?
  13. Merb::Plugins When? target extending the framework
  14. Merb::Plugins Merb::Plugins != Rails Plugins
  15. Merb::Plugins alias_method_chain = evil
  16. Merb::Plugins provides :hooks
  17. Merb::Plugins Merb::BootLoader
  18. Merb::Plugins Merb::BootLoader.before_app_loads Merb::BootLoader.after_app_loads
  19. Merb::Plugins Merb API @private @public @plugin/overridable
  20. Merb::Plugins Merb API if it fails your expectations contact us (srly)
  21. Merb::Plugins Merb::Plugins.config[:merb_osim]
  22. Merb::Plugins Merb::Plugins.add_rakefiles quot;merb_osim/merbtasksquot;
  23. Merb::Plugins test through the stack!
  24. default_options = { :environment => 'test', :adapter => 'runner', :merb_root => File.dirname(__FILE__) / 'full-stack', :log_file => File.dirname(__FILE__) / quot;merb_test.logquot; } options = default_options.merge($START_OPTIONS || {}) Merb.disable(:initfile) Merb.start_environment(options)
  25. Merb::Plugins ¿ORM?
  26. Merb::Plugins no rules but make sure you develop a clean API to let other people extend your plugin
  27. Merb::Plugins Merb ORM interfacerb 1.x M e
  28. Merb::Plugins e x t l i b http://github.com/sam/extlib
  29. Merb::Plugins v e r s i o n dependency quot;merb-corequot;, quot;= 1.0quot; dependency quot;merb-corequot;, quot;<= 2.0quot;
  30. Merb::Plugins e x a m p l e s http://github.com/wycats/merb-more http://github.com/wycats/merb-plugins
  31. Merb::Plugins ¿ h e l p ? irc://irc.freenode.net/merb http://groups.google.com/group/merb
  32. T h a n k s

×