Class: BulkOps::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- BulkOps::InstallGenerator
- Defined in:
- lib/generators/bulk_ops/install/install_generator.rb
Instance Method Summary collapse
- #copy_github_config ⇒ Object
- #inject_compile_assets ⇒ Object
- #inject_routes ⇒ Object
- #inject_sidebar_widget ⇒ Object
Instance Method Details
#copy_github_config ⇒ Object
23 24 25 |
# File 'lib/generators/bulk_ops/install/install_generator.rb', line 23 def copy_github_config copy_file "config/github.yml.example", "config/github.yml" end |
#inject_compile_assets ⇒ Object
11 12 13 14 15 |
# File 'lib/generators/bulk_ops/install/install_generator.rb', line 11 def inject_compile_assets insert_into_file "config/initializers/assets.rb", :before => /^end/ do %{\nRails.application.config.assets.precompile += %w( bulk_ops.js )\nRails.application.config.assets.precompile += %w( bulk_ops.css )\n} end end |
#inject_routes ⇒ Object
5 6 7 8 9 |
# File 'lib/generators/bulk_ops/install/install_generator.rb', line 5 def inject_routes insert_into_file "config/routes.rb", :after => ".draw do" do %{\n mount BulkOps::Engine => '/'\n} end end |
#inject_sidebar_widget ⇒ Object
17 18 19 20 21 |
# File 'lib/generators/bulk_ops/install/install_generator.rb', line 17 def append_to_file "app/views/hyrax/dashboard/sidebar/_ingests.html.erb" do %{\n <%= render 'bulk_ops/bulk_ops_sidebar_widget', menu: menu %> \n} end end |