Sha256: 910566f39a6c595b50c4feb388942d06bc341a7981384ccc608913deacef7d1c

Contents?: true

Size: 1.4 KB

Versions: 41

Compression:

Stored size: 1.4 KB

Contents

# Copy BlacklightRangeLimit 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(BlacklightRangeLimit.root, "lib", "generators", "blacklight", "assets_generator.rb")
#       BlacklightRangeLimit::AssetsGenerator.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 BlacklightRangeLimit
  class AssetsGenerator < Rails::Generators::Base
    source_root File.join(BlacklightRangeLimit::Engine.root, 'app', 'assets')

    def assets
      application_css = Dir["app/assets/stylesheets/application{.css,.scss,.css.scss}"].first

      if application_css

        insert_into_file application_css, :before => "*/" do
%q{
 *
 * Used by blacklight_range_limit
 *= require  'blacklight_range_limit'
 *
}
        end
      else
        say_status "warning", "Can not find application.css, did not insert our require", :red
      end

      append_to_file "app/assets/javascripts/application.js" do
%q{

// For blacklight_range_limit built-in JS, if you don't want it you don't need
// this:
//= require 'blacklight_range_limit'

}
      end
    end



  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
blacklight_range_limit-8.5.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-8.4.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-8.3.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-8.2.3 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-8.2.2 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-8.2.1 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-8.2.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-8.1.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-8.0.1 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-8.0.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-7.9.1 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-7.9.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-6.5.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-7.8.2 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-7.8.1 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-7.8.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-7.7.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-6.4.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-7.6.0 lib/generators/blacklight_range_limit/assets_generator.rb
blacklight_range_limit-7.5.0 lib/generators/blacklight_range_limit/assets_generator.rb