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 +4 -4
- data/.travis.yml +1 -1
- data/README.md +0 -3
- data/lib/sensu/json.rb +2 -2
- data/lib/sensu/json/{java.rb → jrjackson.rb} +4 -8
- data/sensu-json.gemspec +6 -3
- metadata +4 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f8cc5fdd636863ee5536adec1cd6f292211aa48
|
4
|
+
data.tar.gz: 34dd2cf27f47b9e7232e8d2121d2f6c75452772b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 277b6358f86280d3a45efdfa4586281c4c617638a166952c22b080c944bc2def86604a293709fb6c7d3766c368b8c4b2379d1e1244139e91b8713a18bde655b4
|
7
|
+
data.tar.gz: cafd9b6a1106ac04ce8c73a48a30e8a2133d42d01dad7bf13b1b5984726c2d30ef4a8b916ff74c4cb170c12ecaafb28e6c6dbad3b55360c78b7dd4f7621ec189
|
data/.travis.yml
CHANGED
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
@@ -1,15 +1,15 @@
|
|
1
|
-
require "
|
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
|
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
|
-
::
|
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
|
-
|
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 = "
|
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
|
-
|
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:
|
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-
|
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/
|
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:
|