coveralls_reborn 0.15.1 → 0.20.0

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
  SHA256:
3
- metadata.gz: 804077316e45f77ca6518273b569132d8c4790ea3eee1af7529ea1fa78327003
4
- data.tar.gz: e249ab99af214fd879dbe9d16c7877f26a28a9deeee3742b13622b4fc23f9245
3
+ metadata.gz: ff3a594ba89c3b9a80afbe0f9b4bda35b73d7df72c1070b837af1962f4e90a91
4
+ data.tar.gz: 3f665c5384accd7d54ae355db7e51e52d673c42968421361b986aca08c53a657
5
5
  SHA512:
6
- metadata.gz: 8d0d34965995928ebc96782a7d29228272a476b570430fab54718e7ffa46b04f5527b35e5fa996de087e0a9b23927aab9bb688404b90c08e78daf46c74b8f2fb
7
- data.tar.gz: a867c11a65e815fb90ae099ee4f338af3a435fe183b8bf124d90e2c3c49b2aaa50052c74ec39e3ac062b028641e552f9e3efc91a2d7e849129e8b7c9860a052a
6
+ metadata.gz: 3145e1f77eb4e45217692cc255613cd47b6ff0ddbb1ad339e97397b8ad022e5d5859851caf6f47f2a849e971a4133b50a8e4debbe2c9c89975b7c9c79cdb8ffa
7
+ data.tar.gz: e844098397d10fc14e48dc9106b2d3a6c9f90626a3d6b43165ef9e60b9b85778002c5d7827c07265d59737f8699ae5444fb841ae71cca2cc302dc090ae120703
@@ -1,9 +1,9 @@
1
1
  require:
2
2
  - rubocop-performance
3
+ - rubocop-rake
3
4
  - rubocop-rspec
4
5
 
5
6
  AllCops:
6
- TargetRubyVersion: 2.4
7
7
  NewCops: enable
8
8
  Exclude:
9
9
  - 'spec/coveralls/fixtures/**/*'
@@ -17,7 +17,7 @@ Layout/LineLength:
17
17
  Enabled: false
18
18
 
19
19
  Metrics/AbcSize:
20
- Max: 39.29
20
+ Max: 44.11
21
21
 
22
22
  Metrics/CyclomaticComplexity:
23
23
  Max: 19
@@ -43,6 +43,9 @@ RSpec/ExampleLength:
43
43
  RSpec/MultipleExpectations:
44
44
  Enabled: false
45
45
 
46
+ RSpec/MultipleMemoizedHelpers:
47
+ Enabled: false
48
+
46
49
  RSpec/NestedGroups:
47
50
  Max: 4
48
51
 
@@ -1,3 +1,5 @@
1
+ os: linux
2
+ dist: bionic
1
3
  language: ruby
2
4
 
3
5
  cache: bundler
@@ -13,12 +15,13 @@ rvm:
13
15
  - 2.4.10
14
16
  - 2.5.8
15
17
  - 2.6.6
16
- - 2.7.1
18
+ - 2.7.2
19
+ - 3.0.0
17
20
  - ruby-head
18
- - jruby-9.2.11.1
21
+ - jruby-9.2.14.0
19
22
 
20
- matrix:
23
+ jobs:
21
24
  allow_failures:
22
25
  - rvm: ruby-head
23
- - rvm: jruby-9.2.11.1
26
+ - rvm: jruby-9.2.14.0
24
27
  fast_finish: true
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.20.0 / 2021-01-09
4
+
5
+ * [FEATURE] Add Ruby 3 compatibility
6
+ * [FEATURE] Add SimpleCov 0.21.0 compatibility
7
+ * [ENHANCEMENT] Update dependencies
8
+
9
+ ## 0.19.0 / 2020-12-02
10
+
11
+ * [FEATURE] Add SimpleCov 0.20.0 compatibility
12
+
13
+ ## 0.18.0 / 2020-09-07
14
+
15
+ * [ENHANCEMENT] Refactor HTTP client [#10](https://github.com/tagliala/coveralls-ruby-reborn/pull/10)
16
+ * [ENHANCEMENT] Update dependencies
17
+
18
+ ## 0.17.0 / 2020-08-26
19
+
20
+ * [FEATURE] Add SimpleCov 0.19.0 compatibility
21
+ * [ENHANCEMENT] Update dependencies
22
+
23
+ ## 0.16.0 / 2020-04-30
24
+
25
+ * [FEATURE] Remove dependency on json gem [#4](https://github.com/tagliala/coveralls-ruby-reborn/pull/4)
26
+ * [ENHANCEMENT] Update dependencies
27
+
3
28
  ## 0.15.1 / 2020-04-17
4
29
 
5
30
  * [ENHANCEMENT] Test against latest Ruby versions
data/Gemfile CHANGED
@@ -11,13 +11,14 @@ end
11
11
 
12
12
  group :development do
13
13
  gem 'rake', '~> 13.0'
14
- gem 'rspec', '~> 3.9'
15
- gem 'rubocop', '~> 0.82.0'
16
- gem 'rubocop-performance', '~> 1.5'
17
- gem 'rubocop-rspec', '~> 1.38'
14
+ gem 'rspec', '~> 3.10'
15
+ gem 'rubocop', '~> 1.8'
16
+ gem 'rubocop-performance', '~> 1.9'
17
+ gem 'rubocop-rake', '~> 0.5.1'
18
+ gem 'rubocop-rspec', '~> 2.1'
18
19
  gem 'truthy', '~> 1.0'
19
- gem 'vcr', '~> 5.1'
20
- gem 'webmock', '~> 3.8'
20
+ gem 'vcr', '~> 6.0'
21
+ gem 'webmock', '~> 3.11'
21
22
  end
22
23
 
23
24
  group :development, :test do
data/LICENSE CHANGED
@@ -2,7 +2,7 @@ MIT License
2
2
 
3
3
  Copyright (c) 2018 Wil Gieseler
4
4
 
5
- Copyright (c) 2020 Geremia Taglialatela
5
+ Copyright (c) 2021 Geremia Taglialatela
6
6
 
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [Coveralls Reborn](http://coveralls.io) for Ruby [![Coverage Status](https://coveralls.io/repos/github/tagliala/coveralls-ruby-reborn/badge.svg?branch=master)](https://coveralls.io/github/tagliala/coveralls-ruby-reborn?branch=master) [![Build Status](https://secure.travis-ci.org/tagliala/coveralls-ruby-reborn.svg?branch=master)](https://travis-ci.org/tagliala/coveralls-ruby-reborn) [![Gem Version](https://badge.fury.io/rb/coveralls_reborn.svg)](http://badge.fury.io/rb/coveralls_reborn)
1
+ # [Coveralls Reborn](https://coveralls.io) for Ruby [![Coverage Status](https://coveralls.io/repos/github/tagliala/coveralls-ruby-reborn/badge.svg?branch=master)](https://coveralls.io/github/tagliala/coveralls-ruby-reborn?branch=master) [![Build Status](https://secure.travis-ci.org/tagliala/coveralls-ruby-reborn.svg?branch=master)](https://travis-ci.org/tagliala/coveralls-ruby-reborn) [![Gem Version](https://badge.fury.io/rb/coveralls_reborn.svg)](https://badge.fury.io/rb/coveralls_reborn)
2
2
 
3
3
  ### [Read the docs →](https://docs.coveralls.io/ruby-on-rails)
4
4
 
@@ -7,5 +7,5 @@ An up-to-date fork of [lemurheavy/coveralls-ruby](https://github.com/lemurheavy/
7
7
  Add to your `Gemfile`:
8
8
 
9
9
  ```rb
10
- gem 'coveralls_reborn', '~> 0.15.0', require: false
10
+ gem 'coveralls_reborn', '~> 0.20.0', require: false
11
11
  ```
data/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env rake
2
1
  # frozen_string_literal: true
3
2
 
4
3
  require 'bundler/gem_tasks'
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
4
+ lib = File.expand_path('../lib', __dir__)
5
5
  $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
6
6
 
7
7
  require 'coveralls'
@@ -18,13 +18,14 @@ Gem::Specification.new do |gem|
18
18
  gem.name = 'coveralls_reborn'
19
19
  gem.require_paths = ['lib']
20
20
  gem.version = Coveralls::VERSION
21
- gem.metadata = {
22
- 'source_code_uri' => 'https://github.com/tagliala/coveralls-ruby-reborn'
23
- }
21
+
22
+ gem.metadata['bug_tracker_uri'] = 'https://github.com/tagliala/coveralls-ruby-reborn/issues'
23
+ gem.metadata['changelog_uri'] = 'https://github.com/tagliala/coveralls-ruby-reborn/blob/master/CHANGELOG.md'
24
+ gem.metadata['source_code_uri'] = 'https://github.com/tagliala/coveralls-ruby-reborn'
25
+
24
26
  gem.required_ruby_version = '>= 2.4'
25
27
 
26
- gem.add_dependency 'json', '~> 2.1'
27
- gem.add_dependency 'simplecov', '~> 0.18.1'
28
+ gem.add_dependency 'simplecov', '>= 0.18.1', '< 0.22.0'
28
29
  gem.add_dependency 'term-ansicolor', '~> 1.6'
29
30
  gem.add_dependency 'thor', '>= 0.20.3', '< 2.0'
30
31
  gem.add_dependency 'tins', '~> 1.16'
@@ -66,7 +66,7 @@ module Coveralls
66
66
 
67
67
  if simplecov_setting
68
68
  Coveralls::Output.puts("[Coveralls] Using SimpleCov's '#{simplecov_setting}' settings.", color: 'green')
69
- if block_given?
69
+ if block
70
70
  ::SimpleCov.start(simplecov_setting) { instance_eval(&block) }
71
71
  else
72
72
  ::SimpleCov.start(simplecov_setting)
@@ -53,9 +53,9 @@ module Coveralls
53
53
  begin
54
54
  require 'webmock'
55
55
 
56
- allow = WebMock::Config.instance.allow || []
57
- WebMock::Config.instance.allow = [*allow].push API_HOST
58
- rescue LoadError # rubocop:disable Lint/SuppressedException
56
+ allow = Array(WebMock::Config.instance.allow)
57
+ WebMock::Config.instance.allow = allow.push API_HOST
58
+ rescue LoadError
59
59
  rescue StandardError => e
60
60
  # TODO: Add error action
61
61
  puts e.message
@@ -67,7 +67,7 @@ module Coveralls
67
67
  VCR.send(VCR.version.major < 2 ? :config : :configure) do |c|
68
68
  c.ignore_hosts API_HOST
69
69
  end
70
- rescue LoadError # rubocop:disable Lint/SuppressedException
70
+ rescue LoadError
71
71
  rescue StandardError => e
72
72
  # TODO: Add error action
73
73
  puts e.message
@@ -80,15 +80,7 @@ module Coveralls
80
80
 
81
81
  def build_client(uri)
82
82
  client = Net::HTTP.new(uri.host, uri.port)
83
- client.use_ssl = true if uri.port == 443
84
- client.verify_mode = OpenSSL::SSL::VERIFY_NONE
85
-
86
- unless client.respond_to?(:ssl_version=)
87
- Net::HTTP.ssl_context_accessor('ssl_version')
88
- end
89
-
90
- client.ssl_version = 'TLSv1'
91
-
83
+ client.use_ssl = uri.port == 443
92
84
  client
93
85
  end
94
86
 
@@ -13,10 +13,10 @@ module Coveralls
13
13
 
14
14
  if File.exist?('.travis.yml')
15
15
  cmds = begin
16
- YAML.load_file('.travis.yml')['script'] || cmds
17
- rescue StandardError
18
- cmds
19
- end
16
+ YAML.load_file('.travis.yml')['script'] || cmds
17
+ rescue StandardError
18
+ cmds
19
+ end
20
20
  end
21
21
 
22
22
  cmds.each { |cmd| system cmd }
@@ -180,7 +180,7 @@ module Coveralls
180
180
  remotes = nil
181
181
  begin
182
182
  remotes = `git remote -v`.split(/\n/).map do |remote|
183
- splits = remote.split(' ').compact
183
+ splits = remote.split.compact
184
184
  { name: splits[0], url: splits[1] }
185
185
  end.uniq
186
186
  rescue StandardError => e
@@ -199,14 +199,14 @@ module Coveralls
199
199
  end
200
200
 
201
201
  def relevant_env
202
- hash = {
202
+ base_env = {
203
203
  pwd: pwd,
204
204
  rails_root: rails_root,
205
205
  simplecov_root: simplecov_root,
206
206
  gem_version: VERSION
207
207
  }
208
208
 
209
- hash.merge! begin
209
+ service_env =
210
210
  if ENV['TRAVIS']
211
211
  travis_env_hash
212
212
  elsif ENV['CIRCLECI']
@@ -218,9 +218,8 @@ module Coveralls
218
218
  else
219
219
  {}
220
220
  end
221
- end
222
221
 
223
- hash
222
+ base_env.merge! service_env
224
223
  end
225
224
 
226
225
  private
@@ -7,7 +7,7 @@ module Coveralls
7
7
  class RakeTask < ::Rake::TaskLib
8
8
  include ::Rake::DSL if defined?(::Rake::DSL)
9
9
 
10
- def initialize(*_args)
10
+ def initialize(*_args) # rubocop:disable Lint/MissingSuper
11
11
  namespace :coveralls do
12
12
  desc 'Push latest coverage results to Coveralls.io'
13
13
  task :push do
@@ -7,10 +7,10 @@ module Coveralls
7
7
  class Formatter
8
8
  def display_result(result)
9
9
  # Log which files would be submitted.
10
- if !result.files.empty?
11
- Coveralls::Output.puts '[Coveralls] Some handy coverage stats:'
12
- else
10
+ if result.files.empty?
13
11
  Coveralls::Output.puts '[Coveralls] There are no covered files.', color: 'yellow'
12
+ else
13
+ Coveralls::Output.puts '[Coveralls] Some handy coverage stats:'
14
14
  end
15
15
 
16
16
  result.files.each do |f|
@@ -95,10 +95,10 @@ module Coveralls
95
95
 
96
96
  def output_message(result)
97
97
  "Coverage is at #{begin
98
- result.covered_percent.round(2)
99
- rescue StandardError
100
- result.covered_percent.round
101
- end}%.\nCoverage report sent to Coveralls."
98
+ result.covered_percent.round(2)
99
+ rescue StandardError
100
+ result.covered_percent.round
101
+ end}%.\nCoverage report sent to Coveralls."
102
102
  end
103
103
 
104
104
  def short_filename(filename)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coveralls
4
- VERSION = '0.15.1'
4
+ VERSION = '0.20.0'
5
5
  end
@@ -80,6 +80,14 @@ describe Coveralls do
80
80
  end
81
81
 
82
82
  describe '#push!' do
83
+ let(:coverage_hash) do
84
+ { 'file.rb'=>{ 'lines'=>[nil] } }
85
+ end
86
+
87
+ before do
88
+ allow(SimpleCov::ResultMerger).to receive(:merge_valid_results).and_return([['RSpec'], coverage_hash])
89
+ end
90
+
83
91
  it 'sends existing test results' do
84
92
  result = false
85
93
  silence do
@@ -91,12 +99,12 @@ describe Coveralls do
91
99
 
92
100
  describe '#setup!' do
93
101
  it 'sets SimpleCov adapter' do
94
- # rubocop:disable RSpec/LeakyConstantDeclaration
102
+ # rubocop:disable Lint/ConstantDefinitionInBlock, RSpec/LeakyConstantDeclaration
95
103
  SimpleCovTmp = SimpleCov
96
104
  Object.send :remove_const, :SimpleCov
97
105
  silence { described_class.setup! }
98
106
  SimpleCov = SimpleCovTmp
99
- # rubocop:enable RSpec/LeakyConstantDeclaration
107
+ # rubocop:enable Lint/ConstantDefinitionInBlock, RSpec/LeakyConstantDeclaration
100
108
  end
101
109
  end
102
110
  end
@@ -12,13 +12,17 @@ describe Coveralls::SimpleCov::Formatter do
12
12
  end
13
13
 
14
14
  let(:result) do
15
- SimpleCov::Result.new(source_fixture('app/controllers/sample.rb') => [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil],
16
- source_fixture('app/models/airplane.rb') => [0, 0, 0, 0, 0],
17
- source_fixture('app/models/dog.rb') => [1, 1, 1, 1, 1],
18
- source_fixture('app/models/house.rb') => [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil],
19
- source_fixture('app/models/robot.rb') => [1, 1, 1, 1, nil, nil, 1, 0, nil, nil],
20
- source_fixture('app/models/user.rb') => [nil, 1, 1, 1, 1, 0, 1, 0, nil, nil],
21
- source_fixture('sample.rb') => [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil])
15
+ options = {
16
+ source_fixture('app/controllers/sample.rb') => { lines: [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil] },
17
+ source_fixture('app/models/airplane.rb') => { lines: [0, 0, 0, 0, 0] },
18
+ source_fixture('app/models/dog.rb') => { lines: [1, 1, 1, 1, 1] },
19
+ source_fixture('app/models/house.rb') => { lines: [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil] },
20
+ source_fixture('app/models/robot.rb') => { lines: [1, 1, 1, 1, nil, nil, 1, 0, nil, nil] },
21
+ source_fixture('app/models/user.rb') => { lines: [nil, 1, 1, 1, 1, 0, 1, 0, nil, nil] },
22
+ source_fixture('sample.rb') => { lines: [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil] }
23
+ }
24
+
25
+ SimpleCov::Result.new(options)
22
26
  end
23
27
 
24
28
  describe '#format' do
@@ -21,7 +21,7 @@ def setup_formatter
21
21
 
22
22
  SimpleCov.start do
23
23
  add_filter do |source_file|
24
- source_file.filename =~ /spec/ && source_file.filename !~ /fixture/
24
+ source_file.filename.include?('spec') && !source_file.filename.include?('fixture')
25
25
  end
26
26
  add_filter %r{/.bundle/}
27
27
  end
@@ -49,23 +49,14 @@ end
49
49
 
50
50
  def stub_api_post
51
51
  body = '{"message":"","url":""}'
52
- stub_request(:post, Coveralls::API::API_BASE + '/jobs').with(
53
- headers: {
54
- 'Accept' => '*/*; q=0.5, application/xml',
55
- 'Accept-Encoding' => 'gzip, deflate',
56
- 'Content-Length' => /.+/,
57
- 'Content-Type' => /.+/,
58
- 'User-Agent' => 'Ruby'
59
- }
60
- ).to_return(status: 200, body: body, headers: {})
52
+ stub_request(:post, "#{Coveralls::API::API_BASE}/jobs")
53
+ .to_return(status: 200, body: body, headers: {})
61
54
  end
62
55
 
63
- def silence
56
+ def silence(&block)
64
57
  return yield if ENV['silence'] == 'false'
65
58
 
66
- silence_stream(STDOUT) do
67
- yield
68
- end
59
+ silence_stream($stdout, &block)
69
60
  end
70
61
 
71
62
  def silence_stream(stream)
metadata CHANGED
@@ -1,45 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveralls_reborn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Merwin
8
8
  - Wil Gieseler
9
9
  - Geremia Taglialatela
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-04-17 00:00:00.000000000 Z
13
+ date: 2021-01-09 00:00:00.000000000 Z
14
14
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: json
17
- requirement: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - "~>"
20
- - !ruby/object:Gem::Version
21
- version: '2.1'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - "~>"
27
- - !ruby/object:Gem::Version
28
- version: '2.1'
29
15
  - !ruby/object:Gem::Dependency
30
16
  name: simplecov
31
17
  requirement: !ruby/object:Gem::Requirement
32
18
  requirements:
33
- - - "~>"
19
+ - - ">="
34
20
  - !ruby/object:Gem::Version
35
21
  version: 0.18.1
22
+ - - "<"
23
+ - !ruby/object:Gem::Version
24
+ version: 0.22.0
36
25
  type: :runtime
37
26
  prerelease: false
38
27
  version_requirements: !ruby/object:Gem::Requirement
39
28
  requirements:
40
- - - "~>"
29
+ - - ">="
41
30
  - !ruby/object:Gem::Version
42
31
  version: 0.18.1
32
+ - - "<"
33
+ - !ruby/object:Gem::Version
34
+ version: 0.22.0
43
35
  - !ruby/object:Gem::Dependency
44
36
  name: term-ansicolor
45
37
  requirement: !ruby/object:Gem::Requirement
@@ -154,8 +146,10 @@ homepage: https://coveralls.io
154
146
  licenses:
155
147
  - MIT
156
148
  metadata:
149
+ bug_tracker_uri: https://github.com/tagliala/coveralls-ruby-reborn/issues
150
+ changelog_uri: https://github.com/tagliala/coveralls-ruby-reborn/blob/master/CHANGELOG.md
157
151
  source_code_uri: https://github.com/tagliala/coveralls-ruby-reborn
158
- post_install_message:
152
+ post_install_message:
159
153
  rdoc_options: []
160
154
  require_paths:
161
155
  - lib
@@ -170,8 +164,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
164
  - !ruby/object:Gem::Version
171
165
  version: '0'
172
166
  requirements: []
173
- rubygems_version: 3.1.2
174
- signing_key:
167
+ rubygems_version: 3.1.4
168
+ signing_key:
175
169
  specification_version: 4
176
170
  summary: A Ruby implementation of the Coveralls API.
177
171
  test_files: