Sha256: fd58788b53c31ab014e03dc11a68f02a169ccbdfa39a5c8aec5042c5c71247e4

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

class EnjuLeaf::QuickInstallGenerator < Rails::Generators::Base
  source_root File.expand_path('../templates', __FILE__)

  def quick_install
    environment = ENV['ENJU_ENV'] || 'development'
    if !ENV['SKIP_CONFIG']
      rake("db:migrate", :env => environment)
      generate("enju_circulation:setup")
      generate("enju_subject:setup")
      gsub_file 'config/schedule.rb', /^set :environment, :development$/,
        "set :environment, :#{environment}"
      gsub_file 'config/environments/production.rb',
        /config.serve_static_assets = false$/,
        "config.serve_static_assets = true"
      gsub_file 'config/environments/production.rb',
        /# config.cache_store = :mem_cache_store$/,
        "config.cache_store = :dalli_store, {:compress => true}"
      gsub_file 'config/environments/production.rb',
        /# config.assets.precompile \+= %w\( search.js \)$/,
        "config.assets.precompile += %w( mobile.js mobile.css print.css )"
    end
    rake("db:migrate", :env => environment)
    rake("enju_leaf:setup", :env => environment)
    rake("enju_circulation:setup", :env => environment)
    rake("enju_subject:setup", :env => environment)
    rake("assets:precompile") if environment == 'production'
    rake("db:seed", :env => environment)
    if ENV['OS'] == 'Windows_NT'
      rake("sunspot:solr:run", :env => environment)
    else
      rake("sunspot:solr:start", :env => environment)
      sleep 5
      rake("environment sunspot:reindex", :env => environment)
      rake("sunspot:solr:stop", :env => environment)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
enju_leaf-1.1.0.rc14 lib/generators/enju_leaf/quick_install/quick_install_generator.rb
enju_leaf-1.1.0.rc13 lib/generators/enju_leaf/quick_install/quick_install_generator.rb