Class: BlacklightIiifSearch::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/blacklight_iiif_search/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_solr_configObject



44
45
46
# File 'lib/generators/blacklight_iiif_search/install_generator.rb', line 44

def add_solr_config
  generate 'blacklight_iiif_search:solr' unless options[:'skip-solr']
end

#bundle_installObject



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_controllersObject



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_modelsObject



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_routesObject



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_installedObject



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