github_changes 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/changelog_generator/cli.rb +3 -1
- data/lib/changelog_generator/generator.rb +19 -7
- data/lib/changelog_generator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4538692d38079992fb83cdd6298a6eb3ec957bf8
|
4
|
+
data.tar.gz: d5c164b8b758c30849ff72f1bce55762f996dbb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83622b430339bf958ee60d1f1c91e655ec6ce3545ac408f2ee33999492fc047fe5e6ef4dd2870c401faed086993c6ed56e330878b09ef7c635d80a2fcffe8eca
|
7
|
+
data.tar.gz: 19eb80202cbc5805beeb04b1123fb56c97a50a3bd9d5ee094e8a29cfc7ecf6ccfd3db157beff608322025edb0d8900012d84d70c05b2334a4cb543886247774f
|
@@ -28,8 +28,10 @@ module ChangelogGenerator
|
|
28
28
|
method_option :from_ref, :aliases => "-f", :type => :string, :required => true
|
29
29
|
method_option :to_ref, :aliases => "-t", :type => :string, :default => "master"
|
30
30
|
method_option :label_filter, :aliases => "-l", :type => :string
|
31
|
+
method_option :include_pr_links, :type => :boolean
|
32
|
+
method_option :include_issue_links, :type => :boolean
|
31
33
|
def generate()
|
32
|
-
generator = Generator.new(options[:user], options[:repo], options[:from_ref], options[:to_ref], options[:label_filter])
|
34
|
+
generator = Generator.new(options[:user], options[:repo], options[:from_ref], options[:to_ref], options[:label_filter], options.include_pr_links?, options.include_issue_links?)
|
33
35
|
begin
|
34
36
|
output = generator.description + "\n\n"
|
35
37
|
output << generator.changelog
|
@@ -10,13 +10,17 @@ module ChangelogGenerator
|
|
10
10
|
attr_accessor :from_ref
|
11
11
|
attr_accessor :to_ref
|
12
12
|
attr_accessor :label_filter
|
13
|
+
attr_accessor :include_pr_links
|
14
|
+
attr_accessor :include_issue_links
|
13
15
|
|
14
|
-
def initialize(user, repo, from_ref, to_ref, label_filter = nil)
|
16
|
+
def initialize(user, repo, from_ref, to_ref, label_filter = nil, include_pr_links = false, include_issue_links = false)
|
15
17
|
self.user = user
|
16
18
|
self.repo_name = repo
|
17
19
|
self.from_ref = from_ref
|
18
20
|
self.to_ref = to_ref || "now"
|
19
21
|
self.label_filter = label_filter
|
22
|
+
self.include_pr_links = include_pr_links
|
23
|
+
self.include_issue_links = include_issue_links
|
20
24
|
end
|
21
25
|
|
22
26
|
def description
|
@@ -54,15 +58,23 @@ module ChangelogGenerator
|
|
54
58
|
pull.issues = issues.compact
|
55
59
|
end
|
56
60
|
|
57
|
-
|
61
|
+
string = pulls.reduce("") do |memo, pull|
|
62
|
+
memo << "<https://github.com/#{user}/#{repo}/pull/#{pull.number}|#{pull.number}> " if include_pr_links
|
63
|
+
memo << pull.changelog_text
|
58
64
|
|
59
|
-
|
65
|
+
if include_issue_links
|
66
|
+
pull.issues.each do |issue|
|
67
|
+
memo << " <https://github.com/#{user}/#{repo}/issues/#{issue.number}|#{issue.number}>"
|
68
|
+
end
|
69
|
+
end
|
60
70
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
string
|
71
|
+
memo << "\n"
|
72
|
+
end
|
73
|
+
|
74
|
+
string << "\n\n"
|
65
75
|
|
76
|
+
commits = pulls.map { |p| p.head_sha[0..7] }
|
77
|
+
connected_issue_nums = pulls.map(&:issues).flatten.map(&:number)
|
66
78
|
show_prs = commits.count <= 20
|
67
79
|
show_issues = show_prs && (connected_issue_nums.count > 0)
|
68
80
|
show_both = show_prs && show_issues && (commits.count + connected_issue_nums.count <= 20)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_changes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Rayment
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|