Skip to content

Commit

Permalink
Adds Tire automatically if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieugagne committed Mar 17, 2014
1 parent db39339 commit 76c927b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
19 changes: 11 additions & 8 deletions lib/generators/georgia/install/install_generator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'bundler'

module Georgia
module Generators
class InstallGenerator < ::Rails::Generators::Base
Expand Down Expand Up @@ -34,18 +36,19 @@ def copy_templates
copy_file "app/controllers/pages_controller.rb"
end

def create_indices
if !defined?(Sunspot) and !defined?(Tire)
def add_default_indexer
return if defined?(Sunspot)
if !defined?(Tire)
say("Adding Tire gem for Elasticsearch", :yellow)
gem 'tire'
inside Rails.root do
Bundler.with_clean_env do
run "bundle install"
end
end
if defined?(Tire)
say("Creating elasticsearch indices", :yellow)
rake "environment tire:import CLASS=Georgia::Page FORCE=true"
rake "environment tire:import CLASS=Ckeditor::Asset FORCE=true"
end
say("Creating elasticsearch indices", :yellow)
rake "environment tire:import CLASS=Georgia::Page FORCE=true"
rake "environment tire:import CLASS=Ckeditor::Asset FORCE=true"
rake "environment tire:import CLASS=Ckeditor::Picture FORCE=true"
end

def show_readme
Expand Down
4 changes: 1 addition & 3 deletions lib/generators/georgia/install/templates/README
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Some setup you must do manually if you haven't yet:
1. Ensure you overwrite default options in your georgia initializer.
Find me at config/initializers/georgia.rb

2. Ensure your routes we've just added are in order.

3. Ensure you chose one of the 2 indexers currently available (solr or elasticsearch).
2. Ensure the routes we've just added did not messed up anything.

===============================================================================

0 comments on commit 76c927b

Please sign in to comment.