lib/beaker/options/parser.rb
# Determine is a given file exists and is a valid YAML file
# @param [String] f The YAML file path to examine
# @param [String] msg An options message to report in case of error
# @raise [ArgumentError] Raise if file does not exist or is not valid YAML
Determine is a given file exists and is a valid YAML file
Determine is a given file exists and is a valid YAML file
def check_yaml_file(f, msg = "")
        if not File.file?(f)
          parser_error "#{f} does not exist (#{msg})"
        end
        begin
          YAML.load_file(f)
        rescue Psych::SyntaxError => e
          parser_error "#{f} is not a valid YAML file (#{msg})\n\t#{e}"
        end
      end
def check_yaml_file ( f , msg = "" ) if not File . file? ( f ) parser_error "#{f} does not exist (#{msg})" end begin YAML . load_file ( f ) rescue Psych :: SyntaxError => e parser_error "#{f} is not a valid YAML file (#{msg})\n\t#{e}" end end
Determine is a given file exists and is a valid YAML file
Determine is a given file exists and is a valid YAML file
[ArgumentError] Raise if file does not exist or is not valid YAML
[ ArgumentError ] Raise if file does not exist or is not valid YAML
f
<not_specific>
msg
<not_specific>
<not_specific>
msg An options message to report in case of error
msg An options message to report in case of error