Sha256: 62d3c31632311db7cb9793755e81db7e9f217aaa642d4a29cdd6729fbf823382

Contents?: true

Size: 638 Bytes

Versions: 6

Compression:

Stored size: 638 Bytes

Contents

require_relative './env_checker'
module WashoutBuilder
  # the engine that is used to mount inside the rails application
  class Engine < ::Rails::Engine
    isolate_namespace WashoutBuilder
    config.washout_builder = ActiveSupport::OrderedOptions.new

    initializer 'washout_builder.configuration' do |app|
      mounted_path = app.config.washout_builder[:mounted_path]
      if WashoutBuilder::EnvChecker.new(app).available_for_env?(Rails.env)
        app.routes.append do
          mount WashoutBuilder::Engine => mounted_path if mounted_path.is_a?(String) && mounted_path.starts_with?('/')
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
washout_builder-2.0.5 lib/washout_builder/engine.rb
washout_builder-2.0.4 lib/washout_builder/engine.rb
washout_builder-2.0.3 lib/washout_builder/engine.rb
washout_builder-2.0.2 lib/washout_builder/engine.rb
washout_builder-2.0.0 lib/washout_builder/engine.rb
washout_builder-1.7.5 lib/washout_builder/engine.rb