lib/awestruct/cli/invoker.rb in awestruct-0.5.6.beta8 vs lib/awestruct/cli/invoker.rb in awestruct-0.5.6.beta9
- old
+ new
@@ -1,10 +1,11 @@
require 'pathname'
require 'logger'
require 'awestruct/logger'
require 'awestruct/cli/options'
require 'awestruct/util/exception_helper'
+require 'erb'
module Awestruct
module CLI
class Invoker
@@ -70,11 +71,11 @@
if ( !File.exist?( site_yaml_file ) )
abort( "No config file at #{site_yaml_file}" )
end
- site_yaml = YAML.load( File.read( site_yaml_file ) )
+ site_yaml = YAML.load( ERB.new(File.read( site_yaml_file )).result )
if ( !site_yaml )
abort( "Failed to parse #{site_yaml_file}" )
end
@@ -120,11 +121,11 @@
FileUtils.rm_rf( config.output_dir )
end
def invoke_generate()
base_url = profile['base_url'] || options.base_url
- @success = Awestruct::CLI::Generate.new( config, options.profile, base_url, Options::DEFAULT_BASE_URL, options.force ).run
+ @success = Awestruct::CLI::Generate.new( config, options.profile, base_url, Options::DEFAULT_BASE_URL, options.force, !options.generate_on_access ).run
end
def invoke_deploy()
require 'awestruct/cli/deploy'
@@ -142,10 +143,10 @@
base_url = profile['base_url'] || options.base_url
Awestruct::CLI::Auto.new( config, base_url ).run
end
def invoke_server()
- run_in_thread( Awestruct::CLI::Server.new( options.output_dir, options.bind_addr, options.port ) )
+ run_in_thread( Awestruct::CLI::Server.new( options.output_dir, options.bind_addr, options.port, options.generate_on_access ) )
end
private