Sha256: a47e3bdbeca6c1bbf9f0b33f202bd05bfd9b13c9b2bfad7cc7634d5c8027352d

Contents?: true

Size: 815 Bytes

Versions: 14

Compression:

Stored size: 815 Bytes

Contents

module ::Components; end

module Compony
  class Engine < Rails::Engine
    initializer 'compony.configure_eager_load_paths', before: :load_environment_hook, group: :all do
      # Allow app/components/foo/bar.rb to define constants Components::Foo::Bar and make sure components are eager loaded (needed for route generation etc.)
      Rails.autoloaders.main.push_dir(Rails.root.join('app', 'components'), namespace: ::Components)
      unless Rails.application.config.eager_load
        Rails.application.config.to_prepare do
          Rails.autoloaders.main.eager_load_dir(Rails.root.join('app', 'components'))
        end
      end
    end

    initializer 'compony.controller_mixin' do
      ActiveSupport.on_load :action_controller_base do
        include Compony::ControllerMixin
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
compony-0.5.2 lib/compony/engine.rb
compony-0.5.1 lib/compony/engine.rb
compony-0.5.0 lib/compony/engine.rb
compony-0.4.1 lib/compony/engine.rb
compony-0.4.0 lib/compony/engine.rb
compony-0.3.3 lib/compony/engine.rb
compony-0.3.2 lib/compony/engine.rb
compony-0.3.1 lib/compony/engine.rb
compony-0.3.0 lib/compony/engine.rb
compony-0.2.3 lib/compony/engine.rb
compony-0.2.2 lib/compony/engine.rb
compony-0.2.1 lib/compony/engine.rb
compony-0.2.0 lib/compony/engine.rb
compony-0.1.1 lib/compony/engine.rb