Sha256: a9cb9017b87e26a12a623273c36447bcca0f127235f2aeb55eba51ba44510bac

Contents?: true

Size: 1.62 KB

Versions: 38

Compression:

Stored size: 1.62 KB

Contents

# -*- encoding : utf-8 -*-
# lib/blacklight/engine.rb
require "blacklight"
require "rails"

module Blacklight
  class Engine < Rails::Engine

    # BlacklightHelper is needed by all helpers, so we inject it
    # into action view base here. 
    initializer 'blacklight.helpers' do |app|
      ActionView::Base.send :include, BlacklightHelper
    end
    
    # Expose Jquery-ui image assets so they are precompiled
    # to root path so jquery-ui css compiled into asset pipeline
    # can find them. 
    # http://bibwild.wordpress.com/2011/12/08/jquery-ui-css-and-images-and-rails-asset-pipeline/
    #
    # Sorry, we end up prepending jquery-ui asset path before ALL paths, even
    # application, no easy way to insert em before the gem paths but after
    # the app paths. 
    #
    # You may want to disable this if you want to supply your own theme, just set
    #     Blacklight::Engine.config.jquery_ui_images = false
    # in config/appliction.rb or other pre-initializer control point. 
    config.before_configuration do
      config.jquery_ui_images = true
    end
    initializer "blacklight.jquery_ui_images",
            :group => :all,
            :after => :append_assets_path do
      if config.jquery_ui_images
        Rails.application.config.assets.paths.unshift self.class.root.join("app", "assets", "stylesheets", "jquery", "ui-lightness").to_s
      end
    end

    # This makes our rake tasks visible.
    rake_tasks do
      Dir.chdir(File.expand_path(File.join(File.dirname(__FILE__), '..'))) do
        Dir.glob(File.join('railties', '*.rake')).each do |railtie|
          load railtie
        end
      end
    end

  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
blacklight-4.9.0 lib/blacklight/engine.rb
blacklight-4.8.0 lib/blacklight/engine.rb
blacklight-4.7.0 lib/blacklight/engine.rb
blacklight-4.7.0.pre1 lib/blacklight/engine.rb
blacklight-4.6.3 lib/blacklight/engine.rb
blacklight-4.6.2 lib/blacklight/engine.rb
blacklight-4.6.1 lib/blacklight/engine.rb
blacklight-4.6.0 lib/blacklight/engine.rb
blacklight-4.5.0 lib/blacklight/engine.rb
blacklight-4.5.0.rc1 lib/blacklight/engine.rb
blacklight-4.4.2 lib/blacklight/engine.rb
blacklight-4.4.1 lib/blacklight/engine.rb
blacklight-4.4.0 lib/blacklight/engine.rb
blacklight-4.3.0 lib/blacklight/engine.rb
blacklight-4.2.2 lib/blacklight/engine.rb
blacklight-4.2.1 lib/blacklight/engine.rb
blacklight-4.2.0 lib/blacklight/engine.rb
blacklight-4.1.0 lib/blacklight/engine.rb
blacklight-4.0.1 lib/blacklight/engine.rb
blacklight-3.8.2 lib/blacklight/engine.rb