Permalink
Browse files

Standartizing configuration.

  • Loading branch information...
Andrew Kirilenko
Andrew Kirilenko committed Apr 24, 2012
1 parent 414a9e2 commit f26a43b998fde427009246d61f414abdb96a23c8
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/iron_worker_ng/api_client.rb
@@ -35,6 +35,8 @@ def initialize(options = {})
end
def load_from_hash(hash)
+ return if hash.nil?
+
@token ||= hash[:token] || hash['token']
@project_id ||= hash[:project_id] || hash['project_id']
@@ -62,10 +64,8 @@ def load_from_config(config_file)
if File.exists?(File.expand_path(config_file))
config = JSON.load(File.read(File.expand_path(config_file)))
- unless config['iron_worker'].nil?
- load_from_hash(config['iron_worker'])
- end
-
+ load_from_hash(config['iron_worker'])
+ load_from_hash(config['iron'])
load_from_hash(config)
end
end

0 comments on commit f26a43b

Please sign in to comment.