Sha256: ae2fde0b6a1cca8c0db936395a161a7b1292225b985c2f60de7e6678934dd5ce

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

require 'spree_core'
require 'meta_search'
require 'rdiscount'

module SpreeEssentials
  
  class << self
  
    # Stores an essential-aware extension for use later
    def register(key, extension)
      essentials[key] = extension
    end
        
    # Looks up an extension name 
    def has?(essential)
      essentials.keys.include?(essential.to_sym)
    end
    
    # Returns the array of essential-aware extensions
    def essentials
      @essentials ||= {}
    end
    
  end
  
  class Engine < Rails::Engine

    config.autoload_paths += %W(#{config.root}/lib)

    initializer "static assets" do |app|
      app.middleware.insert_before ::Rack::Lock, ::ActionDispatch::Static, "#{config.root}/public"
    end
        
    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator.rb")) do |c|
        Rails.env.production? ? require(c) : load(c)
      end
    end

    config.to_prepare &method(:activate).to_proc    
  end
  
  class CustomHooks < Spree::ThemeSupport::HookListener
    insert_after :admin_tabs, 'admin/shared/contents_tab'
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree_essentials-0.1.4 lib/spree_essentials.rb
spree_essentials-0.1.3 lib/spree_essentials.rb
spree_essentials-0.1.2 lib/spree_essentials.rb
spree_essentials-0.1.1 lib/spree_essentials.rb