Sha256: bd12c800288443e8abb7cd24405cb33b547b0786acff6dff5d35763bc0fa6b24

Contents?: true

Size: 1.23 KB

Versions: 11

Compression:

Stored size: 1.23 KB

Contents

# -*- encoding : utf-8 -*-
# Copy Blacklight assets to public folder in current app. 
# If you want to do this on application startup, you can
# add this next line to your one of your environment files --
# generally you'd only want to do this in 'development', and can
# add it to environments/development.rb:
#       require File.join(Blacklight.root, "lib", "generators", "blacklight", "assets_generator.rb")
#       Blacklight::Assets.start(["--force", "--quiet"])


# Need the requires here so we can call the generator from environment.rb
# as suggested above. 
require 'rails/generators'
require 'rails/generators/base'
module Blacklight
  class Assets < Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)
  
    def assets
      copy_file "blacklight.css.scss", "app/assets/stylesheets/blacklight.css.scss"

      unless IO.read("app/assets/javascripts/application.js").include?('blacklight/blacklight')
        insert_into_file "app/assets/javascripts/application.js", :after => "//= require jquery_ujs" do
  %q{
//
// Required by Blacklight
//= require blacklight/blacklight}          
        end
      end

      directory("../../../../app/assets/images/blacklight", "app/assets/images/blacklight")
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
blacklight-4.3.0 lib/generators/blacklight/assets_generator.rb
blacklight-4.2.2 lib/generators/blacklight/assets_generator.rb
blacklight-4.2.1 lib/generators/blacklight/assets_generator.rb
blacklight-4.2.0 lib/generators/blacklight/assets_generator.rb
blacklight-4.1.0 lib/generators/blacklight/assets_generator.rb
blacklight-4.0.1 lib/generators/blacklight/assets_generator.rb
blacklight-4.0.0 lib/generators/blacklight/assets_generator.rb
blacklight-4.0.0.rc2 lib/generators/blacklight/assets_generator.rb
blacklight-4.0.0.rc1 lib/generators/blacklight/assets_generator.rb
blacklight-4.0.0.pre7 lib/generators/blacklight/assets_generator.rb
blacklight-4.0.0.pre6 lib/generators/blacklight/assets_generator.rb