SlideShare a Scribd company logo
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 registration
          admin interface
              tune up
                 ...
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',
  :log_file => File.dirname(__FILE__) / quot;merb_test.logquot;
}
options =
default_options.merge($START_OPTIONS || {})

Merb.disable(:initfile)
Merb.start_environment(options)
Merb::Plugins


      ¿ORM?
Merb::Plugins
             no rules
          but make sure
    you develop a clean API
   to let other people extend
            your plugin
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;<= 2.0quot;
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

More Related Content

Merb Plugins 101