github_changelog_generator 1.3.5 → 1.3.6

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: 3172a56b61093399473b1e3a83d9f255680f1eca
4
- data.tar.gz: d9d16eb6f5d0287186baf99e7a9340862ce3aa13
3
+ metadata.gz: 7b1449942a47d2a37c0cda470d76ec4caba31483
4
+ data.tar.gz: 6e8d379b1c4d5edc1b97651e8fe8d01acd7e7988
5
5
  SHA512:
6
- metadata.gz: 0bb1c8194bf19cdffc3fec92265c6c3f7b24178ad39a17495083719e3304d814802fc9489bb483c7fb8220df78d9e6e299fe104e940a471227a825dacb34fc44
7
- data.tar.gz: 78c91169445ec8836b92fb1a64c01be399f8f170094a466d4f216d029652749556bd54bcf45a28e799b8c8dcca5f65bcaaeb179791d8f417dffe2d15ba5c2fae
6
+ metadata.gz: 444e56278b9ee0a6d69222d294bac2c2c805e770db546cc17dbd67497d50bb975afd7d81bd58a926f89eb6f4606244c8a995615b7e2e9e6488e8693b58361261
7
+ data.tar.gz: e69af7570e4255a51d081880c1c8c651f88b24bf39f6716db54e49c789113fcac6ec10858cedb17cb7afb5e1535ed45866793bd8f44ee6658c8cc734a12dcb58
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## [1.3.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.5) (2015-03-04)
4
+
5
+ [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.4...1.3.5)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Pull Requests in Wrong Tag [\#60](https://github.com/skywinder/Github-Changelog-Generator/issues/60)
10
+
3
11
  ## [1.3.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.4) (2015-03-03)
4
12
 
5
13
  [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.3...1.3.4)
data/lib/CHANGELOG.md CHANGED
@@ -1,23 +1,5 @@
1
1
  # Change Log
2
2
 
3
- ## [v0.0.3](https://github.com/skywinder/changelog_test/tree/v0.0.3) (2015-03-04)
4
-
5
- [Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...v0.0.3)
6
-
7
- **Merged pull requests:**
8
-
9
- - fix \#3. hotfix. Should appear in v0.0.3 [\#4](https://github.com/skywinder/changelog_test/pull/4) ([skywinder](https://github.com/skywinder))
10
-
11
- ## [v0.0.2](https://github.com/skywinder/changelog_test/tree/v0.0.2) (2015-03-04)
12
-
13
- [Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.1...v0.0.2)
14
-
15
- **Merged pull requests:**
16
-
17
- - Here is a test hotfix should appear in v.0.0.2 [\#2](https://github.com/skywinder/changelog_test/pull/2) ([skywinder](https://github.com/skywinder))
18
-
19
- ## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02)
20
-
21
3
 
22
4
 
23
5
  \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
@@ -20,13 +20,7 @@ module GitHubChangelogGenerator
20
20
 
21
21
  @options = Parser.parse_options
22
22
 
23
- if options[:verbose]
24
- puts 'Input options:'
25
- pp options
26
- puts ''
27
- end
28
-
29
- github_token
23
+ fetch_github_token
30
24
 
31
25
  github_options = {per_page: PER_PAGE_NUMBER}
32
26
  github_options[:oauth_token] = @github_token unless @github_token.nil?
@@ -113,11 +107,6 @@ module GitHubChangelogGenerator
113
107
  puts JSON.pretty_generate(json)
114
108
  end
115
109
 
116
- def exec_command(cmd)
117
- exec_cmd = "cd #{$project_path} and #{cmd}"
118
- %x[#{exec_cmd}]
119
- end
120
-
121
110
  def fetch_merged_at_pull_requests
122
111
  if @options[:verbose]
123
112
  print "Fetching merged dates...\r"
@@ -240,7 +229,7 @@ module GitHubChangelogGenerator
240
229
 
241
230
  log = ''
242
231
 
243
- if @options[:unreleased]
232
+ if @options[:unreleased] && @all_tags.count != 0
244
233
  unreleased_log = self.generate_log_between_tags(self.all_tags[0], nil)
245
234
  if unreleased_log
246
235
  log += unreleased_log
@@ -250,8 +239,9 @@ module GitHubChangelogGenerator
250
239
  (1 ... self.all_tags.size).each { |index|
251
240
  log += self.generate_log_between_tags(self.all_tags[index], self.all_tags[index-1])
252
241
  }
253
-
254
- log += generate_log_between_tags(nil, self.all_tags.last)
242
+ if @all_tags.count != 0
243
+ log += generate_log_between_tags(nil, self.all_tags.last)
244
+ end
255
245
 
256
246
  log
257
247
  end
@@ -314,12 +304,8 @@ module GitHubChangelogGenerator
314
304
  tags
315
305
  end
316
306
 
317
- def github_token
318
- if @options[:token]
319
- return @github_token ||= @options[:token]
320
- end
321
-
322
- env_var = ENV.fetch 'CHANGELOG_GITHUB_TOKEN', nil
307
+ def fetch_github_token
308
+ env_var = @options[:token] ? @options[:token] : (ENV.fetch 'CHANGELOG_GITHUB_TOKEN', nil)
323
309
 
324
310
  unless env_var
325
311
  puts "Warning: No token provided (-t option) and variable $CHANGELOG_GITHUB_TOKEN was not found.".yellow
@@ -389,7 +375,7 @@ module GitHubChangelogGenerator
389
375
 
390
376
  def delete_by_time(array, hash_key, older_tag = nil, newer_tag = nil)
391
377
 
392
- raise 'At least on of the tags should be not nil!' if (older_tag.nil? && newer_tag.nil?)
378
+ raise 'At least one of the tags should be not nil!' if (older_tag.nil? && newer_tag.nil?)
393
379
 
394
380
  newer_tag_time = self.get_time_of_tag(newer_tag)
395
381
  older_tag_time = self.get_time_of_tag(older_tag)
@@ -6,8 +6,8 @@ require_relative 'version'
6
6
  module GitHubChangelogGenerator
7
7
  class Parser
8
8
  def self.parse_options
9
- # :include_labels => %w(bug enhancement),
10
- hash = {
9
+
10
+ options = {
11
11
  :tag1 => nil,
12
12
  :tag2 => nil,
13
13
  :format => '%Y-%m-%d',
@@ -28,7 +28,6 @@ module GitHubChangelogGenerator
28
28
  :unreleased => true,
29
29
  :unreleased_label => 'Unreleased'
30
30
  }
31
- options = hash
32
31
 
33
32
  parser = OptionParser.new { |opts|
34
33
  opts.banner = 'Usage: github_changelog_generator [options]'
@@ -149,6 +148,12 @@ module GitHubChangelogGenerator
149
148
  options[:tag2] = ARGV[1]
150
149
  end
151
150
 
151
+ if options[:verbose]
152
+ puts 'Performing task with options:'
153
+ pp options
154
+ puts ''
155
+ end
156
+
152
157
  options
153
158
  end
154
159
  end
@@ -1,3 +1,3 @@
1
1
  module GitHubChangelogGenerator
2
- VERSION = '1.3.5'
2
+ VERSION = '1.3.6'
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.3.5
4
+ version: 1.3.6
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-03-04 00:00:00.000000000 Z
11
+ date: 2015-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler