Sha256: 17fbb6d4905a716044a966da741e2501a9dbea64d61a74d5f07c254e0fa97d8a

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require 'rails/generators'

module MamaSearch
  module Generators 
    class InstallGenerator < Rails::Generators::Base
      source_root File.join(File.dirname(__FILE__), './templates')

      def install
        say 'Installing elasticsearch...' 
        source = File.join File.dirname(__FILE__), '/../../../vendor/elasticsearch-0.16.0'
        destination = 'elasticsearch/server'
        directory source, destination 
        chmod "#{destination}/bin/", 0755
      end

      def config
        say 'Installing config...'
        template 'elasticsearch.app.yml', 'config/elasticsearch.yml'
        #copy_file 'elasticsearch.in.sh', 'config/elasticsearch/elasticsearch.in.sh'
        #copy_file 'logging.yml', 'config/elasticsearch/logging.yml'
        template 'elasticsearch.yml', 'elasticsearch/server/config/elasticsearch.yml'
        copy_file 'elasticsearch.rb', 'config/initializers/elasticsearch.rb'
      end

     protected

      def application_name
        Rails.application.class.name.split('::').first.underscore 
      end 
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mama_search-0.0.4 lib/mama_search/generators/install_generator.rb