Class: Blacklight::SolrGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_rsolr_gemObject



33
34
35
# File 'lib/generators/blacklight/solr_generator.rb', line 33

def add_rsolr_gem
  gem 'rsolr', '>= 1.0', '< 3'
end

#bundle_installObject



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_confObject



25
26
27
# File 'lib/generators/blacklight/solr_generator.rb', line 25

def copy_solr_conf
  directory 'solr'
end

#install_solrwrapperObject



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_configObject



29
30
31
# File 'lib/generators/blacklight/solr_generator.rb', line 29

def solr_wrapper_config
  copy_file '.solr_wrapper.yml'
end