github_changelog_generator 1.2.0 → 1.2.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: 04d90423721767edc0514ae6301fb296e3dacca8
4
- data.tar.gz: 2ab86b4d1d8fc0ab004eafc26ffede1a6bd0e08a
3
+ metadata.gz: 252bfdf546f6b2c416fcf8b85dd231fb96417153
4
+ data.tar.gz: ff44c3c803bfd6609e2728d9e96d68fae222a88e
5
5
  SHA512:
6
- metadata.gz: bcc94ae00a530a5202704fc94ed76b8118234d1b1a45b6a78f928470bdb49e3f6cd9d38dc6af6e2a4cc5d63cc92df4041fcf769c6febc8f306d23036d1b50381
7
- data.tar.gz: e5a2346e221265eb2e620d2a3224f3a6a584c80d49392711b8ee3aebafdec166bdeda33d5ae19efdefd0d9ec19fafbb226784788cad82f67f4da53a2b5b5c38e
6
+ metadata.gz: 0b67d7a6b43035f09de7d98886df5bd8e48243d9135b370811fd3c9679ff171937d6c3e2916673690c5b9b1036b3a7b9bb2157d0a9ecc7e5aed400ec510b6a25
7
+ data.tar.gz: 4054d1d2c7e3f60947b9a783a9f73d7125f8dc5498cb440341a213869750dabd572a03bc50a18f09c019ea38696d65f788009e9b37054356ff20a134c58ed323
data/CHANGELOG.md CHANGED
@@ -1,8 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0)
4
+ #### 19/11/14
5
+ - *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))
6
+
7
+ - *Merged pull-request:* Test Pull-Request [\#26](https://github.com/skywinder/Github-Changelog-Generator/pull/26) ([skywinder](https://github.com/skywinder))
8
+
9
+ - *Merged pull-request:* 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))
10
+
11
+ - *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))
12
+
3
13
  ## [1.1.4] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4)
4
14
  #### 18/11/14
5
- - *Merged pull-request:* Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23)
15
+ - *Merged pull-request:* Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder))
6
16
 
7
17
  - *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)
8
18
 
@@ -10,17 +20,17 @@
10
20
 
11
21
  ## [1.1.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2)
12
22
  #### 12/11/14
13
- - *Merged pull-request:* Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18)
23
+ - *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))
14
24
 
15
- - *Merged pull-request:* Fix bug with dot signs in user name [\#17](https://github.com/skywinder/Github-Changelog-Generator/pull/17)
25
+ - *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))
16
26
 
17
27
  ## [1.1.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1)
18
28
  #### 10/11/14
19
- - *Merged pull-request:* Remove duplicates of issues and pull-requests with same number [\#15](https://github.com/skywinder/Github-Changelog-Generator/pull/15)
29
+ - *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))
20
30
 
21
- - *Merged pull-request:* Sort issues by tags [\#14](https://github.com/skywinder/Github-Changelog-Generator/pull/14)
31
+ - *Merged pull-request:* Sort issues by tags [\#14](https://github.com/skywinder/Github-Changelog-Generator/pull/14) ([skywinder](https://github.com/skywinder))
22
32
 
23
- - *Merged pull-request:* Add ability to add or exclude issues without any labels [\#13](https://github.com/skywinder/Github-Changelog-Generator/pull/13)
33
+ - *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))
24
34
 
25
35
  ## [1.1.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0)
26
36
  #### 10/11/14
@@ -32,13 +42,13 @@
32
42
 
33
43
  ## [1.0.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1)
34
44
  #### 10/11/14
35
- - *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8)
45
+ - *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder))
36
46
 
37
47
  ## [1.0.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0)
38
48
  #### 07/11/14
39
- - *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7)
49
+ - *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder))
40
50
 
41
- - *Merged pull-request:* Fix parsing date of pull request [\#3](https://github.com/skywinder/Github-Changelog-Generator/pull/3)
51
+ - *Merged pull-request:* Fix parsing date of pull request [\#3](https://github.com/skywinder/Github-Changelog-Generator/pull/3) ([skywinder](https://github.com/skywinder))
42
52
 
43
53
  - *Implemented enhancement:* Implement option to specify output filename [\#4](https://github.com/skywinder/Github-Changelog-Generator/issues/4)
44
54
 
@@ -48,9 +58,9 @@
48
58
 
49
59
  ## [0.1.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0)
50
60
  #### 07/11/14
51
- - *Merged pull-request:* Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2)
61
+ - *Merged pull-request:* Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder))
52
62
 
53
- - *Merged pull-request:* Add option (-o --output) to specify name of the output file. [\#1](https://github.com/skywinder/Github-Changelog-Generator/pull/1)
63
+ - *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))
54
64
 
55
65
  ## [0.0.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2)
56
66
  #### 06/11/14
data/README.md CHANGED
@@ -8,6 +8,8 @@ Changelog generation has never been so easy.
8
8
  This script automatically generate change-log from your tags and merged pull-requests.
9
9
 
10
10
  ## Installation:
11
+ You're almost done!
12
+
11
13
  [sudo] gem install github_changelog_generator
12
14
 
13
15
  ## Usage
@@ -44,8 +46,8 @@ Type `github_changelog_generator --help` for detailed usage.
44
46
 
45
47
  ## Examples:
46
48
 
47
- - Look at changelog for **[CHANGELOG.md](https://github.com/skywinder/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for this project
48
- - This changelog: [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/CHANGELOG.md) was generated by command:
49
+ - Look at **[CHANGELOG.md](https://github.com/skywinder/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for **this** project
50
+ - [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/CHANGELOG.md) was generated by command:
49
51
 
50
52
  github_changelog_generator -u skywinder -p ActionSheetPicker-3.0
51
53
 
@@ -15,6 +15,12 @@ module GitHubChangelogGenerator
15
15
 
16
16
  @options = Parser.parse_options
17
17
 
18
+ if options[:verbose]
19
+ puts 'Input options:'
20
+ pp options
21
+ puts ''
22
+ end
23
+
18
24
  github_token
19
25
 
20
26
  if @github_token.nil?
@@ -39,7 +45,7 @@ module GitHubChangelogGenerator
39
45
  end
40
46
 
41
47
  def exec_command(cmd)
42
- exec_cmd = "cd #{$project_path} && #{cmd}"
48
+ exec_cmd = "cd #{$project_path} and #{cmd}"
43
49
  %x[#{exec_cmd}]
44
50
  end
45
51
 
@@ -91,6 +97,7 @@ module GitHubChangelogGenerator
91
97
  end
92
98
  return filtered_pull_requests
93
99
  end
100
+
94
101
  pull_requests
95
102
  end
96
103
 
@@ -103,7 +110,7 @@ module GitHubChangelogGenerator
103
110
 
104
111
  if @options[:last]
105
112
  log += self.generate_log_between_tags(self.all_tags[0], self.all_tags[1])
106
- elsif @options[:tag1] && @options[:tag2]
113
+ elsif @options[:tag1] and @options[:tag2]
107
114
 
108
115
  tag1 = @options[:tag1]
109
116
  tag2 = @options[:tag2]
@@ -221,23 +228,23 @@ module GitHubChangelogGenerator
221
228
  end
222
229
 
223
230
  def delete_by_time(array, hash_key, newer_tag_time, older_tag_time = nil)
224
- array_new = Array.new(array)
225
- array_new.delete_if { |req|
231
+ array.select { |req|
226
232
  if req[hash_key]
227
233
  t = Time.parse(req[hash_key]).utc
228
234
 
229
235
  if older_tag_time.nil?
230
- tag_is_older_of_older = false
236
+ tag_in_range_old = true
231
237
  else
232
- tag_is_older_of_older = t > older_tag_time
238
+ tag_in_range_old = t > older_tag_time
233
239
  end
234
240
 
235
- tag_is_newer_than_new = t <= newer_tag_time
241
+ tag_in_range_new = t <= newer_tag_time
236
242
 
237
- tag_not_in_range = (tag_is_older_of_older) && (tag_is_newer_than_new)
238
- !tag_not_in_range
243
+ tag_in_range = (tag_in_range_old) && (tag_in_range_new)
244
+
245
+ tag_in_range
239
246
  else
240
- true
247
+ false
241
248
  end
242
249
  }
243
250
  end
@@ -339,13 +346,8 @@ module GitHubChangelogGenerator
339
346
 
340
347
  def get_all_issues
341
348
 
342
- if @options[:verbose]
343
- puts 'Fetching closed issues..'
344
- end
345
-
346
349
  response = @github.issues.list user: @options[:user], repo: @options[:project], state: 'closed', filter: 'all', labels: nil
347
350
 
348
-
349
351
  issues = []
350
352
  response.each_page do |page|
351
353
  issues.concat(page)
@@ -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 => %w(bug enhancement)}
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}
10
10
 
11
11
  parser = OptionParser.new { |opts|
12
12
  opts.banner = 'Usage: changelog_generator [options]'
@@ -50,7 +50,7 @@ module GitHubChangelogGenerator
50
50
  opts.on('--labels x,y,z', Array, 'Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list|
51
51
  options[:labels] = list
52
52
  end
53
- opts.on('--filter-pull-requests x,y,z', Array, 'Pull requests with that labels will be included to changelog. pull requests w\o labels will be included anyway. Default is \'bug,enhancement\'') do |list|
53
+ opts.on('--filter-pull-requests x,y,z', Array, 'Pull requests with that labels will be included to changelog. pull requests w\o labels will be included anyway.') do |list|
54
54
  options[:pull_request_labels] = list
55
55
  end
56
56
  opts.on('-v', '--version', 'Print version number') do |v|
@@ -61,12 +61,6 @@ module GitHubChangelogGenerator
61
61
 
62
62
  parser.parse!
63
63
 
64
- if options[:verbose]
65
- puts 'Input options:'
66
- pp options
67
- puts ''
68
- end
69
-
70
64
  #udefined case with 1 parameter:
71
65
  if ARGV[0] && !ARGV[1]
72
66
  puts parser.banner
@@ -1,3 +1,3 @@
1
1
  module GitHubChangelogGenerator
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
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.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Korolev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-19 00:00:00.000000000 Z
11
+ date: 2014-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler