Class: EY::Serverside::Slug::Source::Updater

Inherits:
Object
  • Object
show all
Includes:
Railway, Runner
Defined in:
lib/engineyard-serverside/slug/source/updater.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Runner

#run, #run_and_output, #run_and_success?, #runner

Methods included from Railway

#call, included

Methods included from Result::DSL

#Failure, #Success

Constructor Details

#initialize(input = {}) ⇒ Updater

Returns a new instance of Updater.



28
29
30
31
32
33
34
35
36
37
# File 'lib/engineyard-serverside/slug/source/updater.rb', line 28

def initialize(input = {})
  @input = input
  @config = input[:config]
  source = input[:config].source
  @source_cache = source.source_cache
  @uri = source.uri
  @quiet = source.opts[:verbose] ? '' : '--quiet'
  @ref = source.ref
  @git = "#{wrapped_git} --git-dir #{source_cache}/.git --work-tree #{source_cache}"
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



26
27
28
# File 'lib/engineyard-serverside/slug/source/updater.rb', line 26

def config
  @config
end

#gitObject (readonly)

Returns the value of attribute git.



26
27
28
# File 'lib/engineyard-serverside/slug/source/updater.rb', line 26

def git
  @git
end

#quietObject (readonly)

Returns the value of attribute quiet.



26
27
28
# File 'lib/engineyard-serverside/slug/source/updater.rb', line 26

def quiet
  @quiet
end

#refObject (readonly)

Returns the value of attribute ref.



26
27
28
# File 'lib/engineyard-serverside/slug/source/updater.rb', line 26

def ref
  @ref
end

#source_cacheObject (readonly)

Returns the value of attribute source_cache.



26
27
28
# File 'lib/engineyard-serverside/slug/source/updater.rb', line 26

def source_cache
  @source_cache
end

#uriObject (readonly)

Returns the value of attribute uri.



26
27
28
# File 'lib/engineyard-serverside/slug/source/updater.rb', line 26

def uri
  @uri
end

Instance Method Details

#updateObject



39
40
41
# File 'lib/engineyard-serverside/slug/source/updater.rb', line 39

def update
  call(@input)
end