Module: YAML

Defined in:
lib/tagen/yaml.rb

Overview

YAML.load(Pa('/tmp/a')) YAML.dump("x", Pa('/tmp/a'))

Class Method Summary (collapse)

Class Method Details

+ (Object) dump(obj, path)

add String, #path support

Parameters:



26
27
28
29
30
31
32
33
# File 'lib/tagen/yaml.rb', line 26

def dump obj, path
	if path.respond_to?(:path)
		path = path.path
		open(path, "w+"){|f| original_dump(obj, f)}
	else
		original_dump obj, path
	end
end

+ (Object) load(path)

add #path support

Parameters:



14
15
16
17
18
19
20
21
22
# File 'lib/tagen/yaml.rb', line 14

def load path
	if path.respond_to?(:path)
		path = path.path
		open(path){|f| original_load(f)}

	else
		original_load path
	end
end

+ (Object) original_dump



10
# File 'lib/tagen/yaml.rb', line 10

alias original_dump dump

+ (Object) original_load



9
# File 'lib/tagen/yaml.rb', line 9

alias original_load load