Class: Conjure::Service::RepositoryLink

Inherits:
Object
  • Object
show all
Defined in:
lib/conjure/service/repository_link.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ RepositoryLink

Returns a new instance of RepositoryLink.



4
5
6
7
8
9
# File 'lib/conjure/service/repository_link.rb', line 4

def initialize(options)
  @volume = options[:volume]
  @branch = options[:branch]
  @origin_url = options[:origin_url]
  @public_key = options[:public_key]
end

Instance Method Details

#branchObject



15
16
17
# File 'lib/conjure/service/repository_link.rb', line 15

def branch
  @branch ||= git_shell.command("cd #{code_path}; git rev-parse --abbrev-ref HEAD").strip
end

#updateObject



11
12
13
# File 'lib/conjure/service/repository_link.rb', line 11

def update
  code_checked_out ? fetch_code_updates : checkout_code
end