Sha256: c5d04e6d7064d63c16891e8f2ed73802d954e8edfc8a09e102ded9781210cd96

Contents?: true

Size: 871 Bytes

Versions: 12

Compression:

Stored size: 871 Bytes

Contents

if Rails.version =~ /^4/
  require_dependency 'voom/presenters'
else
  require 'voom/presenters'
end

module Voom
  module Presenter
    class Engine < ::Rails::Engine
      config.autoload_paths += Dir["#{config.root}/lib/**/"]
    end
  end
end


module Voom
  module Presenter
    class Railtie < ::Rails::Railtie
      BOOT = ->{
        Voom::Presenters::Settings.configure do |config|
          config.presenters.root = Rails.root.join('app')
          # config.presenters.deep_freeze = false
        end
        Voom::Presenters::App.boot!
      }
      RELOADER = ActiveSupport::FileUpdateChecker.new([], {"app" => ["pom"]}) do
        Voom::Presenters::App.reset!
        BOOT.call
      end

      initializer 'voom-presenters' do |app|
        app.reloaders << RELOADER
      end

      config.to_prepare do
        RELOADER.execute
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
voom-presenters-0.1.11 lib/voom/presenters-engine.rb
voom-presenters-0.1.10 lib/voom/presenters-engine.rb
voom-presenters-0.1.9 lib/voom/presenters-engine.rb
voom-presenters-0.1.8 lib/voom/presenters-engine.rb
voom-presenters-0.1.7 lib/voom/presenters-engine.rb
voom-presenters-0.1.6 lib/voom/presenters-engine.rb
voom-presenters-0.1.5 lib/voom/presenters-engine.rb
voom-presenters-0.1.4 lib/voom/presenters-engine.rb
voom-presenters-0.1.3 lib/voom/presenters-engine.rb
voom-presenters-0.1.2 lib/voom/presenters-engine.rb
voom-presenters-0.1.1 lib/voom/presenters-engine.rb
voom-presenters-0.1.0 lib/voom/presenters-engine.rb