Class: Hyrax::AssetsGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_image_fileObject



26
27
28
# File 'lib/generators/hyrax/assets_generator.rb', line 26

def copy_image_file
  copy_file 'app/assets/images/unauthorized.png'
end

#inject_cssObject



15
16
17
# File 'lib/generators/hyrax/assets_generator.rb', line 15

def inject_css
  copy_file "hyrax.scss", "app/assets/stylesheets/hyrax.scss"
end

#inject_jsObject



19
20
21
22
23
24
# File 'lib/generators/hyrax/assets_generator.rb', line 19

def inject_js
  return if hyrax_javascript_installed?
  insert_into_file 'app/assets/javascripts/application.js', after: "//= require blacklight/blacklight\n" do
    "//= require hyrax\n" \
  end
end

#remove_blacklight_cssObject



11
12
13
# File 'lib/generators/hyrax/assets_generator.rb', line 11

def remove_blacklight_css
  remove_file "app/assets/stylesheets/blacklight.scss"
end