coveralls 0.5.8 → 0.5.9

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.
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.add_dependency 'rest-client'
19
19
  gem.add_dependency 'colorize'
20
- gem.add_dependency 'json'
20
+ gem.add_dependency 'multi_json', '~> 1.3'
21
21
  gem.add_dependency 'thor'
22
22
 
23
23
  if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new("1.9")
@@ -1,7 +1,7 @@
1
1
  module Coveralls
2
2
  class API
3
3
 
4
- require 'json'
4
+ require 'multi_json'
5
5
  require 'rest_client'
6
6
 
7
7
  API_HOST = ENV['COVERALLS_DEVELOPMENT'] ? "localhost:3000" : "coveralls.io"
@@ -12,11 +12,11 @@ module Coveralls
12
12
  def self.post_json(endpoint, hash)
13
13
  disable_net_blockers!
14
14
  url = endpoint_to_url(endpoint)
15
- puts JSON.pretty_generate(hash).green if ENV['COVERALLS_DEBUG']
15
+ puts MultiJson.dump(hash, :pretty => true).green if ENV['COVERALLS_DEBUG']
16
16
  hash = apified_hash hash
17
17
  puts "[Coveralls] Submitting to #{API_BASE}".cyan
18
18
  response = RestClient.post(url, :json_file => hash_to_file(hash))
19
- response_hash = JSON.parse response.to_str
19
+ response_hash = MultiJson.load(response.to_str)
20
20
  puts ("[Coveralls] " + response_hash['message']).cyan
21
21
  if response_hash['message']
22
22
  puts ("[Coveralls] " + response_hash['url'].underline).cyan
@@ -31,7 +31,9 @@ module Coveralls
31
31
 
32
32
  def self.disable_net_blockers!
33
33
  if defined?(WebMock)
34
- (WebMock::Config.instance.allow ||= []).push API_HOST
34
+ allow = WebMock::Config.instance.allow || []
35
+ [*allow].push API_HOST
36
+ WebMock::Config.instance.allow = allow
35
37
  end
36
38
 
37
39
  if defined?(VCR)
@@ -60,7 +62,7 @@ module Coveralls
60
62
  config = Coveralls::Configuration.configuration
61
63
  if ENV['TRAVIS'] || ENV['COVERALLS_DEBUG']
62
64
  puts "[Coveralls] Submiting with config:".yellow
63
- puts JSON.pretty_generate(config).
65
+ puts MultiJson.dump(config, :pretty => true).
64
66
  gsub(/"repo_token": "(.*?)"/,'"repo_token": "[secure]"').yellow
65
67
  end
66
68
  hash.merge(config)
@@ -1,3 +1,3 @@
1
1
  module Coveralls
2
- VERSION = "0.5.8"
2
+ VERSION = "0.5.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveralls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-28 00:00:00.000000000 Z
13
+ date: 2013-03-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client
@@ -45,21 +45,21 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
- name: json
48
+ name: multi_json
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
- - - ! '>='
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.3'
55
55
  type: :runtime
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  none: false
59
59
  requirements:
60
- - - ! '>='
60
+ - - ~>
61
61
  - !ruby/object:Gem::Version
62
- version: '0'
62
+ version: '1.3'
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: thor
65
65
  requirement: !ruby/object:Gem::Requirement