Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit 9a7d259

Browse files
committed
Create method to return url
1 parent 20d07b8 commit 9a7d259

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/codacy/client.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def self.post_results(parsed_result)
1111
project_token = ENV['CODACY_PROJECT_TOKEN']
1212
codacy_base_api = ENV['CODACY_BASE_API_URL'] || 'https://api.codacy.com'
1313
commit = Codacy::Git.commit_id
14-
url = codacy_base_api + '/2.0/coverage/' + commit + '/ruby'
14+
create_url(codacy_base_api, commit)
1515

1616
result = parsed_result.to_json
1717

@@ -51,5 +51,9 @@ def self.send_request(url, content, project_token, redirects = 3)
5151
def self.logger
5252
Codacy::Configuration.logger
5353
end
54+
55+
def self.create_url(codacy_base_api, commit)
56+
codacy_base_api + '/2.0/coverage/' + commit + '/ruby'
57+
end
5458
end
5559
end

0 commit comments

Comments
 (0)