Sha256: e80fd70bb7de54f9b4ced010aab5f154376b5a79f33e8523a9df19f3b9189998

Contents?: true

Size: 1.75 KB

Versions: 18

Compression:

Stored size: 1.75 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
      unless IO.read("app/assets/stylesheets/application.css").include?("Blacklight")
        copy_file('assets/standard.css.scss', 'app/assets/stylesheets/blacklight_themes/standard.css.scss')
        insert_into_file "app/assets/stylesheets/application.css", :after => "/*" do
  %q{
 * Required by Blacklight:
 *= require 'jquery/ui-lightness/jquery-ui-1.8.1.custom.css'
 *
 * This is the default theme. You can modify many of the settings 
 * by editing your local app/assets/stylesheets/blacklight_themes/standard.css
 *= require 'blacklight_themes/standard'         
 *}
        end
      end

      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 jquery-ui
//= require blacklight/blacklight}          
        end
      end

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
blacklight-3.8.2 lib/generators/blacklight/assets_generator.rb
blacklight-3.8.1 lib/generators/blacklight/assets_generator.rb
blacklight-3.8.0 lib/generators/blacklight/assets_generator.rb
blacklight-3.7.2 lib/generators/blacklight/assets_generator.rb
blacklight-3.7.1 lib/generators/blacklight/assets_generator.rb
blacklight-3.7.0 lib/generators/blacklight/assets_generator.rb
blacklight-3.6.1.1 lib/generators/blacklight/assets_generator.rb
blacklight-3.6.0 lib/generators/blacklight/assets_generator.rb
blacklight-3.5.0 lib/generators/blacklight/assets_generator.rb
blacklight-3.4.2 lib/generators/blacklight/assets_generator.rb
blacklight-3.4.1 lib/generators/blacklight/assets_generator.rb
blacklight-3.4.0 lib/generators/blacklight/assets_generator.rb
blacklight-3.3.2 lib/generators/blacklight/assets_generator.rb
blacklight-3.3.1 lib/generators/blacklight/assets_generator.rb
blacklight-3.3.0 lib/generators/blacklight/assets_generator.rb
blacklight-3.2.2 lib/generators/blacklight/assets_generator.rb
blacklight-3.2.1 lib/generators/blacklight/assets_generator.rb
blacklight-3.2.0 lib/generators/blacklight/assets_generator.rb