Sha256: 46e2bbd33f4d180f2a6322d93897aa8e99adca6bd1ac051bf5b47dbec5fb215f

Contents?: true

Size: 1010 Bytes

Versions: 1

Compression:

Stored size: 1010 Bytes

Contents

module BrighterPlanet
  class Layout
    class Railtie < ::Rails::Railtie
      rake_tasks do
        load 'brighter_planet_layout/rake_tasks.rb'
      end
      initializer 'brighter_planet_layout' do |app|
        if Rails::VERSION::MAJOR == 3 and Rails::VERSION::MINOR == 0
          app.paths.app.views.push ::BrighterPlanet.layout.view_path
        else
          ::ActionController::Base.append_view_path ::BrighterPlanet.layout.view_path
        end
        if ::BrighterPlanet.layout.serve_static_files_using_rack?
          app.middleware.use '::ActionDispatch::Static', ::BrighterPlanet.layout.public_path
        end
        if ::BrighterPlanet.layout.copy_static_files?
          ::BrighterPlanet.layout.copy_static_files_to_web_server_document_root
        end
      end
      config.to_prepare do
        require ::BrighterPlanet.layout.helper_file
        ::ApplicationController.helper ::BrighterPlanetHelper
        ::ApplicationController.layout 'brighter_planet'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
brighter_planet_layout-0.5.6 lib/brighter_planet_layout/railtie.rb