github_changelog_generator 1.10.4 → 1.11.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: c9e22202d47a9d95b6d291a8c94f4a85a93b3f43
4
- data.tar.gz: 0f8d84d785e4710797881850611085f9bacb3bc7
3
+ metadata.gz: c20db299867aa88cde0c9914af7155130708259c
4
+ data.tar.gz: 0ac2c10e11e0e1d304c741cc1c9c49b7dd1e284b
5
5
  SHA512:
6
- metadata.gz: 82d2a3c32f8cf0ee81e9094f750b42874795074448fce6f17818a88cfb8a23b75a93a80269735034cb8287016ab4f9f00ad6774e1f38ff749d16dc367cdb0098
7
- data.tar.gz: 7036d59f43b0f35b741a0341f9b0b606a52eead0b94cf5fa7b5b7389546e01235223817c99acd2c314675a2ccd6aa5e0f8fcc554f9b8f30b740f9121ba15de13
6
+ metadata.gz: af6fe116dd2dac0ab7b7a3ff1d0dc01a935eaa3edf5fefb9102e624c85397ef2aa44e6581c9952b8bcb6f82abf0214ebe4fc708a1ee0eaf6f52bda3133e132d4
7
+ data.tar.gz: c34beb4a8a1f291b1ba6f38b775c9202611d0be9fd6461a531fec0d80c1d020a1e0b621b78042018c12de3c30bcfe313485b60a6ffc6567ec43d57a776d862cb
data/Gemfile CHANGED
@@ -3,8 +3,6 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  group :test do
6
- gem "rspec", "~>3.2"
7
- gem "rubocop", "~>0.31"
8
6
  gem "coveralls", "~>0.8", require: false
9
7
  gem "simplecov", "~>0.10", require: false
10
8
  gem "codeclimate-test-reporter", "~>0.4"
@@ -1,12 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- github_changelog_generator (1.10.3)
5
- bundler (~> 1.7)
4
+ github_changelog_generator (1.11.0)
5
+ bundler (>= 1.7)
6
6
  colorize (~> 0.7)
7
7
  github_api (~> 0.12)
8
- overcommit (~> 0.31)
9
- rake (~> 10.0)
8
+ overcommit (>= 0.31)
9
+ rake (>= 10.0)
10
+ rspec (>= 3.2)
11
+ rubocop (>= 0.31)
10
12
 
11
13
  GEM
12
14
  remote: https://rubygems.org/
@@ -99,8 +101,6 @@ DEPENDENCIES
99
101
  codeclimate-test-reporter (~> 0.4)
100
102
  coveralls (~> 0.8)
101
103
  github_changelog_generator!
102
- rspec (~> 3.2)
103
- rubocop (~> 0.31)
104
104
  simplecov (~> 0.10)
105
105
 
106
106
  BUNDLED WITH
@@ -24,9 +24,11 @@ Gem::Specification.new do |spec|
24
24
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
25
25
  spec.require_paths = ["lib"]
26
26
 
27
- spec.add_runtime_dependency "rake", "~> 10.0"
28
- spec.add_runtime_dependency "bundler", "~> 1.7"
27
+ spec.add_runtime_dependency "rake", ">= 10.0"
28
+ spec.add_runtime_dependency "bundler", ">= 1.7"
29
29
  spec.add_runtime_dependency("github_api", ["~> 0.12"])
30
30
  spec.add_runtime_dependency("colorize", ["~> 0.7"])
31
- spec.add_runtime_dependency("overcommit", "~>0.31")
31
+ spec.add_runtime_dependency("overcommit", ">= 0.31")
32
+ spec.add_runtime_dependency("rubocop", ">= 0.31")
33
+ spec.add_runtime_dependency("rspec", ">= 3.2")
32
34
  end
@@ -4,13 +4,12 @@ module GitHubChangelogGenerator
4
4
  # @param [Array] issues
5
5
  # @return [Array] filtered array
6
6
  def exclude_issues_by_labels(issues)
7
- unless @options[:exclude_labels].nil?
8
- issues = issues.select do |issue|
9
- var = issue.labels.map(&:name) & @options[:exclude_labels]
10
- !var.any?
11
- end
7
+ return issues if !@options[:exclude_labels] || @options[:exclude_labels].empty?
8
+
9
+ issues.reject do |issue|
10
+ labels = issue.labels.map(&:name)
11
+ (labels & @options[:exclude_labels]).any?
12
12
  end
13
- issues
14
13
  end
15
14
 
16
15
  # @return [Array] filtered issues accourding milestone
@@ -1,21 +1,24 @@
1
+ require "pathname"
2
+
1
3
  module GitHubChangelogGenerator
2
4
  ParserError = Class.new(StandardError)
3
5
 
4
6
  class ParserFile
7
+ FILENAME = ".github_changelog_generator"
8
+
5
9
  def initialize(options)
6
10
  @options = options
7
11
  end
8
12
 
13
+ # Destructively change @options using data in configured options file.
9
14
  def parse!
10
- return unless File.exist?(file)
11
-
12
- File.readlines(file).each { |line| parse_line!(line) }
15
+ file.each_line { |line| parse_line!(line) } if file.exist?
13
16
  end
14
17
 
15
18
  private
16
19
 
17
20
  def file
18
- @file ||= File.expand_path(@options[:params_file] || ".github_changelog_generator")
21
+ @file ||= Pathname(File.expand_path(@options[:params_file] || FILENAME))
19
22
  end
20
23
 
21
24
  def parse_line!(line)
@@ -1,3 +1,3 @@
1
1
  module GitHubChangelogGenerator
2
- VERSION = "1.10.4"
2
+ VERSION = "1.11.1"
3
3
  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
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_changelog_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.4
4
+ version: 1.11.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: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '10.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '10.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.7'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
@@ -70,16 +70,44 @@ dependencies:
70
70
  name: overcommit
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0.31'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0.31'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0.31'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0.31'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '3.2'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '3.2'
83
111
  description: Changelog generation has never been so easy. Fully automate changelog
84
112
  generation - this gem generate change log file based on tags, issues and merged
85
113
  pull requests from Github issue tracker.
@@ -134,6 +162,7 @@ files:
134
162
  - spec/files/github_changelog_params_override
135
163
  - spec/spec_helper.rb
136
164
  - spec/unit/fetcher_spec.rb
165
+ - spec/unit/generator/generator_processor_spec.rb
137
166
  - spec/unit/generator/generator_tags_spec.rb
138
167
  - spec/unit/parse_file_spec.rb
139
168
  - spec/unit/parser_spec.rb
@@ -173,6 +202,7 @@ test_files:
173
202
  - spec/files/github_changelog_params_override
174
203
  - spec/spec_helper.rb
175
204
  - spec/unit/fetcher_spec.rb
205
+ - spec/unit/generator/generator_processor_spec.rb
176
206
  - spec/unit/generator/generator_tags_spec.rb
177
207
  - spec/unit/parse_file_spec.rb
178
208
  - spec/unit/parser_spec.rb