codeclimate-test-reporter 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  module CodeClimate
2
2
  module TestReporter
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
 
5
5
  def self.start
6
6
  if run?
@@ -7,6 +7,8 @@ module CodeClimate
7
7
 
8
8
  class Client
9
9
 
10
+ DEFAULT_TIMEOUT = 5 # in seconds
11
+
10
12
  def host
11
13
  ENV["CODECLIMATE_API_HOST"] ||
12
14
  "https://codeclimate.com"
@@ -69,8 +71,8 @@ module CodeClimate
69
71
  http.ca_file = File.expand_path('../../../../config/cacert.pem', __FILE__)
70
72
  http.verify_depth = 5
71
73
  end
72
- http.open_timeout = 5 # in seconds
73
- http.read_timeout = 5 # in seconds
74
+ http.open_timeout = DEFAULT_TIMEOUT # in seconds
75
+ http.read_timeout = DEFAULT_TIMEOUT # in seconds
74
76
  end
75
77
  end
76
78
 
@@ -9,12 +9,12 @@ module CodeClimate
9
9
  module TestReporter
10
10
  class Formatter
11
11
  def format(result)
12
- print "Coverage = #{result.covered_percent.round(2)}%."
12
+ print "Coverage = #{result.covered_percent.round(2)}%. "
13
13
 
14
14
  payload = to_payload(result)
15
15
  if tddium? || ENV["TO_FILE"]
16
16
  file_path = File.join(Dir.tmpdir, "codeclimate-test-coverage-#{SecureRandom.uuid}.json")
17
- print "Coverage results saved to #{file_path}..."
17
+ print "Coverage results saved to #{file_path}... "
18
18
  File.open(file_path, "w") { |file| file.write(payload.to_json) }
19
19
  else
20
20
  client = Client.new
@@ -120,7 +120,7 @@ module CodeClimate
120
120
  end
121
121
 
122
122
  def calculate_blob_id(path)
123
- content = File.open(path, "rb").read
123
+ content = File.open(path, "rb") {|f| f.read }
124
124
  header = "blob #{content.length}\0"
125
125
  store = header + content
126
126
  Digest::SHA1.hexdigest(store)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate-test-reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-17 00:00:00.000000000 Z
12
+ date: 2013-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simplecov
@@ -115,3 +115,4 @@ specification_version: 3
115
115
  summary: Uploads Ruby test coverage data to Code Climate.
116
116
  test_files:
117
117
  - spec/spec_helper.rb
118
+ has_rdoc: