Class: BlacklightRangeLimit::AssetsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/blacklight_range_limit/assets_generator.rb

Instance Method Summary collapse

Instance Method Details

#assetsObject


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/generators/blacklight_range_limit/assets_generator.rb', line 18

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