first commit
[merb_mart.git] / lib / merb_e_mart.rb
blob9ec73aee5c7c41ac18a696cf2edf3d81d9f12b54
1 if defined?(Merb::Plugins)
3   require 'merb-slices'
4   require 'dm-validations'
5   Merb::Plugins.add_rakefiles "merb_e_mart/merbtasks"
7   Merb::Slices::register(__FILE__)
8   Merb::Slices::config[:merb_e_mart] = { :layout => :merb_e_mart }
9   
10   module MerbEMart
11     
12     # Slice metadata
13     self.description = "MerbEMart is a chunky Merb slice!"
14     self.version = "0.0.1"
15     self.author = "YOUR NAME"
16     
17     # Initialization hook - runs before AfterAppLoads BootLoader
18     def self.init
19     end
20     
21     # Activation hook - runs after AfterAppLoads BootLoader
22     def self.activate
23     end
24     
25     # Deactivation hook - triggered by Merb::Slices#deactivate
26     def self.deactivate
27     end
28     
29     # Setup routes inside the host application
30     #
31     # @param scope<Merb::Router::Behaviour>
32     #  Routes will be added within this scope (namespace). In fact, any 
33     #  router behaviour is a valid namespace, so you can attach
34     #  routes at any level of your router setup.
35     def self.setup_router(scope)
36     end
37     
38   end
39   
40   # Setup the slice layout for MerbEMart
41   #
42   # Use MerbEMart.push_path and MerbEMart.push_app_path
43   # to set paths to merb_e_mart-level and app-level paths. Example:
44   #
45   # MerbEMart.push_path(:application, MerbEMart.root)
46   # MerbEMart.push_app_path(:application, Merb.root / 'slices' / 'merb_e_mart')
47   # ...
48   #
49   # Any component path that hasn't been set will default to MerbEMart.root
50   #
51   # Or just call setup_default_structure! to setup a basic Merb MVC structure.
52   MerbEMart.setup_default_structure!
53   
54 end