Skip to content

Commit

Permalink
Clean up config fetching in Cli
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil Gajwani <[email protected]>
  • Loading branch information
wendorf authored and Nikhil Gajwani committed Apr 1, 2014
1 parent 1edac5b commit e8ea7af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/bookbinder/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ def run_command(command, command_arguments)
end

def config
return @config if @config
@config ||= fetch_config
end

def fetch_config
config_hash = YAML.load(File.read('./config.yml'))
raise 'config.yml is empty' unless config_hash
@config = Configuration.new(config_hash)
Configuration.new(config_hash)
end

def unrecognized_flag(name)
Expand Down

0 comments on commit e8ea7af

Please sign in to comment.