sensu-json 1.1.1 → 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: 32082d22f3acac35842f8fa03d85353e9d064016
4
- data.tar.gz: 181cb9d6c18da078242efa3c8a816fb9948f8d41
3
+ metadata.gz: 8f8cc5fdd636863ee5536adec1cd6f292211aa48
4
+ data.tar.gz: 34dd2cf27f47b9e7232e8d2121d2f6c75452772b
5
5
  SHA512:
6
- metadata.gz: 0dc6d7992b41eee2bf1863a450df737f98d3328dcd13fa17dd81cfe6e22081c017906dfb6985c9a24d47b60164782963d4d2743c29594d960d9598ecf9a9b031
7
- data.tar.gz: f4c67791588fc38c9335c357da1f1172011722ab558829651538e01f22611be4de0f282c83a1a3d0af54a386a44c90839fc6d6dc233aaeae6249afbeddb4a9df
6
+ metadata.gz: 277b6358f86280d3a45efdfa4586281c4c617638a166952c22b080c944bc2def86604a293709fb6c7d3766c368b8c4b2379d1e1244139e91b8713a18bde655b4
7
+ data.tar.gz: cafd9b6a1106ac04ce8c73a48a30e8a2133d42d01dad7bf13b1b5984726c2d30ef4a8b916ff74c4cb170c12ecaafb28e6c6dbad3b55360c78b7dd4f7621ec189
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,14 +1,14 @@
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: ruby
6
6
  authors:
7
7
  - Sean Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-31 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
14
  name: oj
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: codeclimate-test-reporter
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
69
  description: The Sensu JSON parser abstraction library
84
70
  email:
85
71
  - portertech@gmail.com
@@ -96,7 +82,7 @@ files:
96
82
  - bin/console
97
83
  - bin/setup
98
84
  - lib/sensu/json.rb
99
- - lib/sensu/json/java.rb
85
+ - lib/sensu/json/jrjackson.rb
100
86
  - lib/sensu/json/oj.rb
101
87
  - lib/sensu/json/parse_error.rb
102
88
  - sensu-json.gemspec
@@ -127,3 +113,4 @@ specification_version: 4
127
113
  summary: The Sensu JSON parser abstraction library
128
114
  test_files:
129
115
  - spec/json_spec.rb
116
+ has_rdoc: