Sha256: bc7999c352376ab49e1edf0e00fb0093f1523edc91269ad1b0a7d057d1ab7ccd

Contents?: true

Size: 666 Bytes

Versions: 45

Compression:

Stored size: 666 Bytes

Contents

module <%= class_name %>
  class Engine < Rails::Engine
    require 'spree/core'
    isolate_namespace Spree
    engine_name '<%= file_name %>'

    # use rspec for tests
    config.generators do |g|
      g.test_framework :rspec
    end

    initializer '<%= file_name %>.environment', before: :load_config_initializers do |_app|
      <%= class_name %>::Config = <%= class_name %>::Configuration.new
    end

    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
        Rails.configuration.cache_classes ? require(c) : load(c)
      end
    end

    config.to_prepare(&method(:activate).to_proc)
  end
end

Version data entries

45 entries across 45 versions & 2 rubygems

Version Path
spree_cli-4.10.1 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.10.0 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.9.0 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.8.3 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.8.2 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.7.3 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.6.6 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.5.5 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cmd-4.2.7 lib/spree_cmd/templates/extension/lib/%file_name%/engine.rb.tt
spree_cmd-4.3.3 lib/spree_cmd/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.4.1 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.5.4 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.6.5 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.7.2 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.7.1 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.6.4 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.7.0 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.6.3 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.6.2 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
spree_cli-4.6.1 lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt