github_changelog_generator 1.12.0 → 1.12.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1082520e41cd039eab8598cf2449c64e6ff8582
|
4
|
+
data.tar.gz: ff7328f000746033e6d1aad4961f2176207e0d9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 828531cc59b47439c5d1b20dc6c7d6f6fe04a3b424b9d0f6309f71819d2a2bf7323823c1a03a3b29c239fa32760ab6df8c6f499f5b0f6f223de81b8bf5bf76c3
|
7
|
+
data.tar.gz: b5f72d08310e17c8ed3504880275d0f088c1c469cda74070e8f8badd69351f5aa3318fa75df71a4d00809fb3f2c728941a6341d0a300c953ab3a6b133e5bba5d
|
data/LICENSE
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
Copyright (c) 2016 Petr Korolev
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
5
|
+
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
7
|
+
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
9
|
+
|
@@ -54,13 +54,14 @@ module GitHubChangelogGenerator
|
|
54
54
|
|
55
55
|
# @return [Object] try to find newest tag using #Reader and :base option if specified otherwise returns nil
|
56
56
|
def detect_since_tag
|
57
|
-
@since_tag ||= @options
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
@
|
57
|
+
@since_tag ||= @options.fetch(:since_tag) { version_of_first_item }
|
58
|
+
end
|
59
|
+
|
60
|
+
def version_of_first_item
|
61
|
+
return unless File.file?(@options[:base].to_s)
|
62
|
+
|
63
|
+
sections = GitHubChangelogGenerator::Reader.new.read(@options[:base])
|
64
|
+
sections.first["version"] if sections && sections.any?
|
64
65
|
end
|
65
66
|
|
66
67
|
# Return tags after filtering tags in lists provided by option: --between-tags & --exclude-tags
|
@@ -129,26 +130,34 @@ module GitHubChangelogGenerator
|
|
129
130
|
end
|
130
131
|
|
131
132
|
# @param [Array] all_tags all tags
|
132
|
-
# @return [Array] filtered tags according :exclude_tags option
|
133
|
+
# @return [Array] filtered tags according :exclude_tags or :exclude_tags_regex option
|
133
134
|
def filter_excluded_tags(all_tags)
|
134
|
-
|
135
|
-
|
136
|
-
|
135
|
+
if @options[:exclude_tags]
|
136
|
+
apply_exclude_tags(all_tags)
|
137
|
+
elsif @options[:exclude_tags_regex]
|
138
|
+
apply_exclude_tags_regex(all_tags)
|
139
|
+
else
|
140
|
+
all_tags
|
141
|
+
end
|
137
142
|
end
|
138
143
|
|
139
144
|
private
|
140
145
|
|
141
146
|
def apply_exclude_tags(all_tags)
|
142
147
|
if @options[:exclude_tags].is_a?(Regexp)
|
143
|
-
filter_tags_with_regex(all_tags)
|
148
|
+
filter_tags_with_regex(all_tags, @options[:exclude_tags])
|
144
149
|
else
|
145
150
|
filter_exact_tags(all_tags)
|
146
151
|
end
|
147
152
|
end
|
148
153
|
|
149
|
-
def
|
154
|
+
def apply_exclude_tags_regex(all_tags)
|
155
|
+
filter_tags_with_regex(all_tags, Regexp.new(@options[:exclude_tags_regex]))
|
156
|
+
end
|
157
|
+
|
158
|
+
def filter_tags_with_regex(all_tags, regex)
|
150
159
|
warn_if_nonmatching_regex(all_tags)
|
151
|
-
all_tags.reject { |tag|
|
160
|
+
all_tags.reject { |tag| regex =~ tag.name }
|
152
161
|
end
|
153
162
|
|
154
163
|
def filter_exact_tags(all_tags)
|
@@ -122,6 +122,9 @@ module GitHubChangelogGenerator
|
|
122
122
|
opts.on("--exclude-tags x,y,z", Array, "Change log will exclude specified tags") do |list|
|
123
123
|
options[:exclude_tags] = list
|
124
124
|
end
|
125
|
+
opts.on("--exclude-tags-regex [REGEX]", "Apply a regular expression on tag names so that they can be excluded, for example: --exclude-tags-regex \".*\+\d{1,}\" ") do |last|
|
126
|
+
options[:exclude_tags_regex] = last
|
127
|
+
end
|
125
128
|
opts.on("--since-tag x", "Change log will start after specified tag") do |v|
|
126
129
|
options[:since_tag] = v
|
127
130
|
end
|
@@ -1,19 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
end
|
1
|
+
describe GitHubChangelogGenerator::Generator do
|
2
|
+
def tag_mash_with_name(tag)
|
3
|
+
Hashie::Mash.new.tap { |mash_tag| mash_tag.name = tag }
|
4
|
+
end
|
6
5
|
|
7
|
-
def tags_mash_from_strings(tags_strings)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
mash_array << mash_tag
|
6
|
+
def tags_mash_from_strings(tags_strings)
|
7
|
+
tags_strings.map do |tag|
|
8
|
+
tag_mash_with_name(tag)
|
9
|
+
end
|
12
10
|
end
|
13
|
-
mash_array
|
14
|
-
end
|
15
11
|
|
16
|
-
describe GitHubChangelogGenerator::Generator do
|
17
12
|
describe "#filter_between_tags" do
|
18
13
|
context "when between_tags nil" do
|
19
14
|
before do
|
@@ -76,31 +71,47 @@ describe GitHubChangelogGenerator::Generator do
|
|
76
71
|
describe "#filter_excluded_tags" do
|
77
72
|
subject { generator.filter_excluded_tags(tags_mash_from_strings(%w(1 2 3))) }
|
78
73
|
|
79
|
-
context "with
|
74
|
+
context "with matching string" do
|
80
75
|
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags: %w(3)) }
|
81
76
|
it { is_expected.to be_a Array }
|
82
77
|
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2))) }
|
83
78
|
end
|
84
79
|
|
85
|
-
context "with
|
80
|
+
context "with non-matching string" do
|
86
81
|
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags: %w(invalid tags)) }
|
87
82
|
it { is_expected.to be_a Array }
|
88
83
|
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
89
84
|
end
|
90
85
|
|
91
|
-
context "with regex
|
86
|
+
context "with matching regex" do
|
92
87
|
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags: /[23]/) }
|
93
88
|
it { is_expected.to be_a Array }
|
94
89
|
it { is_expected.to match_array(tags_mash_from_strings(%w(1))) }
|
95
90
|
end
|
96
91
|
|
97
|
-
context "with non-matching regex
|
92
|
+
context "with non-matching regex" do
|
98
93
|
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags: /[abc]/) }
|
99
94
|
it { is_expected.to be_a Array }
|
100
95
|
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
101
96
|
end
|
102
97
|
end
|
103
98
|
|
99
|
+
describe "#filter_excluded_tags_regex" do
|
100
|
+
subject { generator.filter_excluded_tags(tags_mash_from_strings(%w(1 2 3))) }
|
101
|
+
|
102
|
+
context "with matching regex" do
|
103
|
+
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags_regex: "[23]") }
|
104
|
+
it { is_expected.to be_a Array }
|
105
|
+
it { is_expected.to match_array(tags_mash_from_strings(%w(1))) }
|
106
|
+
end
|
107
|
+
|
108
|
+
context "with non-matching regex" do
|
109
|
+
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags_regex: "[45]") }
|
110
|
+
it { is_expected.to be_a Array }
|
111
|
+
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
104
115
|
describe "#filter_since_tag" do
|
105
116
|
context "with filled array" do
|
106
117
|
subject { generator.filter_since_tag(tags_mash_from_strings(%w(1 2 3))) }
|
@@ -190,7 +201,7 @@ describe GitHubChangelogGenerator::Generator do
|
|
190
201
|
@generator.instance_variable_set :@fetcher, mock
|
191
202
|
end
|
192
203
|
subject do
|
193
|
-
of_tag = @generator.get_time_of_tag
|
204
|
+
of_tag = @generator.get_time_of_tag(tag_mash_with_name("valid_tag"))
|
194
205
|
of_tag
|
195
206
|
end
|
196
207
|
it { is_expected.to be_a_kind_of(Time) }
|
@@ -199,31 +210,32 @@ describe GitHubChangelogGenerator::Generator do
|
|
199
210
|
end
|
200
211
|
|
201
212
|
describe "#sort_tags_by_date" do
|
202
|
-
time1
|
203
|
-
time2
|
204
|
-
time3
|
213
|
+
let(:time1) { Time.now }
|
214
|
+
let(:time2) { Time.now }
|
215
|
+
let(:time3) { Time.now }
|
216
|
+
|
205
217
|
before(:all) do
|
206
218
|
@generator = GitHubChangelogGenerator::Generator.new
|
207
219
|
end
|
220
|
+
|
221
|
+
before do
|
222
|
+
@generator.instance_variable_set(:@tag_times_hash, "valid_tag1" => time1,
|
223
|
+
"valid_tag2" => time2,
|
224
|
+
"valid_tag3" => time3)
|
225
|
+
end
|
226
|
+
|
227
|
+
subject do
|
228
|
+
@generator.sort_tags_by_date(tags)
|
229
|
+
end
|
208
230
|
context "sort unsorted tags" do
|
209
|
-
tags
|
210
|
-
|
211
|
-
@generator.instance_variable_set :@tag_times_hash, "valid_tag1" => time1, "valid_tag2" => time2, "valid_tag3" => time3
|
212
|
-
end
|
213
|
-
subject do
|
214
|
-
@generator.sort_tags_by_date tags
|
215
|
-
end
|
231
|
+
let(:tags) { tags_mash_from_strings %w(valid_tag1 valid_tag2 valid_tag3) }
|
232
|
+
|
216
233
|
it { is_expected.to be_a_kind_of(Array) }
|
217
234
|
it { is_expected.to match_array(tags.reverse!) }
|
218
235
|
end
|
219
236
|
context "sort sorted tags" do
|
220
|
-
tags
|
221
|
-
|
222
|
-
@generator.instance_variable_set :@tag_times_hash, "valid_tag1" => time1, "valid_tag2" => time2, "valid_tag3" => time3
|
223
|
-
end
|
224
|
-
subject do
|
225
|
-
@generator.sort_tags_by_date tags
|
226
|
-
end
|
237
|
+
let(:tags) { tags_mash_from_strings %w(valid_tag3 valid_tag2 valid_tag1) }
|
238
|
+
|
227
239
|
it { is_expected.to be_a_kind_of(Array) }
|
228
240
|
it { is_expected.to match_array(tags) }
|
229
241
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_changelog_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petr Korolev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -25,20 +25,6 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '10.0'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: bundler
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - ">="
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '1.7'
|
35
|
-
type: :runtime
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '1.7'
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
29
|
name: github_api
|
44
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,7 +60,7 @@ dependencies:
|
|
74
60
|
- - ">="
|
75
61
|
- !ruby/object:Gem::Version
|
76
62
|
version: '0.31'
|
77
|
-
type: :
|
63
|
+
type: :development
|
78
64
|
prerelease: false
|
79
65
|
version_requirements: !ruby/object:Gem::Requirement
|
80
66
|
requirements:
|
@@ -82,33 +68,47 @@ dependencies:
|
|
82
68
|
- !ruby/object:Gem::Version
|
83
69
|
version: '0.31'
|
84
70
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
71
|
+
name: rspec
|
86
72
|
requirement: !ruby/object:Gem::Requirement
|
87
73
|
requirements:
|
88
74
|
- - ">="
|
89
75
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
91
|
-
type: :
|
76
|
+
version: '3.2'
|
77
|
+
type: :development
|
92
78
|
prerelease: false
|
93
79
|
version_requirements: !ruby/object:Gem::Requirement
|
94
80
|
requirements:
|
95
81
|
- - ">="
|
96
82
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
83
|
+
version: '3.2'
|
98
84
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
85
|
+
name: bundler
|
100
86
|
requirement: !ruby/object:Gem::Requirement
|
101
87
|
requirements:
|
102
88
|
- - ">="
|
103
89
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
105
|
-
type: :
|
90
|
+
version: '1.7'
|
91
|
+
type: :development
|
106
92
|
prerelease: false
|
107
93
|
version_requirements: !ruby/object:Gem::Requirement
|
108
94
|
requirements:
|
109
95
|
- - ">="
|
110
96
|
- !ruby/object:Gem::Version
|
111
|
-
version: '
|
97
|
+
version: '1.7'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: rubocop
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0.31'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0.31'
|
112
112
|
description: Changelog generation has never been so easy. Fully automate changelog
|
113
113
|
generation - this gem generate change log file based on tags, issues and merged
|
114
114
|
pull requests from Github issue tracker.
|
@@ -119,6 +119,7 @@ executables:
|
|
119
119
|
extensions: []
|
120
120
|
extra_rdoc_files: []
|
121
121
|
files:
|
122
|
+
- LICENSE
|
122
123
|
- README.md
|
123
124
|
- Rakefile
|
124
125
|
- bin/git-generate-changelog
|