Class: Bricky::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bricksObject

Returns the value of attribute bricks.



7
8
9
# File 'lib/bricky/config.rb', line 7

def bricks
  @bricks
end

#imagesObject

Returns the value of attribute images.



6
7
8
# File 'lib/bricky/config.rb', line 6

def images
  @images
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/bricky/config.rb', line 5

def name
  @name
end

Instance Method Details

#bricks_pathObject



21
22
23
# File 'lib/bricky/config.rb', line 21

def bricks_path
  File.expand_path("#{base_path}/etc/bricks", __FILE__)
end

#cache_pathObject



17
18
19
# File 'lib/bricky/config.rb', line 17

def cache_path
  "#{tmp_path}/cache"
end

#from_yaml(file) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/bricky/config.rb', line 9

def from_yaml(file)
  config = YAML.load_file(file)["bricky"]

  self.name = config["name"]
  self.images = config["images"]
  self.bricks = config["bricks"]
end

#hacker_pathObject



25
26
27
# File 'lib/bricky/config.rb', line 25

def hacker_path
  File.expand_path("#{base_path}/etc/hacker", __FILE__)
end

#shim_pathObject



33
34
35
# File 'lib/bricky/config.rb', line 33

def shim_path
  "#{tmp_path}/shim"
end

#tmp_pathObject



29
30
31
# File 'lib/bricky/config.rb', line 29

def tmp_path
  "#{ENV['HOME']}/.bricky/#{Bricky::CODENAME}/#{name}"
end