Method: Framework::ApplicationGenerator#create_environment

Defined in:
lib/framework/generators/application_generator.rb

#create_environmentObject



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/framework/generators/application_generator.rb', line 77

def create_environment
  create_file 'config/environment.rb' do
    <<-CONFIG.strip_heredoc
    # Set up gems listed in the Gemfile.
    ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
    require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

    require 'framework'

    Bundler.require(:default, Framework.env)

    Framework::Application.new do |app|
      app.init!
    end
    CONFIG
  end
end