Class: RSpecTracer::RemoteCache::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_tracer/remote_cache/repo.rb

Defined Under Namespace

Classes: RepoError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(aws) ⇒ Repo

Returns a new instance of Repo.

Raises:



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rspec_tracer/remote_cache/repo.rb', line 10

def initialize(aws)
  raise RepoError, 'GIT_DEFAULT_BRANCH environment variable is not set' if ENV['GIT_DEFAULT_BRANCH'].nil?
  raise RepoError, 'GIT_BRANCH environment variable is not set' if ENV['GIT_BRANCH'].nil?

  @aws = aws
  @default_branch_name = ENV['GIT_DEFAULT_BRANCH'].chomp
  @branch_name = ENV['GIT_BRANCH'].chomp

  merge_base_branch
  fetch_head_ref
  fetch_branch_ref
  fetch_ancestry_refs
  fetch_branch_refs
  generate_cache_refs
end

Instance Attribute Details

#ancestry_refsObject (readonly)

Returns the value of attribute ancestry_refs.



8
9
10
# File 'lib/rspec_tracer/remote_cache/repo.rb', line 8

def ancestry_refs
  @ancestry_refs
end

#branch_nameObject (readonly)

Returns the value of attribute branch_name.



8
9
10
# File 'lib/rspec_tracer/remote_cache/repo.rb', line 8

def branch_name
  @branch_name
end

#branch_refObject (readonly)

Returns the value of attribute branch_ref.



8
9
10
# File 'lib/rspec_tracer/remote_cache/repo.rb', line 8

def branch_ref
  @branch_ref
end

#branch_refsObject (readonly)

Returns the value of attribute branch_refs.



8
9
10
# File 'lib/rspec_tracer/remote_cache/repo.rb', line 8

def branch_refs
  @branch_refs
end

#cache_refsObject (readonly)

Returns the value of attribute cache_refs.



8
9
10
# File 'lib/rspec_tracer/remote_cache/repo.rb', line 8

def cache_refs
  @cache_refs
end

#default_branch_nameObject (readonly)

Returns the value of attribute default_branch_name.



8
9
10
# File 'lib/rspec_tracer/remote_cache/repo.rb', line 8

def default_branch_name
  @default_branch_name
end