Class: Eh::Settings

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Settings

Returns a new instance of Settings.



17
18
19
# File 'lib/eh/settings.rb', line 17

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



2
3
4
# File 'lib/eh/settings.rb', line 2

def data
  @data
end

Class Method Details

.currentObject



13
14
15
# File 'lib/eh/settings.rb', line 13

def self.current
  Thread.current[:eh_settings]
end

.current=(value) ⇒ Object



9
10
11
# File 'lib/eh/settings.rb', line 9

def self.current=(value)
  Thread.current[:eh_settings] = value
end

.load(file) ⇒ Object



3
4
5
6
7
# File 'lib/eh/settings.rb', line 3

def self.load(file)
  data = File.read(file)
  json = JSON.parse(data)
  Eh::Settings.new(json)
end

Instance Method Details

#package_tmp_dirObject



34
35
36
# File 'lib/eh/settings.rb', line 34

def package_tmp_dir
  './tmp'
end

#processes_src_dirObject



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

def processes_src_dir
  File.join(repository_root_dir, 'src', 'process')
end

#release_dirObject



26
27
28
# File 'lib/eh/settings.rb', line 26

def release_dir
  File.join(repository_root_dir, 'releases', 'ruby')
end

#repository_root_dirObject



22
23
24
# File 'lib/eh/settings.rb', line 22

def repository_root_dir
  File.expand_path(data['repository_root_dir'])
end