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


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

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
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
    <<-JS.strip_heredoc

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