Top Level Namespace

Defined Under Namespace

Modules: OptParseValidator Classes: OptionParser

Instance Method Summary collapse

Instance Method Details

#yaml_safe_load(path) ⇒ Object

:nocov:

Parameters:

  • path (String)

    The path of the file to load



9
10
11
12
13
14
15
# File 'lib/opt_parse_validator/config_files_loader_merger.rb', line 9

def yaml_safe_load(path)
  if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0.pre1') # Ruby 2.6
    YAML.safe_load(File.read(path), permitted_classes: [Regexp]) || {}
  else
    YAML.safe_load(File.read(path), [Regexp]) || {}
  end
end