Class: Grayskull::Formats::YAMLHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/grayskull/formats/yaml_handler.rb

Overview

Handler for YAML file format

Class Method Summary collapse

Class Method Details

.load(file) ⇒ Object

Loads the YAML file and parses it into a ruby type.

Raises an expection if file can not be parsed.



13
14
15
16
17
18
19
# File 'lib/grayskull/formats/yaml_handler.rb', line 13

def self.load(file)
  begin
    return YAML.load_file(file)
  rescue Exception => e
    raise e.class, 'File could not be parsed as valid YAML'          
  end
end