Module: Yamlr

Defined in:
lib/yamlr.rb,
lib/yamlr/errors.rb,
lib/yamlr/reader.rb,
lib/yamlr/writer.rb,
lib/yamlr/version.rb,
lib/yamlr/defaults.rb,
lib/yamlr/indicators.rb,
lib/yamlr/reader/node.rb,
lib/yamlr/reader/format.rb,
lib/yamlr/reader/parser.rb,
lib/yamlr/reader/builder.rb,
lib/yamlr/writer/builder.rb

Defined Under Namespace

Modules: Defaults, Errors, Indicators, Reader, Writer

Constant Summary collapse

DOTFILE =
"#{ENV['HOME']}/.yamlr"
VERSION =
'2.0.0'

Class Method Summary collapse

Class Method Details

.dotfile(home = ENV['HOME']) ⇒ Object

writes a .yamlr file HOME, merges with options if :dot is true



30
31
32
# File 'lib/yamlr.rb', line 30

def self.dotfile(home = ENV['HOME'])
  Yamlr::Writer.dotfile(Yamlr::Defaults.options, home)
end

.parse(object, options = {}) ⇒ Object

Hash or Array to .yml Array



18
19
20
# File 'lib/yamlr.rb', line 18

def self.parse(object, options = {})
  Yamlr::Writer.build(object, self.options(options))
end

.read(input, options = {}) ⇒ Object

File to Hash or Array



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

def self.read(input, options = {})
  Yamlr::Reader.read(input, self.options(options))
end

.write(object, filename, options = {}) ⇒ Object

Hash or Array to .yml file, e.g. filename.yml



24
25
26
# File 'lib/yamlr.rb', line 24

def self.write(object, filename, options = {})
  Yamlr::Writer.write(object, filename, self.options(options))
end