lib/aws-partitions.rb in aws-partitions-1.424.0 vs lib/aws-partitions.rb in aws-partitions-1.425.0
- old
+ new
@@ -210,10 +210,15 @@
# @return [Hash]
# @api private
def defaults
@defaults ||= begin
path = File.expand_path('../../partitions.json', __FILE__)
- JSON.load(File.read(path))
+ defaults = if JSON::VERSION >= '2.4.0'
+ JSON.load(File.read(path), freeze: true)
+ else
+ JSON.parse(File.read(path))
+ end
+ defaults.merge('partitions' => defaults['partitions'].dup)
end
end
# @return [Hash<String,String>] Returns a map of service module names
# to their id as used in the endpoints.json document.