sensu-json 1.1.1-java → 2.0.0-java

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: f395a63cf9f6211514fbe273090134d96cc50b05
4
- data.tar.gz: 91077f2ee1a2c3c5443282452c61af6d2a4960a9
3
+ metadata.gz: e306899d54d06d0dfde699f96199758d069266c8
4
+ data.tar.gz: c8a25da16ec5bc19dbd1e6e4c54ea5ad916a8718
5
5
  SHA512:
6
- metadata.gz: 4f3068d6ef34961b84d8b3fd62f1422ffb2091680a677ecbf7990035ea11ac069b5160a2657e1700c38760c98d86773ef3f1984f48889be0378ee82a5b3a0510
7
- data.tar.gz: 55f178468352a426fe45c458d1517eb02865841aed5e6596d6673a197b9226db9789986005d96cb0b0e26565ac022ed3b279d8b28397522f2dc103655121a0c1
6
+ metadata.gz: 6adfe3add1175a020a68709d82aac60082edd34ac310d268d7d47c04b380f0f18d4435445cd3b97f65b9d27b5dd6af1537eae6362b965192a321cb26df643d21
7
+ data.tar.gz: 54a9cc6ec89d7080a490a6d806dccb377c62333d1396cd9aa1143750dedee7de247ce2a840b3336140c2cb853dad815a69b64a9a5bbf3b3505042ff5ac1d2319
data/.travis.yml CHANGED
@@ -6,7 +6,7 @@ rvm:
6
6
  - 2.2.0
7
7
  - 2.2.3
8
8
  - 2.3.0
9
- - jruby-1.7.23
9
+ - jruby-9.0.5.0
10
10
  notifications:
11
11
  irc:
12
12
  - "irc.freenode.net#sensu"
data/README.md CHANGED
@@ -2,9 +2,6 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/sensu/sensu-json.svg?branch=master)](https://travis-ci.org/sensu/sensu-json)
4
4
 
5
- [![Code Climate](https://codeclimate.com/github/sensu/sensu-json.png)](https://codeclimate.com/github/sensu/sensu-json)
6
- [![Code Climate Coverage](https://codeclimate.com/github/sensu/sensu-json/coverage.png)](https://codeclimate.com/github/sensu/sensu-json)
7
-
8
5
  ## Installation
9
6
 
10
7
  Add this line to your application's Gemfile:
data/lib/sensu/json.rb CHANGED
@@ -15,8 +15,8 @@ module Sensu
15
15
  def setup!
16
16
  @@parser = case
17
17
  when RUBY_PLATFORM =~ /java/
18
- require "sensu/json/java"
19
- Sensu::JSON::Java.new
18
+ require "sensu/json/jrjackson"
19
+ Sensu::JSON::JrJackson.new
20
20
  else
21
21
  require "sensu/json/oj"
22
22
  Sensu::JSON::Oj.new
@@ -1,15 +1,15 @@
1
- require "json"
1
+ require "jrjackson"
2
2
 
3
3
  module Sensu
4
4
  module JSON
5
5
  # The Sensu JSON parser when running on JRuby.
6
- class Java
6
+ class JrJackson
7
7
  # Load (and parse) a JSON string. Sensu expects symbolized keys.
8
8
  #
9
9
  # @param string [String]
10
10
  # @return [Object]
11
11
  def load(string)
12
- ::JSON.parse(string, :symbolize_names => true)
12
+ ::JrJackson::Json.load(string, :symbolize_keys => true, :raw => true)
13
13
  end
14
14
 
15
15
  # Dump (generate) a JSON string from a Ruby object.
@@ -17,11 +17,7 @@ module Sensu
17
17
  # @param object [Object]
18
18
  # @param options [Hash]
19
19
  def dump(object, options={})
20
- if options[:pretty]
21
- ::JSON.pretty_generate(object)
22
- else
23
- ::JSON.fast_generate(object)
24
- end
20
+ ::JrJackson::Json.dump(object, options)
25
21
  end
26
22
  end
27
23
  end
data/sensu-json.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-json"
5
- spec.version = "1.1.1"
5
+ spec.version = "2.0.0"
6
6
  spec.platform = RUBY_PLATFORM =~ /java/ ? Gem::Platform::JAVA : Gem::Platform::RUBY
7
7
  spec.authors = ["Sean Porter"]
8
8
  spec.email = ["portertech@gmail.com"]
@@ -16,10 +16,13 @@ Gem::Specification.new do |spec|
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
17
  spec.require_paths = ["lib"]
18
18
 
19
- spec.add_dependency("oj", "2.14.6") unless RUBY_PLATFORM =~ /java/
19
+ if RUBY_PLATFORM =~ /java/
20
+ spec.add_dependency("jrjackson", "0.4.0")
21
+ else
22
+ spec.add_dependency("oj", "2.14.6")
23
+ end
20
24
 
21
25
  spec.add_development_dependency "bundler", "~> 1.6"
22
26
  spec.add_development_dependency "rake"
23
27
  spec.add_development_dependency "rspec"
24
- spec.add_development_dependency "codeclimate-test-reporter"
25
28
  end
metadata CHANGED
@@ -1,45 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 2.0.0
5
5
  platform: java
6
6
  authors:
7
7
  - Sean Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-04 00:00:00.000000000 Z
11
+ date: 2016-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: jrjackson
15
15
  version_requirements: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '1.6'
19
+ version: 0.4.0
20
20
  requirement: !ruby/object:Gem::Requirement
21
21
  requirements:
22
- - - "~>"
22
+ - - '='
23
23
  - !ruby/object:Gem::Version
24
- version: '1.6'
24
+ version: 0.4.0
25
25
  prerelease: false
26
- type: :development
26
+ type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: bundler
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '1.6'
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - ">="
36
+ - - "~>"
37
37
  - !ruby/object:Gem::Version
38
- version: '0'
38
+ version: '1.6'
39
39
  prerelease: false
40
40
  type: :development
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: rake
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,7 @@ dependencies:
53
53
  prerelease: false
54
54
  type: :development
55
55
  - !ruby/object:Gem::Dependency
56
- name: codeclimate-test-reporter
56
+ name: rspec
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -82,7 +82,7 @@ files:
82
82
  - bin/console
83
83
  - bin/setup
84
84
  - lib/sensu/json.rb
85
- - lib/sensu/json/java.rb
85
+ - lib/sensu/json/jrjackson.rb
86
86
  - lib/sensu/json/oj.rb
87
87
  - lib/sensu/json/parse_error.rb
88
88
  - sensu-json.gemspec