changelog_jira 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +233 -0
- data/Rakefile +39 -0
- data/bin/git-generate-changelog +4 -0
- data/bin/github_changelog_generator +4 -0
- data/lib/CHANGELOG.md +58 -0
- data/lib/github_changelog_generator.rb +41 -0
- data/lib/github_changelog_generator/fetcher.rb +221 -0
- data/lib/github_changelog_generator/generator/generator.rb +143 -0
- data/lib/github_changelog_generator/generator/generator_fetcher.rb +83 -0
- data/lib/github_changelog_generator/generator/generator_generation.rb +190 -0
- data/lib/github_changelog_generator/generator/generator_processor.rb +193 -0
- data/lib/github_changelog_generator/generator/generator_tags.rb +184 -0
- data/lib/github_changelog_generator/helper.rb +37 -0
- data/lib/github_changelog_generator/parser.rb +285 -0
- data/lib/github_changelog_generator/parser_file.rb +103 -0
- data/lib/github_changelog_generator/reader.rb +84 -0
- data/lib/github_changelog_generator/task.rb +67 -0
- data/lib/github_changelog_generator/version.rb +3 -0
- data/man/git-generate-changelog.1 +252 -0
- data/man/git-generate-changelog.html +262 -0
- data/man/git-generate-changelog.md +179 -0
- data/spec/files/angular.js.md +9395 -0
- data/spec/files/bundler.md +1911 -0
- data/spec/files/github-changelog-generator.md +305 -0
- data/spec/install-gem-in-bundler.gemfile +3 -0
- data/spec/spec_helper.rb +55 -0
- data/spec/unit/fetcher_spec.rb +59 -0
- data/spec/unit/generator/generator_processor_spec.rb +28 -0
- data/spec/unit/generator/generator_tags_spec.rb +243 -0
- data/spec/unit/parse_file_spec.rb +73 -0
- data/spec/unit/parser_spec.rb +60 -0
- data/spec/unit/reader_spec.rb +113 -0
- metadata +190 -0
@@ -0,0 +1,305 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## [1.3.10](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.10) (2015-03-18)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.9...1.3.10)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Exclude closed PR's from changelog. [\#69](https://github.com/skywinder/Github-Changelog-Generator/issues/69)
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Fix termination in case of empty unreleased section with `--unreleased-only` option. [\#70](https://github.com/skywinder/Github-Changelog-Generator/pull/70) ([skywinder](https://github.com/skywinder))
|
14
|
+
|
15
|
+
## [1.3.9](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.9) (2015-03-06)
|
16
|
+
|
17
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.8...1.3.9)
|
18
|
+
|
19
|
+
**Implemented enhancements:**
|
20
|
+
|
21
|
+
- Improve method of detecting owner and repository [\#63](https://github.com/skywinder/Github-Changelog-Generator/issues/63)
|
22
|
+
|
23
|
+
**Merged pull requests:**
|
24
|
+
|
25
|
+
- Resolved concurrency problem in case of issues \> 2048 [\#65](https://github.com/skywinder/Github-Changelog-Generator/pull/65) ([skywinder](https://github.com/skywinder))
|
26
|
+
|
27
|
+
## [1.3.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.8) (2015-03-05)
|
28
|
+
|
29
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.6...1.3.8)
|
30
|
+
|
31
|
+
**Merged pull requests:**
|
32
|
+
|
33
|
+
- Fix `git remote` parsing in case, when script running without parameters inside destination directory [\#61](https://github.com/skywinder/Github-Changelog-Generator/pull/61) ([skywinder](https://github.com/skywinder))
|
34
|
+
|
35
|
+
## [1.3.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.6) (2015-03-05)
|
36
|
+
|
37
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.5...1.3.6)
|
38
|
+
|
39
|
+
## [1.3.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.5) (2015-03-04)
|
40
|
+
|
41
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.4...1.3.5)
|
42
|
+
|
43
|
+
**Fixed bugs:**
|
44
|
+
|
45
|
+
- Pull Requests in Wrong Tag [\#60](https://github.com/skywinder/Github-Changelog-Generator/issues/60)
|
46
|
+
|
47
|
+
## [1.3.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.4) (2015-03-03)
|
48
|
+
|
49
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.3...1.3.4)
|
50
|
+
|
51
|
+
**Fixed bugs:**
|
52
|
+
|
53
|
+
- --no-issues appears to break PRs [\#59](https://github.com/skywinder/Github-Changelog-Generator/issues/59)
|
54
|
+
|
55
|
+
## [1.3.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.3) (2015-03-03)
|
56
|
+
|
57
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.2...1.3.3)
|
58
|
+
|
59
|
+
**Closed issues:**
|
60
|
+
|
61
|
+
- Add \# character to encapsulate list. [\#58](https://github.com/skywinder/Github-Changelog-Generator/issues/58)
|
62
|
+
|
63
|
+
## [1.3.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.2) (2015-03-03)
|
64
|
+
|
65
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.1...1.3.2)
|
66
|
+
|
67
|
+
**Fixed bugs:**
|
68
|
+
|
69
|
+
- generation failed if github commit api return `404 Not Found` [\#57](https://github.com/skywinder/Github-Changelog-Generator/issues/57)
|
70
|
+
|
71
|
+
## [1.3.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.1) (2015-02-27)
|
72
|
+
|
73
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.0...1.3.1)
|
74
|
+
|
75
|
+
## [1.3.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.0) (2015-02-26)
|
76
|
+
|
77
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.8...1.3.0)
|
78
|
+
|
79
|
+
**Implemented enhancements:**
|
80
|
+
|
81
|
+
- Do not show `Unreleased` section, when it's empty. [\#55](https://github.com/skywinder/Github-Changelog-Generator/issues/55)
|
82
|
+
|
83
|
+
- Separate list exclude and include labels [\#52](https://github.com/skywinder/Github-Changelog-Generator/issues/52)
|
84
|
+
|
85
|
+
- Unreleased issues in separate section [\#47](https://github.com/skywinder/Github-Changelog-Generator/issues/47)
|
86
|
+
|
87
|
+
- Separate by lists: Enhancements, Bugs, Pull requests. [\#31](https://github.com/skywinder/Github-Changelog-Generator/issues/31)
|
88
|
+
|
89
|
+
**Fixed bugs:**
|
90
|
+
|
91
|
+
- Test pull request with invalid label \(\#26\) in changelog appeared. [\#44](https://github.com/skywinder/Github-Changelog-Generator/issues/44)
|
92
|
+
|
93
|
+
**Merged pull requests:**
|
94
|
+
|
95
|
+
- Implement filtering of Pull Requests by milestones [\#50](https://github.com/skywinder/Github-Changelog-Generator/pull/50) ([skywinder](https://github.com/skywinder))
|
96
|
+
|
97
|
+
## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) (2015-02-17)
|
98
|
+
|
99
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8)
|
100
|
+
|
101
|
+
**Closed issues:**
|
102
|
+
|
103
|
+
- Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37)
|
104
|
+
|
105
|
+
**Merged pull requests:**
|
106
|
+
|
107
|
+
- Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder))
|
108
|
+
|
109
|
+
- Prettify output [\#48](https://github.com/skywinder/Github-Changelog-Generator/pull/48) ([skywinder](https://github.com/skywinder))
|
110
|
+
|
111
|
+
## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) (2015-01-26)
|
112
|
+
|
113
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.6...1.2.7)
|
114
|
+
|
115
|
+
**Merged pull requests:**
|
116
|
+
|
117
|
+
- Add compare link between older version and newer version [\#46](https://github.com/skywinder/Github-Changelog-Generator/pull/46) ([sue445](https://github.com/sue445))
|
118
|
+
|
119
|
+
## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6) (2015-01-21)
|
120
|
+
|
121
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6)
|
122
|
+
|
123
|
+
**Merged pull requests:**
|
124
|
+
|
125
|
+
- fix link tag format [\#45](https://github.com/skywinder/Github-Changelog-Generator/pull/45) ([sugamasao](https://github.com/sugamasao))
|
126
|
+
|
127
|
+
## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15)
|
128
|
+
|
129
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
|
130
|
+
|
131
|
+
**Implemented enhancements:**
|
132
|
+
|
133
|
+
- Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/Github-Changelog-Generator/issues/22)
|
134
|
+
|
135
|
+
**Fixed bugs:**
|
136
|
+
|
137
|
+
- Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
|
138
|
+
|
139
|
+
**Merged pull requests:**
|
140
|
+
|
141
|
+
- PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
|
142
|
+
|
143
|
+
- support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
|
144
|
+
|
145
|
+
## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) (2014-12-16)
|
146
|
+
|
147
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4)
|
148
|
+
|
149
|
+
**Fixed bugs:**
|
150
|
+
|
151
|
+
- Sometimes user is NULL during merges [\#41](https://github.com/skywinder/Github-Changelog-Generator/issues/41)
|
152
|
+
|
153
|
+
- Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35)
|
154
|
+
|
155
|
+
## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) (2014-12-16)
|
156
|
+
|
157
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3)
|
158
|
+
|
159
|
+
**Implemented enhancements:**
|
160
|
+
|
161
|
+
- Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38)
|
162
|
+
|
163
|
+
- Detailed output [\#33](https://github.com/skywinder/Github-Changelog-Generator/issues/33)
|
164
|
+
|
165
|
+
**Fixed bugs:**
|
166
|
+
|
167
|
+
- Docs lacking or basic behavior not as advertised [\#30](https://github.com/skywinder/Github-Changelog-Generator/issues/30)
|
168
|
+
|
169
|
+
**Merged pull requests:**
|
170
|
+
|
171
|
+
- Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder))
|
172
|
+
|
173
|
+
- Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder))
|
174
|
+
|
175
|
+
## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) (2014-12-10)
|
176
|
+
|
177
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2)
|
178
|
+
|
179
|
+
**Fixed bugs:**
|
180
|
+
|
181
|
+
- Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34)
|
182
|
+
|
183
|
+
**Merged pull requests:**
|
184
|
+
|
185
|
+
- Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef))
|
186
|
+
|
187
|
+
## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) (2014-11-22)
|
188
|
+
|
189
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1)
|
190
|
+
|
191
|
+
**Fixed bugs:**
|
192
|
+
|
193
|
+
- Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20)
|
194
|
+
|
195
|
+
**Merged pull requests:**
|
196
|
+
|
197
|
+
- Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder))
|
198
|
+
|
199
|
+
- Disable default --filter-pull-requests option. [\#28](https://github.com/skywinder/Github-Changelog-Generator/pull/28) ([skywinder](https://github.com/skywinder))
|
200
|
+
|
201
|
+
## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) (2014-11-19)
|
202
|
+
|
203
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0)
|
204
|
+
|
205
|
+
**Merged pull requests:**
|
206
|
+
|
207
|
+
- Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder))
|
208
|
+
|
209
|
+
- Add ability to insert authors of pull-requests \(--\[no-\]author option\) [\#25](https://github.com/skywinder/Github-Changelog-Generator/pull/25) ([skywinder](https://github.com/skywinder))
|
210
|
+
|
211
|
+
- Don't receive issues in case of --no-isses flag specied [\#24](https://github.com/skywinder/Github-Changelog-Generator/pull/24) ([skywinder](https://github.com/skywinder))
|
212
|
+
|
213
|
+
## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4) (2014-11-18)
|
214
|
+
|
215
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4)
|
216
|
+
|
217
|
+
**Implemented enhancements:**
|
218
|
+
|
219
|
+
- Implement ability to retrieve GitHub token from ENV variable \(to not put it to script directly\) [\#19](https://github.com/skywinder/Github-Changelog-Generator/issues/19)
|
220
|
+
|
221
|
+
**Merged pull requests:**
|
222
|
+
|
223
|
+
- Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder))
|
224
|
+
|
225
|
+
## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) (2014-11-12)
|
226
|
+
|
227
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2)
|
228
|
+
|
229
|
+
**Merged pull requests:**
|
230
|
+
|
231
|
+
- Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18) ([skywinder](https://github.com/skywinder))
|
232
|
+
|
233
|
+
- Fix bug with dot signs in user name [\#17](https://github.com/skywinder/Github-Changelog-Generator/pull/17) ([skywinder](https://github.com/skywinder))
|
234
|
+
|
235
|
+
## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1) (2014-11-10)
|
236
|
+
|
237
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1)
|
238
|
+
|
239
|
+
**Merged pull requests:**
|
240
|
+
|
241
|
+
- Remove duplicates of issues and pull-requests with same number [\#15](https://github.com/skywinder/Github-Changelog-Generator/pull/15) ([skywinder](https://github.com/skywinder))
|
242
|
+
|
243
|
+
- Sort issues by tags [\#14](https://github.com/skywinder/Github-Changelog-Generator/pull/14) ([skywinder](https://github.com/skywinder))
|
244
|
+
|
245
|
+
- Add ability to add or exclude issues without any labels [\#13](https://github.com/skywinder/Github-Changelog-Generator/pull/13) ([skywinder](https://github.com/skywinder))
|
246
|
+
|
247
|
+
## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0) (2014-11-10)
|
248
|
+
|
249
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0)
|
250
|
+
|
251
|
+
**Implemented enhancements:**
|
252
|
+
|
253
|
+
- Detect username and project form origin [\#11](https://github.com/skywinder/Github-Changelog-Generator/issues/11)
|
254
|
+
|
255
|
+
**Fixed bugs:**
|
256
|
+
|
257
|
+
- Bug with wrong credentials in 1.0.1 [\#12](https://github.com/skywinder/Github-Changelog-Generator/issues/12)
|
258
|
+
|
259
|
+
- Markdown formating in the last line wrong [\#9](https://github.com/skywinder/Github-Changelog-Generator/issues/9)
|
260
|
+
|
261
|
+
## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) (2014-11-10)
|
262
|
+
|
263
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1)
|
264
|
+
|
265
|
+
## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) (2014-11-07)
|
266
|
+
|
267
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0)
|
268
|
+
|
269
|
+
**Implemented enhancements:**
|
270
|
+
|
271
|
+
- Add support for fixed issues and implemented enchanments. [\#6](https://github.com/skywinder/Github-Changelog-Generator/issues/6)
|
272
|
+
|
273
|
+
- Implement option to specify output filename [\#4](https://github.com/skywinder/Github-Changelog-Generator/issues/4)
|
274
|
+
|
275
|
+
**Fixed bugs:**
|
276
|
+
|
277
|
+
- Last tag not appeared in changelog [\#5](https://github.com/skywinder/Github-Changelog-Generator/issues/5)
|
278
|
+
|
279
|
+
**Merged pull requests:**
|
280
|
+
|
281
|
+
- Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder))
|
282
|
+
|
283
|
+
- Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder))
|
284
|
+
|
285
|
+
## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) (2014-11-07)
|
286
|
+
|
287
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0)
|
288
|
+
|
289
|
+
**Merged pull requests:**
|
290
|
+
|
291
|
+
- Fix parsing date of pull request [\#3](https://github.com/skywinder/Github-Changelog-Generator/pull/3) ([skywinder](https://github.com/skywinder))
|
292
|
+
|
293
|
+
- Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder))
|
294
|
+
|
295
|
+
- Add option \(-o --output\) to specify name of the output file. [\#1](https://github.com/skywinder/Github-Changelog-Generator/pull/1) ([skywinder](https://github.com/skywinder))
|
296
|
+
|
297
|
+
## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2) (2014-11-06)
|
298
|
+
|
299
|
+
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2)
|
300
|
+
|
301
|
+
## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) (2014-11-06)
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Enrico Stahn <mail@enricostahn.com>
|
3
|
+
#
|
4
|
+
# Copyright 2014, Zanui, <engineering@zanui.com.au>
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
require "codeclimate-test-reporter"
|
19
|
+
require "simplecov"
|
20
|
+
require "coveralls"
|
21
|
+
|
22
|
+
# This module is only used to check the environment is currently a testing env
|
23
|
+
module SpecHelper
|
24
|
+
end
|
25
|
+
|
26
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
27
|
+
Coveralls::SimpleCov::Formatter,
|
28
|
+
SimpleCov::Formatter::HTMLFormatter,
|
29
|
+
CodeClimate::TestReporter::Formatter
|
30
|
+
])
|
31
|
+
SimpleCov.start
|
32
|
+
|
33
|
+
require "github_changelog_generator"
|
34
|
+
require "github_changelog_generator/task"
|
35
|
+
|
36
|
+
RSpec.configure do |config|
|
37
|
+
config.expect_with :rspec do |expectations|
|
38
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
39
|
+
end
|
40
|
+
|
41
|
+
config.mock_with :rspec do |mocks|
|
42
|
+
mocks.verify_partial_doubles = true
|
43
|
+
end
|
44
|
+
|
45
|
+
config.filter_run :focus
|
46
|
+
config.run_all_when_everything_filtered = true
|
47
|
+
|
48
|
+
config.warnings = true
|
49
|
+
|
50
|
+
config.default_formatter = "doc" if config.files_to_run.one?
|
51
|
+
|
52
|
+
config.order = :random
|
53
|
+
|
54
|
+
Kernel.srand config.seed
|
55
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
VALID_TOKEN = "0123456789abcdef"
|
2
|
+
INVALID_TOKEN = "0000000000000000"
|
3
|
+
|
4
|
+
DEFAULT_OPTIONS = { user: "skywinder",
|
5
|
+
project: "changelog_test" }
|
6
|
+
|
7
|
+
def options_with_invalid_token
|
8
|
+
options = DEFAULT_OPTIONS
|
9
|
+
options[:token] = INVALID_TOKEN
|
10
|
+
options
|
11
|
+
end
|
12
|
+
|
13
|
+
describe GitHubChangelogGenerator::Fetcher do
|
14
|
+
before(:all) do
|
15
|
+
@fetcher = GitHubChangelogGenerator::Fetcher.new
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#fetch_github_token" do
|
19
|
+
token = GitHubChangelogGenerator::Fetcher::CHANGELOG_GITHUB_TOKEN
|
20
|
+
context "when token in ENV exist" do
|
21
|
+
before { stub_const("ENV", ENV.to_hash.merge(token => VALID_TOKEN)) }
|
22
|
+
subject { @fetcher.fetch_github_token }
|
23
|
+
it { is_expected.to eq(VALID_TOKEN) }
|
24
|
+
end
|
25
|
+
context "when token in ENV is nil" do
|
26
|
+
before { stub_const("ENV", ENV.to_hash.merge(token => nil)) }
|
27
|
+
subject { @fetcher.fetch_github_token }
|
28
|
+
it { is_expected.to be_nil }
|
29
|
+
end
|
30
|
+
context "when token in options and ENV is nil" do
|
31
|
+
before do
|
32
|
+
stub_const("ENV", ENV.to_hash.merge(token => nil))
|
33
|
+
@fetcher = GitHubChangelogGenerator::Fetcher.new(token: VALID_TOKEN)
|
34
|
+
end
|
35
|
+
subject { @fetcher.fetch_github_token }
|
36
|
+
it { is_expected.to eq(VALID_TOKEN) }
|
37
|
+
end
|
38
|
+
context "when token in options and ENV specified" do
|
39
|
+
before do
|
40
|
+
stub_const("ENV", ENV.to_hash.merge(token => "no_matter_what"))
|
41
|
+
@fetcher = GitHubChangelogGenerator::Fetcher.new(token: VALID_TOKEN)
|
42
|
+
end
|
43
|
+
subject { @fetcher.fetch_github_token }
|
44
|
+
it { is_expected.to eq(VALID_TOKEN) }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "#github_fetch_tags" do
|
49
|
+
context "when wrong token provided" do
|
50
|
+
before do
|
51
|
+
options = options_with_invalid_token
|
52
|
+
@fetcher = GitHubChangelogGenerator::Fetcher.new(options)
|
53
|
+
end
|
54
|
+
it "should raise Unauthorized error" do
|
55
|
+
expect { @fetcher.github_fetch_tags }.to raise_error Github::Error::Unauthorized
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module GitHubChangelogGenerator
|
2
|
+
describe Generator do
|
3
|
+
context "#exclude_issues_by_labels" do
|
4
|
+
let(:label) { double("the-bad-label", name: "BAD") }
|
5
|
+
let(:issue) { double("the-issue-to-be-excluded", labels: [label]) }
|
6
|
+
let(:good_label) { double("a-good-label", name: "GOOD") }
|
7
|
+
let(:good_issue) { double("an-issue-to-be-kept", labels: [good_label]) }
|
8
|
+
let(:issues) { [issue, good_issue] }
|
9
|
+
subject(:generator) { described_class.new(exclude_labels: %w(BAD BOO)) }
|
10
|
+
|
11
|
+
it "removes issues with labels in the exclude_label list" do
|
12
|
+
result = generator.exclude_issues_by_labels(issues)
|
13
|
+
|
14
|
+
expect(result).to include(good_issue)
|
15
|
+
expect(result).not_to include(issue)
|
16
|
+
end
|
17
|
+
|
18
|
+
context "with no option given" do
|
19
|
+
subject(:generator) { described_class.new }
|
20
|
+
it "passes everything through when no option given" do
|
21
|
+
result = generator.exclude_issues_by_labels(issues)
|
22
|
+
|
23
|
+
expect(result).to eq(issues)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|