class Scruber::CLI::Generators::MongoInstall

Public Class Methods

source_root() click to toggle source
# File lib/scruber/mongo/cli/generators.rb, line 11
def self.source_root
  File.dirname(__FILE__) + '/templates'
end

Public Instance Methods

change_config() click to toggle source
# File lib/scruber/mongo/cli/generators.rb, line 24
def change_config
  gsub_file File.expand_path('../../config/application.rb', APP_PATH), /config\.fetcher_agent_adapter\s*=\s*\:(\w+)/, 'config.fetcher_agent_adapter = :mongo'
  gsub_file File.expand_path('../../config/application.rb', APP_PATH), /config.queue_adapter\s*=\s*\:(\w+)/, 'config.queue_adapter = :mongo'
end
check_for_project() click to toggle source
# File lib/scruber/mongo/cli/generators.rb, line 15
def check_for_project
  raise ::Thor::Error, "ERROR: Scruber project not found." unless defined?(APP_PATH)
end
create_files() click to toggle source
# File lib/scruber/mongo/cli/generators.rb, line 19
def create_files
  template 'mongo.tt', File.expand_path('../../config/mongo.yml', APP_PATH)
  template 'mongo_initializer.tt', File.expand_path('../../config/initializers/mongo.rb', APP_PATH)
end