Class: Blacklight::SolrGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Blacklight::SolrGenerator
- Defined in:
- lib/generators/blacklight/solr_generator.rb
Instance Method Summary collapse
- #add_rsolr_gem ⇒ Object
- #bundle_install ⇒ Object
- #copy_solr_conf ⇒ Object
- #install_solrwrapper ⇒ Object
- #solr_wrapper_config ⇒ Object
Instance Method Details
#add_rsolr_gem ⇒ Object
33 34 35 |
# File 'lib/generators/blacklight/solr_generator.rb', line 33 def add_rsolr_gem gem 'rsolr', '>= 1.0', '< 3' end |
#bundle_install ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/generators/blacklight/solr_generator.rb', line 37 def bundle_install inside destination_root do Bundler.with_unbundled_env do run "bundle install" end end end |
#copy_solr_conf ⇒ Object
25 26 27 |
# File 'lib/generators/blacklight/solr_generator.rb', line 25 def copy_solr_conf directory 'solr' end |
#install_solrwrapper ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/generators/blacklight/solr_generator.rb', line 17 def install_solrwrapper gem_group :development, :test do gem 'solr_wrapper', '>= 0.3' end append_to_file "Rakefile", "\nrequire 'solr_wrapper/rake_task' unless Rails.env.production?\n" end |
#solr_wrapper_config ⇒ Object
29 30 31 |
# File 'lib/generators/blacklight/solr_generator.rb', line 29 def solr_wrapper_config copy_file '.solr_wrapper.yml' end |