legion-json 0.1.6 → 1.1.0
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.
- checksums.yaml +4 -4
- data/.circleci/config.yml +62 -5
- data/.gitignore +2 -1
- data/.idea/.rakeTasks +7 -0
- data/.idea/legion-json.iml +39 -0
- data/.idea/misc.xml +7 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vagrant.xml +7 -0
- data/.idea/workspace.xml +14 -0
- data/.rubocop.yml +1 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +78 -0
- data/bitbucket-pipelines.yml +2 -12
- data/legion-json.gemspec +3 -8
- data/lib/legion/json.rb +7 -32
- data/lib/legion/json/version.rb +1 -1
- data/sonar-project.properties +11 -0
- metadata +26 -20
- data/lib/legion/json/jrjackson.rb +0 -14
- data/lib/legion/json/oj.rb +0 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a3e02cb1ce6b1b9cc8d0241c160c133664c40c937c1687522dbb949b52113ad3
|
|
4
|
+
data.tar.gz: 177f5d1a07cb5964a644cfe585216e4dcbde09a87053fdc6cb2ffd34ba82ece7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b3e376a3588312207e95cd55ca16a8acb6cfb5d1bccb50473184629f819244ad01b15bbcf4120ab7fd5a05f5776550b1691a3a31f6e527d5f2cf30f46ce3539c
|
|
7
|
+
data.tar.gz: cb06d91bd255283e4afa8a1ae02e68d0a67ceb6fe4bf8199c0f78c88c1586ef326674a914a6486b0408220cacd049c56ae1628c1087dad312ae410682bd84b1c
|
data/.circleci/config.yml
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
version: 2.1
|
|
2
2
|
orbs:
|
|
3
3
|
ruby: circleci/ruby@0.2.1
|
|
4
|
+
sonarcloud: sonarsource/sonarcloud@1.0.1
|
|
4
5
|
|
|
5
6
|
jobs:
|
|
6
7
|
"rubocop":
|
|
7
8
|
docker:
|
|
8
|
-
- image: circleci/ruby:2.
|
|
9
|
+
- image: circleci/ruby:2.7-node
|
|
9
10
|
steps:
|
|
10
11
|
- checkout
|
|
11
12
|
- ruby/load-cache
|
|
@@ -17,33 +18,78 @@ jobs:
|
|
|
17
18
|
"ruby-two-five":
|
|
18
19
|
docker:
|
|
19
20
|
- image: circleci/ruby:2.5
|
|
20
|
-
- image: memcached:1.5-alpine
|
|
21
21
|
steps:
|
|
22
22
|
- checkout
|
|
23
23
|
- ruby/load-cache
|
|
24
|
+
- run:
|
|
25
|
+
name: update bundler
|
|
26
|
+
command: gem update bundler
|
|
24
27
|
- ruby/install-deps
|
|
25
28
|
- ruby/run-tests
|
|
26
29
|
- ruby/save-cache
|
|
27
30
|
"ruby-two-six":
|
|
28
31
|
docker:
|
|
29
32
|
- image: circleci/ruby:2.6
|
|
30
|
-
- image: memcached:1.5-alpine
|
|
31
33
|
steps:
|
|
32
34
|
- checkout
|
|
33
35
|
- ruby/load-cache
|
|
36
|
+
- run:
|
|
37
|
+
name: update bundler
|
|
38
|
+
command: gem update bundler
|
|
34
39
|
- ruby/install-deps
|
|
35
40
|
- ruby/run-tests
|
|
36
41
|
- ruby/save-cache
|
|
37
42
|
"ruby-two-seven":
|
|
38
43
|
docker:
|
|
39
44
|
- image: circleci/ruby:2.7
|
|
40
|
-
- image: memcached:1.5-alpine
|
|
41
45
|
steps:
|
|
42
46
|
- checkout
|
|
43
47
|
- ruby/load-cache
|
|
44
48
|
- ruby/install-deps
|
|
45
49
|
- ruby/run-tests
|
|
46
50
|
- ruby/save-cache
|
|
51
|
+
"jruby-nine-two":
|
|
52
|
+
docker:
|
|
53
|
+
- image: circleci/jruby:9.2-jre
|
|
54
|
+
steps:
|
|
55
|
+
- checkout
|
|
56
|
+
- run:
|
|
57
|
+
name: Bundle Install
|
|
58
|
+
command: bundle install
|
|
59
|
+
- run:
|
|
60
|
+
name: Run RSpec
|
|
61
|
+
command: bundle exec rspec --format progress --format RspecJunitFormatter -o test-results/rspec/results.xml
|
|
62
|
+
when: always
|
|
63
|
+
- store_test_results:
|
|
64
|
+
path: test-results
|
|
65
|
+
- sonarcloud/scan
|
|
66
|
+
"jruby-nine-two-e":
|
|
67
|
+
docker:
|
|
68
|
+
- image: circleci/jruby:9.2.11-jre
|
|
69
|
+
steps:
|
|
70
|
+
- checkout
|
|
71
|
+
- run:
|
|
72
|
+
name: Bundle Install
|
|
73
|
+
command: bundle install
|
|
74
|
+
- run:
|
|
75
|
+
name: Run RSpec
|
|
76
|
+
command: bundle exec rspec --format progress --format RspecJunitFormatter -o test-results/rspec/results.xml
|
|
77
|
+
when: always
|
|
78
|
+
- store_test_results:
|
|
79
|
+
path: test-results
|
|
80
|
+
"sonarcloud":
|
|
81
|
+
docker:
|
|
82
|
+
- image: circleci/ruby:2.7
|
|
83
|
+
steps:
|
|
84
|
+
- checkout
|
|
85
|
+
- ruby/load-cache
|
|
86
|
+
- ruby/install-deps
|
|
87
|
+
- ruby/run-tests
|
|
88
|
+
- run:
|
|
89
|
+
name: Run Rubocop
|
|
90
|
+
command: bundle exec rubocop --format=json --out=rubocop-result.json
|
|
91
|
+
- sonarcloud/scan
|
|
92
|
+
- ruby/save-cache
|
|
47
93
|
|
|
48
94
|
workflows:
|
|
49
95
|
version: 2
|
|
@@ -58,4 +104,15 @@ workflows:
|
|
|
58
104
|
- ruby-two-five
|
|
59
105
|
- ruby-two-seven:
|
|
60
106
|
requires:
|
|
61
|
-
- ruby-two-five
|
|
107
|
+
- ruby-two-five
|
|
108
|
+
- sonarcloud:
|
|
109
|
+
requires:
|
|
110
|
+
- ruby-two-seven
|
|
111
|
+
- ruby-two-six
|
|
112
|
+
- jruby-nine-two:
|
|
113
|
+
requires:
|
|
114
|
+
- ruby-two-seven
|
|
115
|
+
- ruby-two-six
|
|
116
|
+
- jruby-nine-two-e:
|
|
117
|
+
requires:
|
|
118
|
+
- jruby-nine-two
|
data/.gitignore
CHANGED
data/.idea/.rakeTasks
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
|
3
|
+
You are allowed to:
|
|
4
|
+
1. Remove rake task
|
|
5
|
+
2. Add existing rake tasks
|
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build legion-json-0.1.6.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install legion-json-0.1.6.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install legion-json-0.1.6.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.1.6 and build and push legion-json-0.1.6.gem to rubygems.org" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
|
4
|
+
<shared />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="NewModuleRootManager">
|
|
7
|
+
<content url="file://$MODULE_DIR$" />
|
|
8
|
+
<orderEntry type="jdk" jdkName="RVM: ruby-2.7.0" jdkType="RUBY_SDK" />
|
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
+
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
11
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.1.4, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
12
|
+
<orderEntry type="library" scope="PROVIDED" name="chef (v16.1.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
13
|
+
<orderEntry type="library" scope="PROVIDED" name="codecov (v0.2.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="colorize (v0.8.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.4.4, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="docile (v1.3.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="json (v2.3.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.15.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.19.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="parser (v2.7.1.4, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="regexp_parser (v1.7.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.4, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.9.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.9.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.9.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
28
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.9.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
29
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.9.3, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
30
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec_junit_formatter (v0.4.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
31
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.88.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
32
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v0.2.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
33
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-performance (v1.7.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
34
|
+
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.10.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
35
|
+
<orderEntry type="library" scope="PROVIDED" name="simplecov (v0.17.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
36
|
+
<orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.10.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
37
|
+
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v1.7.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
|
38
|
+
</component>
|
|
39
|
+
</module>
|
data/.idea/misc.xml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="JavaScriptSettings">
|
|
4
|
+
<option name="languageLevel" value="ES6" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.6.3" project-jdk-type="RUBY_SDK" />
|
|
7
|
+
</project>
|
data/.idea/modules.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/legion-json.iml" filepath="$PROJECT_DIR$/.idea/legion-json.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
data/.idea/vagrant.xml
ADDED
data/.idea/workspace.xml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="CoverageOptionsProvider">
|
|
4
|
+
<option name="myAddOrReplace" value="0" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="Git.Settings">
|
|
7
|
+
<option name="PUSH_AUTO_UPDATE" value="true" />
|
|
8
|
+
<option name="ROOT_SYNC" value="DONT_SYNC" />
|
|
9
|
+
</component>
|
|
10
|
+
<component name="ProjectId" id="1Yl3MvvW2XEUkSgcd6DW2ko2fkK" />
|
|
11
|
+
<component name="PropertiesComponent">
|
|
12
|
+
<property name="settings.editor.selected.configurable" value="reference.settingsdialog.project.vagrant" />
|
|
13
|
+
</component>
|
|
14
|
+
</project>
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
legion-json (1.1.0)
|
|
5
|
+
multi_json
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
ast (2.4.1)
|
|
11
|
+
codecov (0.2.2)
|
|
12
|
+
colorize
|
|
13
|
+
json
|
|
14
|
+
simplecov
|
|
15
|
+
colorize (0.8.1)
|
|
16
|
+
diff-lcs (1.4.4)
|
|
17
|
+
docile (1.3.2)
|
|
18
|
+
json (2.3.1)
|
|
19
|
+
multi_json (1.15.0)
|
|
20
|
+
parallel (1.19.2)
|
|
21
|
+
parser (2.7.1.4)
|
|
22
|
+
ast (~> 2.4.1)
|
|
23
|
+
rainbow (3.0.0)
|
|
24
|
+
rake (13.0.1)
|
|
25
|
+
regexp_parser (1.7.1)
|
|
26
|
+
rexml (3.2.4)
|
|
27
|
+
rspec (3.9.0)
|
|
28
|
+
rspec-core (~> 3.9.0)
|
|
29
|
+
rspec-expectations (~> 3.9.0)
|
|
30
|
+
rspec-mocks (~> 3.9.0)
|
|
31
|
+
rspec-core (3.9.2)
|
|
32
|
+
rspec-support (~> 3.9.3)
|
|
33
|
+
rspec-expectations (3.9.2)
|
|
34
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
35
|
+
rspec-support (~> 3.9.0)
|
|
36
|
+
rspec-mocks (3.9.1)
|
|
37
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
38
|
+
rspec-support (~> 3.9.0)
|
|
39
|
+
rspec-support (3.9.3)
|
|
40
|
+
rspec_junit_formatter (0.4.1)
|
|
41
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
|
42
|
+
rubocop (0.88.0)
|
|
43
|
+
parallel (~> 1.10)
|
|
44
|
+
parser (>= 2.7.1.1)
|
|
45
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
46
|
+
regexp_parser (>= 1.7)
|
|
47
|
+
rexml
|
|
48
|
+
rubocop-ast (>= 0.1.0, < 1.0)
|
|
49
|
+
ruby-progressbar (~> 1.7)
|
|
50
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
|
51
|
+
rubocop-ast (0.2.0)
|
|
52
|
+
parser (>= 2.7.0.1)
|
|
53
|
+
rubocop-performance (1.7.1)
|
|
54
|
+
rubocop (>= 0.82.0)
|
|
55
|
+
ruby-progressbar (1.10.1)
|
|
56
|
+
simplecov (0.17.1)
|
|
57
|
+
docile (~> 1.1)
|
|
58
|
+
json (>= 1.8, < 3)
|
|
59
|
+
simplecov-html (~> 0.10.0)
|
|
60
|
+
simplecov-html (0.10.2)
|
|
61
|
+
unicode-display_width (1.7.0)
|
|
62
|
+
|
|
63
|
+
PLATFORMS
|
|
64
|
+
ruby
|
|
65
|
+
|
|
66
|
+
DEPENDENCIES
|
|
67
|
+
bundler
|
|
68
|
+
codecov (~> 0)
|
|
69
|
+
legion-json!
|
|
70
|
+
rake
|
|
71
|
+
rspec
|
|
72
|
+
rspec_junit_formatter
|
|
73
|
+
rubocop
|
|
74
|
+
rubocop-performance
|
|
75
|
+
simplecov (< 0.18.0)
|
|
76
|
+
|
|
77
|
+
BUNDLED WITH
|
|
78
|
+
2.1.4
|
data/bitbucket-pipelines.yml
CHANGED
|
@@ -2,20 +2,10 @@ image: ruby:2.4.0
|
|
|
2
2
|
|
|
3
3
|
pipelines:
|
|
4
4
|
tags:
|
|
5
|
-
'
|
|
6
|
-
- step:
|
|
7
|
-
name: Deploy to Rubygems JRuby
|
|
8
|
-
image: jruby:9.2
|
|
9
|
-
deployment: staging
|
|
10
|
-
script:
|
|
11
|
-
- bash .circleci/setup-rubygems.sh
|
|
12
|
-
- jruby -S gem install bundler bundle git
|
|
13
|
-
- jruby -S bundle update
|
|
14
|
-
- jruby -S gem build legion-json.gemspec
|
|
15
|
-
- jruby -S gem push "legion-json-java-$(git describe --tags).gem"
|
|
5
|
+
'0.1.1':
|
|
16
6
|
- step:
|
|
17
7
|
name: Deploy to Rubygems MRI
|
|
18
|
-
image: ruby:2.
|
|
8
|
+
image: ruby:2.5.0
|
|
19
9
|
deployment: production
|
|
20
10
|
script:
|
|
21
11
|
- bash .circleci/setup-rubygems.sh
|
data/legion-json.gemspec
CHANGED
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
3
3
|
require 'legion/json/version'
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name =
|
|
6
|
+
spec.name = 'legion-json'
|
|
7
7
|
spec.version = Legion::Json::VERSION
|
|
8
8
|
spec.authors = ['Esity']
|
|
9
9
|
spec.email = ['matthewdiverson@gmail.com']
|
|
@@ -25,7 +25,6 @@ Gem::Specification.new do |spec|
|
|
|
25
25
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
26
26
|
f.match(%r{^(test|spec|features)/})
|
|
27
27
|
end
|
|
28
|
-
spec.bindir = 'exe'
|
|
29
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
30
29
|
spec.require_paths = ['lib']
|
|
31
30
|
|
|
@@ -36,10 +35,6 @@ Gem::Specification.new do |spec|
|
|
|
36
35
|
spec.add_development_dependency 'rspec_junit_formatter'
|
|
37
36
|
spec.add_development_dependency 'rubocop'
|
|
38
37
|
spec.add_development_dependency 'rubocop-performance'
|
|
39
|
-
spec.
|
|
40
|
-
|
|
41
|
-
spec.add_dependency('jrjackson', '~> 0.4')
|
|
42
|
-
else
|
|
43
|
-
spec.add_dependency('oj', '~> 3')
|
|
44
|
-
end
|
|
38
|
+
spec.add_development_dependency 'simplecov', '< 0.18.0'
|
|
39
|
+
spec.add_dependency 'multi_json'
|
|
45
40
|
end
|
data/lib/legion/json.rb
CHANGED
|
@@ -1,48 +1,23 @@
|
|
|
1
1
|
require 'legion/json/version'
|
|
2
2
|
require 'legion/json/parse_error'
|
|
3
|
+
require 'multi_json'
|
|
3
4
|
|
|
4
5
|
module Legion
|
|
5
|
-
# Used to create JSON objects
|
|
6
6
|
module JSON
|
|
7
7
|
class << self
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# the bottom of this file. The appropriate JSON parser will be
|
|
11
|
-
# loaded for the current platform.
|
|
12
|
-
#
|
|
13
|
-
# @return [Object] parser.
|
|
14
|
-
def setup!
|
|
15
|
-
if RUBY_ENGINE == 'jruby'
|
|
16
|
-
require 'jrjackson'
|
|
17
|
-
require 'legion/json/jrjackson'
|
|
18
|
-
@parser = Legion::JSON::JrJackson.new
|
|
19
|
-
else
|
|
20
|
-
require 'oj'
|
|
21
|
-
Oj.default_options = { mode: :compat }
|
|
22
|
-
require 'legion/json/oj'
|
|
23
|
-
@parser = Legion::JSON::Oj.new
|
|
24
|
-
end
|
|
8
|
+
def parser
|
|
9
|
+
@parser ||= MultiJson
|
|
25
10
|
end
|
|
26
11
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# @param string [String]
|
|
30
|
-
# @return [Object]
|
|
31
|
-
def load(string)
|
|
32
|
-
@parser.load(string)
|
|
12
|
+
def load(string, symbolize_keys = true)
|
|
13
|
+
parser.load(string, symbolize_keys: symbolize_keys)
|
|
33
14
|
rescue StandardError => e
|
|
34
15
|
raise Legion::JSON::ParseError.build(e, string)
|
|
35
16
|
end
|
|
36
17
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
# @param object [Object]
|
|
40
|
-
# @param options [Hash]
|
|
41
|
-
def dump(object, options = {})
|
|
42
|
-
@parser.dump(object, options)
|
|
18
|
+
def dump(object, pretty = false)
|
|
19
|
+
parser.dump(object, pretty: pretty)
|
|
43
20
|
end
|
|
44
21
|
end
|
|
45
22
|
end
|
|
46
23
|
end
|
|
47
|
-
|
|
48
|
-
Legion::JSON.setup!
|
data/lib/legion/json/version.rb
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
sonar.projectKey=legion-io_legion-json
|
|
2
|
+
sonar.organization=legion-io
|
|
3
|
+
sonar.sources=.
|
|
4
|
+
sonar.exclusions=vendor/**
|
|
5
|
+
sonar.coverage.exclusions=spec/**
|
|
6
|
+
sonar.ruby.coverage.reportPath=coverage/.resultset.json
|
|
7
|
+
sonar.ruby.file.suffixes=rb,ruby
|
|
8
|
+
sonar.ruby.coverage.framework=RSpec
|
|
9
|
+
sonar.ruby.rubocopConfig=.rubocop.yml
|
|
10
|
+
sonar.ruby.rubocop.reportPath=rubocop-result.json
|
|
11
|
+
sonar.ruby.rubocop.filePath=.
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: legion-json
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esity
|
|
8
|
-
autorequire:
|
|
9
|
-
bindir:
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-07-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -109,33 +109,33 @@ dependencies:
|
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name:
|
|
112
|
+
name: simplecov
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
|
-
- - "
|
|
115
|
+
- - "<"
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
|
-
version:
|
|
118
|
-
type: :
|
|
117
|
+
version: 0.18.0
|
|
118
|
+
type: :development
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
|
-
- - "
|
|
122
|
+
- - "<"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
|
-
version:
|
|
124
|
+
version: 0.18.0
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
|
-
name:
|
|
126
|
+
name: multi_json
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
128
128
|
requirements:
|
|
129
|
-
- - "
|
|
129
|
+
- - ">="
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: '
|
|
131
|
+
version: '0'
|
|
132
132
|
type: :runtime
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
|
-
- - "
|
|
136
|
+
- - ">="
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: '
|
|
138
|
+
version: '0'
|
|
139
139
|
description: A gem used to load and use JSON objects inside the Legion framework
|
|
140
140
|
email:
|
|
141
141
|
- matthewdiverson@gmail.com
|
|
@@ -146,8 +146,15 @@ files:
|
|
|
146
146
|
- ".circleci/config.yml"
|
|
147
147
|
- ".circleci/setup-rubygems.sh"
|
|
148
148
|
- ".gitignore"
|
|
149
|
+
- ".idea/.rakeTasks"
|
|
150
|
+
- ".idea/legion-json.iml"
|
|
151
|
+
- ".idea/misc.xml"
|
|
152
|
+
- ".idea/modules.xml"
|
|
153
|
+
- ".idea/vagrant.xml"
|
|
154
|
+
- ".idea/workspace.xml"
|
|
149
155
|
- ".rubocop.yml"
|
|
150
156
|
- Gemfile
|
|
157
|
+
- Gemfile.lock
|
|
151
158
|
- LICENSE.txt
|
|
152
159
|
- README.md
|
|
153
160
|
- Rakefile
|
|
@@ -157,10 +164,9 @@ files:
|
|
|
157
164
|
- codecov.yml
|
|
158
165
|
- legion-json.gemspec
|
|
159
166
|
- lib/legion/json.rb
|
|
160
|
-
- lib/legion/json/jrjackson.rb
|
|
161
|
-
- lib/legion/json/oj.rb
|
|
162
167
|
- lib/legion/json/parse_error.rb
|
|
163
168
|
- lib/legion/json/version.rb
|
|
169
|
+
- sonar-project.properties
|
|
164
170
|
homepage: https://bitbucket.org/legion-io/legion-json
|
|
165
171
|
licenses:
|
|
166
172
|
- MIT
|
|
@@ -171,7 +177,7 @@ metadata:
|
|
|
171
177
|
homepage_uri: https://legionio.atlassian.net/wiki/spaces/LEGION
|
|
172
178
|
source_code_uri: https://bitbucket.org/legion-io/legion-json
|
|
173
179
|
wiki_uri: https://legionio.atlassian.net/wiki/spaces/LEGION/pages/24674324/JSON
|
|
174
|
-
post_install_message:
|
|
180
|
+
post_install_message:
|
|
175
181
|
rdoc_options: []
|
|
176
182
|
require_paths:
|
|
177
183
|
- lib
|
|
@@ -186,8 +192,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
186
192
|
- !ruby/object:Gem::Version
|
|
187
193
|
version: '0'
|
|
188
194
|
requirements: []
|
|
189
|
-
rubygems_version: 3.
|
|
190
|
-
signing_key:
|
|
195
|
+
rubygems_version: 3.1.2
|
|
196
|
+
signing_key:
|
|
191
197
|
specification_version: 4
|
|
192
198
|
summary: Legion JSON
|
|
193
199
|
test_files: []
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
module Legion
|
|
2
|
-
module JSON
|
|
3
|
-
# The Legion JSON parser when running on JRuby.
|
|
4
|
-
class JrJackson
|
|
5
|
-
def load(string)
|
|
6
|
-
::JrJackson::Json.load(string, symbolize_keys: true, raw: true)
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def dump(object, options = {})
|
|
10
|
-
::JrJackson::Json.dump(object, options)
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
data/lib/legion/json/oj.rb
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module Legion
|
|
2
|
-
module JSON
|
|
3
|
-
# The Legion JSON parser when running on MRI.
|
|
4
|
-
class Oj
|
|
5
|
-
def load(string)
|
|
6
|
-
::Oj.load(string, symbol_keys: true)
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def dump(object, options = {})
|
|
10
|
-
options[:indent] = 2 if options[:pretty]
|
|
11
|
-
::Oj.dump(object, options)
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|