Module: Schai

Defined in:
lib/schai.rb,
lib/schai/cli.rb,
lib/schai/hoge.rb,
lib/schai/version.rb

Defined Under Namespace

Modules: Metadata, Optional Classes: Array, CLI, Object, Property, Root

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.parse(params) ⇒ Object



13
14
15
# File 'lib/schai/hoge.rb', line 13

def self.parse params
  Root.parse params
end

.parse_file(path) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/schai/hoge.rb', line 17

def self.parse_file path
  @@path ||=[]
  if @@path.empty?
    @@path << path
    ret = parse YAML.load_file(path)
    @@path.pop
  else
    expand_path = File.expand_path("../#{path}", @@path.last)
    @@path << expand_path
    ret = parse YAML.load_file(expand_path)
    @@path.pop
  end
  ret
end