Class: Ufo::Yaml

Inherits:
Object
  • Object
show all
Defined in:
lib/ufo/yaml.rb,
lib/ufo/yaml/loader.rb,
lib/ufo/yaml/validator.rb

Defined Under Namespace

Classes: Loader, Validator

Class Method Summary collapse

Class Method Details

.load(text) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/ufo/yaml.rb', line 4

def load(text)
  path = "#{Ufo.root}/.ufo/tmp/temp.yml"
  FileUtils.mkdir_p(File.dirname(path))
  IO.write(path, text)
  Validator.new(path).validate!
  Loader.new(text).load
end

.validate!(path) ⇒ Object



12
13
14
# File 'lib/ufo/yaml.rb', line 12

def validate!(path)
  Validator.new(path).validate!
end