-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract generators for solr 4 and 5, and default to installing solr 5
- Loading branch information
Showing
3 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'rails/generators' | ||
|
||
module Blacklight | ||
class Solr4Generator < Rails::Generators::Base | ||
desc """ | ||
This generator makes the following changes to your application: | ||
1. Installs jettywrapper into your application | ||
2. Adds rsolr to your Gemfile | ||
""" | ||
|
||
def install_jettywrapper | ||
return unless options[:jettywrapper] | ||
gem "jettywrapper", ">= 2.0" | ||
|
||
copy_file "config/jetty.yml" | ||
|
||
append_to_file "Rakefile", | ||
"\nZIP_URL = \"https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.4.zip\"\n" + | ||
"require 'jettywrapper'\n" | ||
end | ||
|
||
def add_rsolr_gem | ||
gem "rsolr", "~> 1.0.6" | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'rails/generators' | ||
|
||
module Blacklight | ||
class Solr5Generator < Rails::Generators::Base | ||
desc <<-EOF | ||
This generator makes the following changes to your application: | ||
1. Installs solr_wrapper into your application | ||
2. Adds rsolr to your Gemfile | ||
EOF | ||
|
||
def install_solrwrapper | ||
gem 'solr_wrapper', '>= 0.3' | ||
|
||
append_to_file "Rakefile", "\nrequire 'solr_wrapper/rake_task'\n" | ||
end | ||
|
||
def add_rsolr_gem | ||
gem 'rsolr', '~> 1.0.6' | ||
end | ||
end | ||
end |