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

#inject_cssObject



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

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

#inject_jsObject



20
21
22
23
24
25
26
27
28
# File 'lib/generators/hyrax/assets_generator.rb', line 20

def inject_js
  return if hyrax_javascript_installed?
  insert_into_file 'app/assets/javascripts/application.js', after: '//= require_tree .' do
    <<-EOF.strip_heredoc

      //= require hyrax
    EOF
  end
end

#remove_blacklight_cssObject



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

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