github_changelog_generator 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4fd1b64ac90d44349df8c447e6195dbfcad5c52
4
- data.tar.gz: db57a9baed947b8f26bb9ee1b01e01f9c04f9f18
3
+ metadata.gz: d2f745ceb3b89e317b0fc6f59a50ee366269e81d
4
+ data.tar.gz: 0eefaea73139a411da78b4104a8ccb931bcb2722
5
5
  SHA512:
6
- metadata.gz: 988235f17554b0547caec333da72284ae3dc0130ce9da8e57500c50d0192fe198c15745764d6d8c8156bcea7658ad9b14899544655a8465d2aac9233817b49f9
7
- data.tar.gz: 1b8aa22a7c6c68cc136506c842a3da8b1b6914a8c17303112bac43c5291371a7c5ae1ae4f698142c6c25714279c50c60324e7a6f1e11d5cea2a5f6d833906a17
6
+ metadata.gz: df561e334b31cc9d201175f8300ae1e65222a4ce0cde830f162926cf00bf5d0ee6f5436712c8d73c6508e6fef1aff7af36485fb2f310e1d0c2573f01b53971e3
7
+ data.tar.gz: 402cae152bc6dbcb2f8b2eeab5e716ba9aa4e112d77d4974ed494c042f61752c11c12b247cb1753b8b42c9f3697ef44ddb5c85dafd8c1641a49dc26607c279d3
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## [1.2.5] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5)
3
+ ## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6)
4
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6)
5
+ #### 21/01/15
6
+ - *Merged pull-request:* fix link tag format [\#45](https://github.com/skywinder/Github-Changelog-Generator/pull/45) ([sugamasao](https://github.com/sugamasao))
7
+
8
+ ## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5)
9
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
4
10
  #### 15/01/15
5
11
  - *Merged pull-request:* PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
6
12
 
@@ -10,7 +16,8 @@
10
16
 
11
17
  - *Fixed bug:* Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
12
18
 
13
- ## [1.2.4] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4)
19
+ ## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4)
20
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4)
14
21
  #### 16/12/14
15
22
  - *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder))
16
23
 
@@ -24,15 +31,18 @@
24
31
 
25
32
  - *Fixed bug:* Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35)
26
33
 
27
- ## [1.2.3] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3)
34
+ ## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3)
35
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3)
28
36
  #### 16/12/14
29
- ## [1.2.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2)
37
+ ## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2)
38
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2)
30
39
  #### 10/12/14
31
40
  - *Merged pull-request:* Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef))
32
41
 
33
42
  - *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34)
34
43
 
35
- ## [1.2.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1)
44
+ ## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1)
45
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1)
36
46
  #### 22/11/14
37
47
  - *Merged pull-request:* Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder))
38
48
 
@@ -40,7 +50,8 @@
40
50
 
41
51
  - *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20)
42
52
 
43
- ## [1.2.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0)
53
+ ## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0)
54
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0)
44
55
  #### 19/11/14
45
56
  - *Merged pull-request:* 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))
46
57
 
@@ -50,19 +61,22 @@
50
61
 
51
62
  - *Merged pull-request:* 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))
52
63
 
53
- ## [1.1.4] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4)
64
+ ## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4)
65
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4)
54
66
  #### 18/11/14
55
67
  - *Merged pull-request:* Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder))
56
68
 
57
69
  - *Implemented enhancement:* 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)
58
70
 
59
- ## [1.1.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2)
71
+ ## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2)
72
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2)
60
73
  #### 12/11/14
61
74
  - *Merged pull-request:* Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18) ([skywinder](https://github.com/skywinder))
62
75
 
63
76
  - *Merged pull-request:* Fix bug with dot signs in user name [\#17](https://github.com/skywinder/Github-Changelog-Generator/pull/17) ([skywinder](https://github.com/skywinder))
64
77
 
65
- ## [1.1.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1)
78
+ ## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1)
79
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1)
66
80
  #### 10/11/14
67
81
  - *Merged pull-request:* 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))
68
82
 
@@ -70,7 +84,8 @@
70
84
 
71
85
  - *Merged pull-request:* 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))
72
86
 
73
- ## [1.1.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0)
87
+ ## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0)
88
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0)
74
89
  #### 10/11/14
75
90
  - *Implemented enhancement:* Detect username and project form origin [\#11](https://github.com/skywinder/Github-Changelog-Generator/issues/11)
76
91
 
@@ -78,11 +93,13 @@
78
93
 
79
94
  - *Fixed bug:* Bug with wrong credentials in 1.0.1 [\#12](https://github.com/skywinder/Github-Changelog-Generator/issues/12)
80
95
 
81
- ## [1.0.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1)
96
+ ## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1)
97
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1)
82
98
  #### 10/11/14
83
99
  - *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder))
84
100
 
85
- ## [1.0.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0)
101
+ ## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0)
102
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0)
86
103
  #### 07/11/14
87
104
  - *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder))
88
105
 
@@ -94,15 +111,17 @@
94
111
 
95
112
  - *Fixed bug:* Last tag not appeared in changelog [\#5](https://github.com/skywinder/Github-Changelog-Generator/issues/5)
96
113
 
97
- ## [0.1.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0)
114
+ ## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0)
115
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0)
98
116
  #### 07/11/14
99
117
  - *Merged pull-request:* Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder))
100
118
 
101
119
  - *Merged pull-request:* 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))
102
120
 
103
- ## [0.0.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2)
121
+ ## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2)
122
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2)
104
123
  #### 06/11/14
105
- ## [0.0.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1)
124
+ ## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1)
106
125
  #### 06/11/14
107
126
 
108
127
 
@@ -240,10 +240,12 @@ module GitHubChangelogGenerator
240
240
  newer_tag_name = newer_tag['name']
241
241
 
242
242
  if older_tag.nil?
243
+ older_tag_name = nil
243
244
  filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, newer_tag_time)
244
245
  filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time)
245
246
  else
246
247
  older_tag_time = self.get_time_of_tag(older_tag)
248
+ older_tag_name = older_tag['name']
247
249
  filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, newer_tag_time, older_tag_time)
248
250
  filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time, older_tag_time)
249
251
  end
@@ -285,7 +287,7 @@ module GitHubChangelogGenerator
285
287
  filtered_issues |= issues_to_add
286
288
  end
287
289
 
288
- self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time)
290
+ self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time, older_tag_name)
289
291
 
290
292
  end
291
293
 
@@ -311,20 +313,28 @@ module GitHubChangelogGenerator
311
313
  }
312
314
  end
313
315
 
314
- # @param [Array] pull_requests
315
- # @param [Array] issues
316
- # @param [String] tag_name
317
- # @param [String] tag_time
318
- # @return [String]
319
- def create_log(pull_requests, issues, tag_name, tag_time)
316
+ # @param [Array] pull_requests
317
+ # @param [Array] issues
318
+ # @param [String] newer_tag_name
319
+ # @param [String] newer_tag_time
320
+ # @param [String] older_tag_name
321
+ # @return [String]
322
+ def create_log(pull_requests, issues, newer_tag_name, newer_tag_time, older_tag_name = nil)
320
323
 
321
324
  github_site = options[:github_site] || 'https://github.com'
322
325
 
326
+ project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}"
327
+
323
328
  # Generate tag name and link
324
- log = "## [#{tag_name}](#{github_site}/#{@options[:user]}/#{@options[:project]}/tree/#{tag_name})\n"
329
+ log = "## [#{newer_tag_name}](#{project_url}/tree/#{newer_tag_name})\n"
330
+
331
+ if @options[:compare_link] && older_tag_name
332
+ # Generate compare link
333
+ log += "[Full Changelog](#{project_url}/compare/#{older_tag_name}...#{newer_tag_name})\n"
334
+ end
325
335
 
326
336
  #Generate date string:
327
- time_string = tag_time.strftime @options[:format]
337
+ time_string = newer_tag_time.strftime @options[:format]
328
338
  log += "#### #{time_string}\n"
329
339
 
330
340
  if @options[:pulls]
@@ -456,4 +466,4 @@ module GitHubChangelogGenerator
456
466
  GitHubChangelogGenerator::ChangelogGenerator.new.compund_changelog
457
467
  end
458
468
 
459
- end
469
+ end
@@ -6,7 +6,7 @@ require_relative 'version'
6
6
  module GitHubChangelogGenerator
7
7
  class Parser
8
8
  def self.parse_options
9
- options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true}
9
+ options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true}
10
10
 
11
11
  parser = OptionParser.new { |opts|
12
12
  opts.banner = 'Usage: changelog_generator [options]'
@@ -43,6 +43,9 @@ module GitHubChangelogGenerator
43
43
  opts.on('--[no-]author', 'Add author of pull-request in the end. Default is true') do |author|
44
44
  options[:last] = author
45
45
  end
46
+ opts.on('--[no-]compare-link', 'Include compare link between older version and newer version. Default is true') do |v|
47
+ options[:compare_link] = v
48
+ end
46
49
  opts.on('--labels x,y,z', Array, 'Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list|
47
50
  options[:labels] = list
48
51
  end
@@ -1,3 +1,3 @@
1
1
  module GitHubChangelogGenerator
2
- VERSION = '1.2.6'
2
+ VERSION = '1.2.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_changelog_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Korolev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-21 00:00:00.000000000 Z
11
+ date: 2015-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.4.3
110
+ rubygems_version: 2.4.4
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Script, that automatically generate change-log from your tags and pull-requests.