codacy-coverage 1.1.8 → 2.0.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 +4 -4
- data/circle.yml +0 -1
- data/codacy-coverage.gemspec +1 -1
- data/lib/codacy/client.rb +6 -1
- data/lib/codacy/git.rb +1 -0
- data/scripts/ci.sh +0 -5
- data/spec/codacy/client_spec.rb +17 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46ef6a7b234212eb1b20c7213c13ec52f767a0d0
|
4
|
+
data.tar.gz: 7931a5468103bb0a4f1d1ee71a1dc954fe6a7a79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a6f9ca62ebaee068d3e3b0adf81acc3fbf0a6e9b5104bae1655572fdb7bb49df2edeb8c754588eabe429f8ad233c22aec94013e215015f1ea5a637f01263a6f
|
7
|
+
data.tar.gz: db2f94ae4fa6ef9bf624d9824d633b3b2d9e3e5082ce56fa2511a4451fc6fcf6ac5f3a25f638718152132a08a474f12e7741fa1cc2b5ba609de5cac3b03579e2
|
data/circle.yml
CHANGED
data/codacy-coverage.gemspec
CHANGED
data/lib/codacy/client.rb
CHANGED
@@ -11,7 +11,7 @@ module Codacy
|
|
11
11
|
project_token = ENV['CODACY_PROJECT_TOKEN']
|
12
12
|
codacy_base_api = ENV['CODACY_BASE_API_URL'] || 'https://api.codacy.com'
|
13
13
|
commit = Codacy::Git.commit_id
|
14
|
-
|
14
|
+
create_url(codacy_base_api, commit)
|
15
15
|
|
16
16
|
result = parsed_result.to_json
|
17
17
|
|
@@ -51,5 +51,10 @@ module Codacy
|
|
51
51
|
def self.logger
|
52
52
|
Codacy::Configuration.logger
|
53
53
|
end
|
54
|
+
|
55
|
+
def self.create_url(codacy_base_api, commit)
|
56
|
+
commit = commit.gsub(/[^[:alnum:]]/, "")
|
57
|
+
codacy_base_api + '/2.0/coverage/' + commit + '/ruby'
|
58
|
+
end
|
54
59
|
end
|
55
60
|
end
|
data/lib/codacy/git.rb
CHANGED
data/scripts/ci.sh
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Codacy::ClientAPI do
|
4
|
+
describe 'create url' do
|
5
|
+
it 'checks if the url is correct.' do
|
6
|
+
codacy_base_api = 'https://api.codacy.com'
|
7
|
+
|
8
|
+
expected_commit_uuid = "9a7d25976a11f2a145f8fee7c4e4ad58b621d560"
|
9
|
+
expected_url = Codacy::ClientAPI.create_url(codacy_base_api, expected_commit_uuid)
|
10
|
+
|
11
|
+
wrong_commit_uuid = "'9a7d25976a11f2a145f8fee7c4e4ad58b621d560'"
|
12
|
+
fixed_url = Codacy::ClientAPI.create_url(codacy_base_api, wrong_commit_uuid)
|
13
|
+
|
14
|
+
expect(fixed_url).to eq expected_url
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codacy-coverage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nuno Teixeira
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-08-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: simplecov
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- lib/codacy/parser.rb
|
91
91
|
- lib/codacy/reporter.rb
|
92
92
|
- scripts/ci.sh
|
93
|
+
- spec/codacy/client_spec.rb
|
93
94
|
- spec/codacy/git_spec.rb
|
94
95
|
- spec/spec_helper.rb
|
95
96
|
homepage: https://www.codacy.com
|
@@ -104,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
105
|
requirements:
|
105
106
|
- - ">="
|
106
107
|
- !ruby/object:Gem::Version
|
107
|
-
version: '
|
108
|
+
version: '2'
|
108
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
110
|
requirements:
|
110
111
|
- - ">="
|
@@ -117,5 +118,6 @@ signing_key:
|
|
117
118
|
specification_version: 4
|
118
119
|
summary: Post code coverage results to Codacy.
|
119
120
|
test_files:
|
121
|
+
- spec/codacy/client_spec.rb
|
120
122
|
- spec/codacy/git_spec.rb
|
121
123
|
- spec/spec_helper.rb
|