auto_release_note 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +3 -1
- data/lib/auto_release_note/git_log.rb +13 -3
- data/lib/auto_release_note/version.rb +1 -1
- data/lib/auto_release_note.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 666a074efb83c43d9b021a68026aba78d98d81ba27ab82d81cff03a45ba28930
|
4
|
+
data.tar.gz: ea70d33b147fad86bd7d5e453950e82b60d6002647ebe73cb7bdae77063eea0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26c181b7e3a66860ba4f5e900c5529f63f27542e20f5dd14ed4aa1d87a6c30565a75cd892928910ab677b3688f2625ad644e2a4fe7123ed22bb2f78950197b9f
|
7
|
+
data.tar.gz: c83341accaf70bfc347c2bd614569dcc1135c10dd409f71bec650828b9c1c013f06df3136563b5dbf7b990435ddc3a027d48a5c7fdd92fd69af6563e37bfcf53
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
auto_release_note (0.1.
|
4
|
+
auto_release_note (0.1.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -10,6 +10,7 @@ GEM
|
|
10
10
|
diff-lcs (1.3)
|
11
11
|
ffi (1.10.0)
|
12
12
|
formatador (0.2.5)
|
13
|
+
git (1.5.0)
|
13
14
|
guard (2.15.0)
|
14
15
|
formatador (>= 0.2.4)
|
15
16
|
listen (>= 2.7, < 4.0)
|
@@ -64,6 +65,7 @@ PLATFORMS
|
|
64
65
|
DEPENDENCIES
|
65
66
|
auto_release_note!
|
66
67
|
bundler (~> 1.16)
|
68
|
+
git
|
67
69
|
guard-rspec
|
68
70
|
rake (~> 10.0)
|
69
71
|
rspec
|
@@ -1,16 +1,26 @@
|
|
1
|
+
require 'git'
|
2
|
+
|
1
3
|
module AutoReleaseNote
|
2
4
|
class GitLog
|
3
5
|
attr_reader :issues, :logs
|
4
6
|
|
5
|
-
def initialize(
|
7
|
+
def initialize(tag_query)
|
6
8
|
@logs = []
|
7
9
|
@issues = []
|
8
|
-
|
9
|
-
parse_merge_log(
|
10
|
+
@git = Git.open(Dir.pwd)
|
11
|
+
parse_merge_log(get_merge_log(tag_query))
|
10
12
|
get_issue
|
11
13
|
end
|
12
14
|
|
15
|
+
def repositories
|
16
|
+
@git.remotes.map {|remote| remote.url.gsub(/.git$/, '') }
|
17
|
+
end
|
18
|
+
|
13
19
|
private
|
20
|
+
def get_merge_log(tag_query)
|
21
|
+
merge_log ||= @git.log.between(tag_query.split("..")[0], tag_query.split("..")[1]) # `git log --merges --oneline #{tag_query} | grep 'Merge pull request #'`
|
22
|
+
end
|
23
|
+
|
14
24
|
def parse_merge_log(merge_log)
|
15
25
|
merge_log.each_line do |line|
|
16
26
|
logs << { pull_req_id: get_pull_req_id(line), branch: get_branch_name(line), issue: nil }
|
data/lib/auto_release_note.rb
CHANGED
@@ -4,10 +4,11 @@ require "auto_release_note/cli"
|
|
4
4
|
|
5
5
|
module AutoReleaseNote
|
6
6
|
class << self
|
7
|
-
def execute(username:,
|
8
|
-
log = AutoReleaseNote::GitLog.new(
|
7
|
+
def execute(username:, tag_query: nil)
|
8
|
+
log = AutoReleaseNote::GitLog.new(tag_query: tag_query)
|
9
|
+
repository = log.repositories.first
|
9
10
|
links = log.logs.map {|l| l[:issue].to_i }.sort.map do |issue|
|
10
|
-
"
|
11
|
+
"#{repository}/#{issue}"
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|