PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
| Dir : /opt/puppetlabs/puppet/lib/ruby/vendor_gems/gems/hocon-1.3.1/lib/hocon/impl/ |
| Server: Linux server1.ngambekcore.com 4.18.0-553.51.1.el8_10.x86_64 #1 SMP Wed Apr 30 04:00:07 EDT 2025 x86_64 IP: 159.198.77.92 |
| Dir : //opt/puppetlabs/puppet/lib/ruby/vendor_gems/gems/hocon-1.3.1/lib/hocon/impl/config_node_root.rb |
# encoding: utf-8
require 'hocon/impl'
require 'hocon/impl/config_node_array'
require 'hocon/impl/config_node_complex_value'
require 'hocon/impl/config_node_object'
class Hocon::Impl::ConfigNodeRoot
include Hocon::Impl::ConfigNodeComplexValue
def initialize(children, origin)
super(children)
@origin = origin
end
def new_node(nodes)
raise Hocon::ConfigError::ConfigBugOrBrokenError, "Tried to indent the root object"
end
def value
@children.each do |node|
if node.is_a?(Hocon::Impl::ConfigNodeComplexValue)
return node
end
end
raise Hocon::ConfigError::ConfigBugOrBrokenError, "ConfigNodeRoot did not contain a value"
end
def set_value(desired_path, value, flavor)
children_copy = @children.clone
children_copy.each_with_index do |node, index|
if node.is_a?(Hocon::Impl::ConfigNodeComplexValue)
if node.is_a?(Hocon::Impl::ConfigNodeArray)
raise Hocon::ConfigError::ConfigBugOrBrokenError, "The ConfigDocument had an array at the root level, and values cannot be modified inside an array."
elsif node.is_a?(Hocon::Impl::ConfigNodeObject)
if value.nil?
children_copy[index] = node.remove_value_on_path(desired_path, flavor)
else
children_copy[index] = node.set_value_on_path(desired_path, value, flavor)
end
return self.class.new(children_copy, @origin)
end
end
end
raise Hocon::ConfigError::ConfigBugOrBrokenError, "ConfigNodeRoot did not contain a value"
end
def has_value(desired_path)
path = Hocon::Impl::PathParser.parse_path(desired_path)
@children.each do |node|
if node.is_a?(Hocon::Impl::ConfigNodeComplexValue)
if node.is_a?(Hocon::Impl::ConfigNodeArray)
raise Hocon::ConfigError::ConfigBugOrBrokenError, "The ConfigDocument had an array at the root level, and values cannot be modified inside an array."
elsif node.is_a?(Hocon::Impl::ConfigNodeObject)
return node.has_value(path)
end
end
end
raise Hocon::ConfigError::ConfigBugOrBrokenError, "ConfigNodeRoot did not contain a value"
end
end