class Geoblacklight::AssetsGenerator

Public Instance Methods

add_initializers() click to toggle source
# File lib/generators/geoblacklight/assets_generator.rb, line 38
def add_initializers
  append_to_file "config/initializers/assets.rb",
    "\nRails.application.config.assets.precompile += %w( favicon.ico )\n"

  append_to_file "config/initializers/assets.rb",
    "\nRails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'images')\n"
end
add_javascript() click to toggle source
# File lib/generators/geoblacklight/assets_generator.rb, line 17
def add_javascript
  copy_file "assets/geoblacklight.js", "app/assets/javascripts/geoblacklight.js"

  if Rails.version.to_i >= 6
    append_to_file "app/assets/javascripts/application.js",
      "\n// Required by GeoBlacklight\n//= require geoblacklight"
  end
end
add_stylesheets() click to toggle source
# File lib/generators/geoblacklight/assets_generator.rb, line 31
def add_stylesheets
  copy_file "assets/application.scss", "app/assets/stylesheets/application.scss"
  copy_file "assets/_blacklight.scss", "app/assets/stylesheets/_blacklight.scss"
  copy_file "assets/_customizations.scss", "app/assets/stylesheets/_customizations.scss"
  copy_file "assets/_geoblacklight.scss", "app/assets/stylesheets/_geoblacklight.scss"
end
remove_stylesheets() click to toggle source
# File lib/generators/geoblacklight/assets_generator.rb, line 26
def remove_stylesheets
  remove_file "app/assets/stylesheets/application.css"
  remove_file "app/assets/stylesheets/blacklight.scss"
end