lib/chef/fork/application.rb in chef-fork-0.1.2 vs lib/chef/fork/application.rb in chef-fork-0.1.3
- old
+ new
@@ -19,20 +19,23 @@
end
attr_reader :options
attr_reader :optparse
def main(args=[])
- configure_chef(locate_config_file("fork") || locate_config_file("knife"))
rest = @optparse.order(args)
begin
command = get_command(rest.shift || "help").new(self)
command.run(rest)
rescue Errno::EPIPE
# noop
end
end
+ def configure(options={})
+ configure_chef(locate_config_file("fork") || locate_config_file("knife"), options)
+ end
+
private
def define_options()
options.merge!({
editor: ENV["EDITOR"],
verbose: false,
@@ -96,10 +99,10 @@
return chef_config_dir(File.dirname(path))
end
end
end
- def configure_chef(config_file)
+ def configure_chef(config_file, options={})
if config_file
@logger.info("Using configuration from #{config_file}")
Chef::Config.from_file(config_file)
else
@logger.warn("No fork/knife configuration file found")