Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Fix 0.2.4 #85

Merged
merged 1 commit into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: test install build deploy

deploy:
$(eval VERSION := $(shell cat lib/version.rb | grep 'LATEST = ' | cut -d\' -f2))
$(eval VERSION := $(shell cat lib/codecov.rb | grep 'VERSION = ' | cut -d\' -f2))
git tag v$(VERSION) -m ""
git push origin v$(VERSION)
gem build codecov.gemspec
Expand Down
6 changes: 1 addition & 5 deletions codecov.gemspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'version'

Gem::Specification.new do |s|
s.name = 'codecov'
s.version = Version::LATEST
s.version = '0.2.4'
s.platform = Gem::Platform::RUBY
s.authors = ['codecov']
s.email = ['hello@codecov.io']
Expand Down
10 changes: 5 additions & 5 deletions lib/codecov.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
require 'colorize'
require 'zlib'

require 'version'

class SimpleCov::Formatter::Codecov
VERSION = '0.2.4'

### CIs
RECOGNIZED_CIS = [
APPVEYOR = 'Appveyor CI',
Expand Down Expand Up @@ -41,7 +41,7 @@ def display_header
'| | / _ \ / _\`|/ _ \/ __/ _ \ \ / /',
'| |___| (_) | (_| | __/ (_| (_) \ V /',
' \_____\___/ \__,_|\___|\___\___/ \_/',
" Ruby-#{Version::LATEST}",
" Ruby-#{VERSION}",
''
].join("\n")
end
Expand Down Expand Up @@ -98,7 +98,7 @@ def build_params(ci)
params = {
'token' => ENV['CODECOV_TOKEN'],
'flags' => ENV['CODECOV_FLAG'] || ENV['CODECOV_FLAGS'],
'package' => "ruby-#{Version::LATEST}"
'package' => "ruby-#{VERSION}"
}

case ci
Expand Down Expand Up @@ -317,7 +317,7 @@ def retry_request(req, https)
def create_report(report)
result = {
'meta' => {
'version' => 'codecov-ruby/v' + Version::LATEST
'version' => 'codecov-ruby/v' + VERSION
}
}
result.update(result_to_codecov(report))
Expand Down
5 changes: 0 additions & 5 deletions lib/version.rb

This file was deleted.

4 changes: 2 additions & 2 deletions test/test_codecov.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def url

def test_defined
assert defined?(SimpleCov::Formatter::Codecov)
assert defined?(Version::LATEST)
assert defined?(SimpleCov::Formatter::Codecov::VERSION)
end

def stub_file(filename, coverage)
Expand Down Expand Up @@ -83,7 +83,7 @@ def success_stubs
def assert_successful_upload(data)
assert_equal(data['result']['uploaded'], true)
assert_equal(data['result']['message'], 'Coverage reports upload successfully')
assert_equal(data['meta']['version'], 'codecov-ruby/v' + Version::LATEST)
assert_equal(data['meta']['version'], 'codecov-ruby/v' + SimpleCov::Formatter::Codecov::VERSION)
assert_equal(data['coverage'].to_json, {
'lib/something.rb' => [nil, 1, 0, 0, nil, 1, nil],
'lib/somefile.rb' => [nil, 1, nil, 1, 1, 1, 0, 0, nil, 1, nil]
Expand Down