Class: BlacklightIiifSearch::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- BlacklightIiifSearch::InstallGenerator
- Defined in:
- lib/generators/blacklight_iiif_search/install_generator.rb
Instance Method Summary collapse
- #add_solr_config ⇒ Object
- #bundle_install ⇒ Object
- #insert_to_controllers ⇒ Object
- #insert_to_models ⇒ Object
- #insert_to_routes ⇒ Object
- #verify_blacklight_installed ⇒ Object
Instance Method Details
#add_solr_config ⇒ Object
44 45 46 |
# File 'lib/generators/blacklight_iiif_search/install_generator.rb', line 44 def add_solr_config generate 'blacklight_iiif_search:solr' unless [:'skip-solr'] end |
#bundle_install ⇒ Object
48 49 50 51 52 |
# File 'lib/generators/blacklight_iiif_search/install_generator.rb', line 48 def bundle_install Bundler.with_unbundled_env do run 'bundle install' end end |
#insert_to_controllers ⇒ Object
32 33 34 |
# File 'lib/generators/blacklight_iiif_search/install_generator.rb', line 32 def insert_to_controllers generate 'blacklight_iiif_search:controller', controller_name end |
#insert_to_models ⇒ Object
36 37 38 |
# File 'lib/generators/blacklight_iiif_search/install_generator.rb', line 36 def insert_to_models generate 'blacklight_iiif_search:model', search_builder_name end |
#insert_to_routes ⇒ Object
40 41 42 |
# File 'lib/generators/blacklight_iiif_search/install_generator.rb', line 40 def insert_to_routes generate 'blacklight_iiif_search:routes' end |
#verify_blacklight_installed ⇒ Object
25 26 27 28 29 30 |
# File 'lib/generators/blacklight_iiif_search/install_generator.rb', line 25 def verify_blacklight_installed return if IO.read('app/controllers/application_controller.rb').include?('include Blacklight::Controller') say_status('info', 'BLACKLIGHT NOT INSTALLED; GENERATING BLACKLIGHT', :blue) generate 'blacklight:install' end |