Class: RSX::Configuration

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

Overview

Configuration is intentionally small: where to find components, where to put compiled output, and which cache to use.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



54
55
56
57
58
59
# File 'lib/rsx.rb', line 54

def initialize
  @paths = []
  @component_namespace = Object
  @reload = false
  self.cache_dir = default_cache_dir
end

Instance Attribute Details

#cache_dirObject

Where compiled Ruby is cached. Set to nil to compile in memory only.



43
44
45
# File 'lib/rsx.rb', line 43

def cache_dir
  @cache_dir
end

#cache_storeObject



70
71
72
# File 'lib/rsx.rb', line 70

def cache_store
  @cache_store ||= Cache::Memory.new
end

#component_namespaceObject

Namespace that component Name constants are defined under.



49
50
51
# File 'lib/rsx.rb', line 49

def component_namespace
  @component_namespace
end

#pathsObject

Directories searched for .rsx files and imports.



40
41
42
# File 'lib/rsx.rb', line 40

def paths
  @paths
end

#reloadObject

Reload changed .rsx files automatically (development).



52
53
54
# File 'lib/rsx.rb', line 52

def reload
  @reload
end

Instance Method Details

#compile_cacheObject



66
67
68
# File 'lib/rsx.rb', line 66

def compile_cache
  @compile_cache ||= CompileCache.new(@cache_dir)
end