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



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
25
26
27
# 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_tree .' do
    <<-EOF.strip_heredoc

      //= require hyrax
    EOF
  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