Class: WayOfWorking::Git::RepoReader

Inherits:
Object
  • Object
show all
Defined in:
lib/way_of_working/git/repo_reader.rb

Overview

This class holds a summary of a git tag

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base) ⇒ RepoReader

Returns a new instance of RepoReader.



12
13
14
# File 'lib/way_of_working/git/repo_reader.rb', line 12

def initialize(base)
  @base = base
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



10
11
12
# File 'lib/way_of_working/git/repo_reader.rb', line 10

def base
  @base
end

Instance Method Details

#likely_upstream_remote_urlObject



27
28
29
# File 'lib/way_of_working/git/repo_reader.rb', line 27

def likely_upstream_remote_url
  likely_upstream_remote&.url&.sub(/\.git\z/, '')
end

#summary_tagsObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/way_of_working/git/repo_reader.rb', line 16

def summary_tags
  tags = @base.tags.map do |tag|
    SummaryTag.new(tag.name, base.gcommit(tag.objectish).date)
  end.sort

  ensure_versions_are_valid_and_increasing!(tags)
  capture_change_types(tags)

  tags
end