Class: AutoReleaseNote::GitLog

Inherits:
Object
  • Object
show all
Defined in:
lib/auto_release_note/git_log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag_query) ⇒ GitLog

Returns a new instance of GitLog.



7
8
9
10
11
12
13
# File 'lib/auto_release_note/git_log.rb', line 7

def initialize(tag_query)
  @logs = []
  @issues = []
  @git = Git.open(Dir.pwd)
  parse_merge_log(get_merge_log(tag_query))
  get_issue
end

Instance Attribute Details

#issuesObject (readonly)

Returns the value of attribute issues.



5
6
7
# File 'lib/auto_release_note/git_log.rb', line 5

def issues
  @issues
end

#logsObject (readonly)

Returns the value of attribute logs.



5
6
7
# File 'lib/auto_release_note/git_log.rb', line 5

def logs
  @logs
end

Instance Method Details

#repositoriesObject



19
20
21
# File 'lib/auto_release_note/git_log.rb', line 19

def repositories
  @git.remotes.map {|remote| remote.url.gsub(/.git$/, '') }
end

#repository(username) ⇒ Object



15
16
17
# File 'lib/auto_release_note/git_log.rb', line 15

def repository(username)
  repositories.find {|url| url.include?(username) }
end