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



28
29
30
# File 'lib/generators/hyrax/assets_generator.rb', line 28

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

#inject_cssObject



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

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

#inject_jsObject



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

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

      //= require hyrax
    JS
  end
end

#remove_blacklight_cssObject



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

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