codacy-coverage 1.1.8 → 2.0.0

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: 3b5a3b108a133bb7c8ae7aaeb717aabc428543d6
4
- data.tar.gz: e65002784085c2720d76e5030e43b8b125e892d8
3
+ metadata.gz: 46ef6a7b234212eb1b20c7213c13ec52f767a0d0
4
+ data.tar.gz: 7931a5468103bb0a4f1d1ee71a1dc954fe6a7a79
5
5
  SHA512:
6
- metadata.gz: 37c2be762ecb0529886ff8cc40745d2f0c57c05a588c018f078cf4d76f95f8a1d8a1b76a5753df3b63f8b960cf45b1336869afaa1c659523ed2e2d84453f95f6
7
- data.tar.gz: 95357df258f564c29589932bd2af7dbc4750255ab942b195d9c89f17010a5d87494294aa2f519fd723e23f62da0afb0486857d2f40ac242802c96cbf73e369bb
6
+ metadata.gz: 0a6f9ca62ebaee068d3e3b0adf81acc3fbf0a6e9b5104bae1655572fdb7bb49df2edeb8c754588eabe429f8ad233c22aec94013e215015f1ea5a637f01263a6f
7
+ data.tar.gz: db2f94ae4fa6ef9bf624d9824d633b3b2d9e3e5082ce56fa2511a4451fc6fcf6ac5f3a25f638718152132a08a474f12e7741fa1cc2b5ba609de5cac3b03579e2
data/circle.yml CHANGED
@@ -3,7 +3,6 @@ dependencies:
3
3
  - git config --global user.email "ci@codacy.com"
4
4
  - git config --global user.name "Codacy CI"
5
5
  override:
6
- - rvm install 1.9.3-p551
7
6
  - rvm install 2.0.0-p648
8
7
  - rvm install 2.1.10
9
8
  - rvm install 2.2.5
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.require_paths = ["lib"]
17
17
  gem.version = ENV['PUBLISH_VERSION'] || '1.0.dev'.freeze
18
18
 
19
- gem.required_ruby_version = '>= 1.9'
19
+ gem.required_ruby_version = '>= 2'
20
20
 
21
21
  gem.add_runtime_dependency 'simplecov'
22
22
 
@@ -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
- url = codacy_base_api + '/2.0/coverage/' + commit + '/ruby'
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
@@ -8,6 +8,7 @@ module Codacy
8
8
  ENV['CIRCLE_SHA1'] ||
9
9
  ENV['CI_COMMIT_ID'] ||
10
10
  ENV['WERCKER_GIT_COMMIT'] ||
11
+ ENV['HEROKU_TEST_RUN_COMMIT_VERSION'] ||
11
12
  git_commit
12
13
 
13
14
  commit
@@ -2,11 +2,6 @@
2
2
 
3
3
  set -e
4
4
 
5
- rvm use 1.9.3-p551
6
- ruby -v
7
- bundle install --gemfile Gemfile.ruby-19
8
- bundle exec rspec
9
-
10
5
  rvm use 2.0.0-p648
11
6
  ruby -v
12
7
  bundle install
@@ -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: 1.1.8
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: 2017-10-04 00:00:00.000000000 Z
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: '1.9'
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