Module: Rigup::Base

Included in:
DeployBase
Defined in:
lib/rigup/base.rb

Instance Method Summary collapse

Instance Method Details

#configObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rigup/base.rb', line 8

def config
 unless @config
  @config = {}
if ::File.exists?(f=::File.join(release_path,'rigup.yml'))
  file_config = ::YAML.load(String.from_file(f))
  @config.merge!(file_config)
  @config = ::Rigup::Config.new(@config)
end
end
 @config
end

#contextObject



20
21
22
23
24
25
26
# File 'lib/rigup/base.rb', line 20

def context
 @context ||= ::Rigup::Context.new({
:config => config,
:logger => logger,
:pwd => ::Dir.pwd
 })
end

#loggerObject



4
5
6
# File 'lib/rigup/base.rb', line 4

def logger
 @logger ||= ::Logger.new(STDOUT)
end

#release_pathObject



28
29
30
# File 'lib/rigup/base.rb', line 28

def release_path
 @release_path ||= ::File.expand_path('.')
end

#shared_pathObject



36
37
38
# File 'lib/rigup/base.rb', line 36

def shared_path
  @shared_path ||= ::File.expand_path('shared',site_dir)
end

#site_dirObject



32
33
34
# File 'lib/rigup/base.rb', line 32

def site_dir
 @site_dir ||= ::File.expand_path('../..',release_path)
end