Class: Bijou::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/bijou/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/bijou/config.rb', line 17

def initialize
  @file_path = nil
  
  @document_root = nil
  @cache_root = nil
  @cache_ext = '.obj'
  @includes = []

  @component_base = nil
  @require_list = nil

  @cache = true
  @debug = false
  @trace_level = Bijou::Log::None
  @trace_buffer = true
end

Instance Attribute Details

#cacheObject

Returns the value of attribute cache.



44
45
46
# File 'lib/bijou/config.rb', line 44

def cache
  @cache
end

#cache_extObject

Returns the value of attribute cache_ext.



38
39
40
# File 'lib/bijou/config.rb', line 38

def cache_ext
  @cache_ext
end

#cache_rootObject

Returns the value of attribute cache_root.



37
38
39
# File 'lib/bijou/config.rb', line 37

def cache_root
  @cache_root
end

#component_baseObject

Returns the value of attribute component_base.



41
42
43
# File 'lib/bijou/config.rb', line 41

def component_base
  @component_base
end

#debugObject

Returns the value of attribute debug.



45
46
47
# File 'lib/bijou/config.rb', line 45

def debug
  @debug
end

#document_rootObject

Returns the value of attribute document_root.



36
37
38
# File 'lib/bijou/config.rb', line 36

def document_root
  @document_root
end

#file_pathObject

Returns the value of attribute file_path.



34
35
36
# File 'lib/bijou/config.rb', line 34

def file_path
  @file_path
end

#includesObject

Returns the value of attribute includes.



39
40
41
# File 'lib/bijou/config.rb', line 39

def includes
  @includes
end

#require_listObject

Returns the value of attribute require_list.



42
43
44
# File 'lib/bijou/config.rb', line 42

def require_list
  @require_list
end

#trace_bufferObject

Returns the value of attribute trace_buffer.



47
48
49
# File 'lib/bijou/config.rb', line 47

def trace_buffer
  @trace_buffer
end

#trace_levelObject

Returns the value of attribute trace_level.



46
47
48
# File 'lib/bijou/config.rb', line 46

def trace_level
  @trace_level
end

Class Method Details

.load_file(file_path) ⇒ Object



49
50
51
52
53
54
55
56
57
58
# File 'lib/bijou/config.rb', line 49

def self.load_file(file_path)
  if file_path && !file_path.empty?
    f = File.open(file_path, "r")
    cfg = new
    cfg.instance_eval(f.read(), file_path)
    cfg.file_path = file_path
    return cfg
  end
  nil
end