symbolize hash keys
This commit is contained in:
parent
b87aa69a4b
commit
da9e84731b
|
|
@ -93,8 +93,8 @@ end
|
|||
private_lane :syncCodeSigning do |options|
|
||||
type = options[:type] || "development"
|
||||
|
||||
options_override = load_options_from("configurations.yaml")[type]
|
||||
options.merge(options_override)
|
||||
options_override = load_options_from("configurations.yaml")[type.to_sym]
|
||||
options = options.merge(options_override)
|
||||
|
||||
match(
|
||||
app_identifier: options[:app_identifier],
|
||||
|
|
@ -107,7 +107,8 @@ private_lane :syncCodeSigning do |options|
|
|||
git_branch: "fastlane_certificates",
|
||||
keychain_password: options[:keychain_password],
|
||||
skip_docs: true,
|
||||
platform: "ios"
|
||||
platform: "ios",
|
||||
verbose: true
|
||||
)
|
||||
end
|
||||
|
||||
|
|
@ -131,8 +132,26 @@ def load_options_from(file_path)
|
|||
if File.exists? file_path
|
||||
require "yaml"
|
||||
|
||||
return YAML.load_file(file_path)
|
||||
options = YAML.load_file(file_path)
|
||||
|
||||
return symbolize_keys(options)
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
# http://www.virtuouscode.com/2009/07/14/recursively-symbolize-keys/
|
||||
def symbolize_keys(hash)
|
||||
hash.inject({}){|result, (key, value)|
|
||||
new_key = case key
|
||||
when String then key.to_sym
|
||||
else key
|
||||
end
|
||||
new_value = case value
|
||||
when Hash then symbolize_keys(value)
|
||||
else value
|
||||
end
|
||||
result[new_key] = new_value
|
||||
result
|
||||
}
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue