Sha256: ccb15de3055f413d40e48ed68c93d4e33bb2bede1723e15088ee612f74a271f8

Contents?: true

Size: 891 Bytes

Versions: 4

Compression:

Stored size: 891 Bytes

Contents

module Plutonium
  module Packaging
    module Package
      extend ActiveSupport::Concern

      included do
        # prevent this package from being added to the view lookup
        # since we need finer control over how views are resolved.
        # view lookup configuration is handled at the controller level
        config.before_configuration do
          # this touches the internals of rails, but I could not find a good way of doing this
          # we get the initializer instance and set the block property to a noop
          # There is no error handling, to ensure we know when it breaks.
          add_view_paths_initializer = Rails.application.initializers.find do |a|
            a.context_class == self && a.name.to_s == "add_view_paths"
          end
          add_view_paths_initializer.instance_variable_set(:@block, ->(app) {})
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
plutonium-0.6.2 lib/plutonium/packaging/package.rb
plutonium-0.6.1 lib/plutonium/packaging/package.rb
plutonium-0.6.0 lib/plutonium/packaging/package.rb
plutonium-0.5.0 lib/plutonium/packaging/package.rb