engineyard-serverside 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/engineyard-serverside.rb +3 -3
- data/lib/engineyard-serverside/configuration.rb +6 -6
- data/lib/engineyard-serverside/deploy.rb +11 -7
- data/lib/engineyard-serverside/version.rb +1 -1
- data/lib/vendor/multi_json/CHANGELOG.md +121 -0
- data/lib/vendor/multi_json/CONTRIBUTING.md +46 -0
- data/lib/vendor/multi_json/Gemfile +31 -0
- data/lib/vendor/multi_json/LICENSE.md +20 -0
- data/lib/vendor/multi_json/README.md +105 -0
- data/lib/vendor/multi_json/Rakefile +12 -0
- data/lib/vendor/multi_json/lib/multi_json.rb +137 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/gson.rb +20 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/json_common.rb +35 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/json_gem.rb +12 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/json_pure.rb +12 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/nsjsonserialization.rb +35 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/oj.rb +29 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/ok_json.rb +58 -0
- data/lib/vendor/multi_json/lib/multi_json/adapters/yajl.rb +20 -0
- data/lib/vendor/multi_json/lib/multi_json/vendor/okjson.rb +602 -0
- data/lib/vendor/multi_json/lib/multi_json/version.rb +3 -0
- data/lib/vendor/multi_json/multi_json.gemspec +22 -0
- data/lib/vendor/multi_json/spec/adapter_shared_example.rb +162 -0
- data/lib/vendor/multi_json/spec/helper.rb +45 -0
- data/lib/vendor/multi_json/spec/json_common_shared_example.rb +36 -0
- data/lib/vendor/multi_json/spec/multi_json_spec.rb +151 -0
- data/spec/configuration_spec.rb +79 -1
- data/spec/deploy_hook_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +26 -120
- data/lib/vendor/json_pure/CHANGES +0 -166
- data/lib/vendor/json_pure/COPYING +0 -58
- data/lib/vendor/json_pure/GPL +0 -340
- data/lib/vendor/json_pure/README +0 -358
- data/lib/vendor/json_pure/Rakefile +0 -292
- data/lib/vendor/json_pure/TODO +0 -1
- data/lib/vendor/json_pure/VERSION +0 -1
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +0 -52
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +0 -900
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +0 -901
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +0 -261
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +0 -262
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +0 -82
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +0 -34
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +0 -900
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +0 -901
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +0 -81
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +0 -82
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +0 -82
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +0 -82
- data/lib/vendor/json_pure/benchmarks/generator2_benchmark.rb +0 -222
- data/lib/vendor/json_pure/benchmarks/generator_benchmark.rb +0 -224
- data/lib/vendor/json_pure/benchmarks/ohai.json +0 -1216
- data/lib/vendor/json_pure/benchmarks/ohai.ruby +0 -1
- data/lib/vendor/json_pure/benchmarks/parser2_benchmark.rb +0 -251
- data/lib/vendor/json_pure/benchmarks/parser_benchmark.rb +0 -259
- data/lib/vendor/json_pure/bin/edit_json.rb +0 -9
- data/lib/vendor/json_pure/bin/prettify_json.rb +0 -75
- data/lib/vendor/json_pure/data/example.json +0 -1
- data/lib/vendor/json_pure/data/index.html +0 -38
- data/lib/vendor/json_pure/data/prototype.js +0 -4184
- data/lib/vendor/json_pure/ext/json/ext/generator/extconf.rb +0 -16
- data/lib/vendor/json_pure/ext/json/ext/generator/generator.c +0 -1323
- data/lib/vendor/json_pure/ext/json/ext/generator/generator.h +0 -170
- data/lib/vendor/json_pure/ext/json/ext/parser/extconf.rb +0 -15
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.c +0 -1935
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.h +0 -71
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.rl +0 -792
- data/lib/vendor/json_pure/install.rb +0 -26
- data/lib/vendor/json_pure/lib/json.rb +0 -10
- data/lib/vendor/json_pure/lib/json/Array.xpm +0 -21
- data/lib/vendor/json_pure/lib/json/FalseClass.xpm +0 -21
- data/lib/vendor/json_pure/lib/json/Hash.xpm +0 -21
- data/lib/vendor/json_pure/lib/json/Key.xpm +0 -73
- data/lib/vendor/json_pure/lib/json/NilClass.xpm +0 -21
- data/lib/vendor/json_pure/lib/json/Numeric.xpm +0 -28
- data/lib/vendor/json_pure/lib/json/String.xpm +0 -96
- data/lib/vendor/json_pure/lib/json/TrueClass.xpm +0 -21
- data/lib/vendor/json_pure/lib/json/add/core.rb +0 -148
- data/lib/vendor/json_pure/lib/json/add/rails.rb +0 -58
- data/lib/vendor/json_pure/lib/json/common.rb +0 -397
- data/lib/vendor/json_pure/lib/json/editor.rb +0 -1371
- data/lib/vendor/json_pure/lib/json/ext.rb +0 -15
- data/lib/vendor/json_pure/lib/json/json.xpm +0 -1499
- data/lib/vendor/json_pure/lib/json/pure.rb +0 -77
- data/lib/vendor/json_pure/lib/json/pure/generator.rb +0 -452
- data/lib/vendor/json_pure/lib/json/pure/parser.rb +0 -307
- data/lib/vendor/json_pure/lib/json/version.rb +0 -8
- data/lib/vendor/json_pure/tests/fixtures/fail1.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail10.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail11.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail12.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail13.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail14.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail18.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail19.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail2.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail20.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail21.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail22.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail23.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail24.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail25.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail27.json +0 -2
- data/lib/vendor/json_pure/tests/fixtures/fail28.json +0 -2
- data/lib/vendor/json_pure/tests/fixtures/fail3.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail4.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail5.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail6.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail7.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail8.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail9.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass1.json +0 -56
- data/lib/vendor/json_pure/tests/fixtures/pass15.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass16.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass17.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass2.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass26.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass3.json +0 -6
- data/lib/vendor/json_pure/tests/test_json.rb +0 -361
- data/lib/vendor/json_pure/tests/test_json_addition.rb +0 -162
- data/lib/vendor/json_pure/tests/test_json_encoding.rb +0 -68
- data/lib/vendor/json_pure/tests/test_json_fixtures.rb +0 -34
- data/lib/vendor/json_pure/tests/test_json_generate.rb +0 -122
- data/lib/vendor/json_pure/tests/test_json_rails.rb +0 -144
- data/lib/vendor/json_pure/tests/test_json_unicode.rb +0 -76
- data/lib/vendor/json_pure/tools/fuzz.rb +0 -139
- data/lib/vendor/json_pure/tools/server.rb +0 -61
@@ -10,10 +10,10 @@ end
|
|
10
10
|
$LOAD_PATH.unshift File.expand_path('vendor/thor/lib', File.dirname(__FILE__))
|
11
11
|
$LOAD_PATH.unshift File.expand_path('vendor/systemu/lib', File.dirname(__FILE__))
|
12
12
|
$LOAD_PATH.unshift File.expand_path('vendor/escape/lib', File.dirname(__FILE__))
|
13
|
-
$LOAD_PATH.unshift File.expand_path('vendor/
|
13
|
+
$LOAD_PATH.unshift File.expand_path('vendor/multi_json/lib', File.dirname(__FILE__))
|
14
14
|
|
15
15
|
require 'escape'
|
16
|
-
require '
|
16
|
+
require 'multi_json'
|
17
17
|
|
18
18
|
require 'engineyard-serverside/version'
|
19
19
|
require 'engineyard-serverside/about'
|
@@ -35,7 +35,7 @@ module EY
|
|
35
35
|
RemoteFailure = Class.new StandardError
|
36
36
|
|
37
37
|
def self.node
|
38
|
-
@node ||= deep_indifferentize(
|
38
|
+
@node ||= deep_indifferentize(MultiJson.load(dna_json))
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.dna_json
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'multi_json'
|
2
2
|
require 'thor'
|
3
3
|
require 'pp'
|
4
4
|
require 'engineyard-serverside/paths'
|
@@ -60,11 +60,11 @@ module EY
|
|
60
60
|
def_option :stack, nil
|
61
61
|
def_option :strategy, 'Git'
|
62
62
|
def_option :branch, 'master'
|
63
|
-
def_option :bundle_without, 'test development'
|
64
63
|
def_option :current_roles, []
|
65
64
|
def_option :current_name, nil
|
66
65
|
def_option :asset_roles, [:app_master, :app, :solo]
|
67
66
|
def_option :copy_exclude, []
|
67
|
+
def_option(:bundle_without) { (%w[test development] - [framework_env]).join(' ') }
|
68
68
|
def_option(:user) { ENV['USER'] }
|
69
69
|
def_option(:group) { user }
|
70
70
|
|
@@ -79,7 +79,7 @@ module EY
|
|
79
79
|
|
80
80
|
def initialize(options)
|
81
81
|
opts = string_keys(options)
|
82
|
-
config =
|
82
|
+
config = MultiJson.load(opts.delete("config") || "{}")
|
83
83
|
append_config_source opts # high priority
|
84
84
|
append_config_source config # lower priority
|
85
85
|
end
|
@@ -150,7 +150,7 @@ module EY
|
|
150
150
|
end
|
151
151
|
|
152
152
|
def to_json
|
153
|
-
configuration
|
153
|
+
MultiJson.dump(configuration)
|
154
154
|
end
|
155
155
|
|
156
156
|
def node
|
@@ -227,11 +227,11 @@ module EY
|
|
227
227
|
end
|
228
228
|
|
229
229
|
def precompile_assets?
|
230
|
-
precompile_assets == true
|
230
|
+
precompile_assets == true || precompile_assets == "true"
|
231
231
|
end
|
232
232
|
|
233
233
|
def skip_precompile_assets?
|
234
|
-
precompile_assets == false
|
234
|
+
precompile_assets == false || precompile_assets == "false"
|
235
235
|
end
|
236
236
|
|
237
237
|
# Assume downtime required if stack is not specified (nil) just in case.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# stolen wholesale from capistrano, thanks Jamis!
|
2
2
|
require 'base64'
|
3
3
|
require 'fileutils'
|
4
|
-
require '
|
4
|
+
require 'multi_json'
|
5
5
|
require 'engineyard-serverside/rails_asset_support'
|
6
6
|
require 'engineyard-serverside/maintenance'
|
7
7
|
|
@@ -283,7 +283,7 @@ chmod 0700 #{path}
|
|
283
283
|
end
|
284
284
|
|
285
285
|
def services_command_check
|
286
|
-
"which /usr/local/ey_resin/ruby/bin/ey-services-setup"
|
286
|
+
"which /usr/local/ey_resin/ruby/bin/ey-services-setup >/dev/null 2>&1"
|
287
287
|
end
|
288
288
|
|
289
289
|
def services_setup_command
|
@@ -293,20 +293,24 @@ chmod 0700 #{path}
|
|
293
293
|
def setup_services
|
294
294
|
shell.status "Setting up external services."
|
295
295
|
previously_configured_services = parse_configured_services
|
296
|
+
|
296
297
|
begin
|
297
298
|
sudo(services_command_check)
|
298
299
|
rescue StandardError => e
|
299
300
|
shell.info "Could not setup services. Upgrade your environment to get services configuration."
|
300
301
|
return
|
301
302
|
end
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
303
|
+
|
304
|
+
begin
|
305
|
+
sudo(services_setup_command)
|
306
|
+
rescue StandardError => e
|
307
|
+
unless previously_configured_services.empty?
|
308
|
+
shell.warning <<-WARNING
|
306
309
|
External services configuration not updated. Using previous version.
|
307
310
|
Deploy again if your services configuration appears incomplete or out of date.
|
308
311
|
#{e}
|
309
|
-
|
312
|
+
WARNING
|
313
|
+
end
|
310
314
|
end
|
311
315
|
end
|
312
316
|
|
@@ -0,0 +1,121 @@
|
|
1
|
+
1.6.1
|
2
|
+
-----
|
3
|
+
* [Revert "Use JSON.generate instead of #to_json"](https://github.com/intridea/multi_json/issues/86)
|
4
|
+
|
5
|
+
1.6.0
|
6
|
+
-----
|
7
|
+
* [Add gson.rb support](https://github.com/intridea/multi_json/pull/71)
|
8
|
+
* [Add MultiJson.default_options](https://github.com/intridea/multi_json/pull/70)
|
9
|
+
* [Add MultiJson.with_adapter](https://github.com/intridea/multi_json/pull/67)
|
10
|
+
* [Stringify all possible keys for ok_json](https://github.com/intridea/multi_json/pull/66)
|
11
|
+
* [Use JSON.generate instead of #to_json](https://github.com/intridea/multi_json/issues/73)
|
12
|
+
* [Alias `MultiJson::DecodeError` to `MultiJson::LoadError`](https://github.com/intridea/multi_json/pull/79)
|
13
|
+
|
14
|
+
1.5.1
|
15
|
+
-----
|
16
|
+
* [Do not allow Oj or JSON to create symbols by searching for classes](https://github.com/intridea/multi_json/commit/193e28cf4dc61b6e7b7b7d80f06f74c76df65c41)
|
17
|
+
|
18
|
+
1.5.0
|
19
|
+
-----
|
20
|
+
* [Add `MultiJson.with_adapter` method](https://github.com/intridea/multi_json/commit/d14c5d28cae96557a0421298621b9499e1f28104)
|
21
|
+
* [Stringify all possible keys for `ok_json`](https://github.com/intridea/multi_json/commit/73998074058e1e58c557ffa7b9541d486d6041fa)
|
22
|
+
|
23
|
+
1.4.0
|
24
|
+
-----
|
25
|
+
* [Allow `load`/`dump` of JSON fragments](https://github.com/intridea/multi_json/commit/707aae7d48d39c85b38febbd2c210ba87f6e4a36)
|
26
|
+
|
27
|
+
1.3.7
|
28
|
+
-----
|
29
|
+
* [Fix rescue clause for MagLev](https://github.com/intridea/multi_json/commit/39abdf50199828c50e85b2ce8f8ba31fcbbc9332)
|
30
|
+
* [Remove unnecessary check for string version of options key](https://github.com/intridea/multi_json/commit/660101b70e962b3c007d0b90d45944fa47d13ec4)
|
31
|
+
* [Explicitly set default adapter when adapter is set to `nil` or `false`](https://github.com/intridea/multi_json/commit/a9e587d5a63eafb4baee9fb211265e4dd96a26bc)
|
32
|
+
* [Fix Oj `ParseError` mapping for Oj 1.4.0](https://github.com/intridea/multi_json/commit/7d9045338cc9029401c16f3c409d54ce97f275e2)
|
33
|
+
|
34
|
+
1.3.6
|
35
|
+
-----
|
36
|
+
* [Allow adapter-specific options to be passed through to Oj](https://github.com/intridea/multi_json/commit/d0e5feeebcba0bc69400dd203a295f5c30971223)
|
37
|
+
|
38
|
+
1.3.5
|
39
|
+
-----
|
40
|
+
* [Add pretty support to Oj adapter](https://github.com/intridea/multi_json/commit/0c8f75f03020c53bcf4c6be258faf433d24b2c2b)
|
41
|
+
|
42
|
+
1.3.4
|
43
|
+
-----
|
44
|
+
* [Use `class << self` instead of `module_function` to create aliases](https://github.com/intridea/multi_json/commit/ba1451c4c48baa297e049889be241a424cb05980)
|
45
|
+
|
46
|
+
1.3.3
|
47
|
+
-----
|
48
|
+
* [Remove deprecation warnings](https://github.com/intridea/multi_json/commit/36b524e71544eb0186826a891bcc03b2820a008f)
|
49
|
+
|
50
|
+
1.3.2
|
51
|
+
-----
|
52
|
+
* [Add ability to use adapter per call](https://github.com/intridea/multi_json/commit/106bbec469d5d0a832bfa31fffcb8c0f0cdc9bd3)
|
53
|
+
* [Add and deprecate `default_engine` method](https://github.com/intridea/multi_json/commit/fc3df0c7a3e2ab9ce0c2c7e7617a4da97dd13f6e)
|
54
|
+
|
55
|
+
1.3.1
|
56
|
+
-----
|
57
|
+
* [Only warn once for each instance a deprecated method is called](https://github.com/intridea/multi_json/commit/e21d6eb7da74b3f283995c1d27d5880e75f0ae84)
|
58
|
+
|
59
|
+
1.3.0
|
60
|
+
-----
|
61
|
+
* [Implement `load`/`dump`; deprecate `decode`/`encode`](https://github.com/intridea/multi_json/commit/e90fd6cb1b0293eb0c73c2f4eb0f7a1764370216)
|
62
|
+
* [Rename engines to adapters](https://github.com/intridea/multi_json/commit/ae7fd144a7949a9c221dcaa446196ec23db908df)
|
63
|
+
|
64
|
+
1.2.0
|
65
|
+
-----
|
66
|
+
* [Add support for Oj](https://github.com/intridea/multi_json/commit/acd06b233edabe6c44f226873db7b49dab560c60)
|
67
|
+
|
68
|
+
1.1.0
|
69
|
+
-----
|
70
|
+
* [`NSJSONSerialization` support for MacRuby](https://github.com/intridea/multi_json/commit/f862e2fc966cac8867fe7da3997fc76e8a6cf5d4)
|
71
|
+
|
72
|
+
1.0.4
|
73
|
+
-----
|
74
|
+
* [Set data context to `DecodeError` exception](https://github.com/intridea/multi_json/commit/19ddafd44029c6681f66fae2a0f6eabfd0f85176)
|
75
|
+
* [Allow `ok_json` to fallback to `to_json`](https://github.com/intridea/multi_json/commit/c157240b1193b283d06d1bd4d4b5b06bcf3761f8)
|
76
|
+
* [Add warning when using `ok_json`](https://github.com/intridea/multi_json/commit/dd4b68810c84f826fb98f9713bfb29ab96888d57)
|
77
|
+
* [Options can be passed to an engine on encode](https://github.com/intridea/multi_json/commit/e0a7ff5d5ff621ffccc61617ed8aeec5816e81f7)
|
78
|
+
|
79
|
+
1.0.3
|
80
|
+
-----
|
81
|
+
* [`Array` support for `stringify_keys`](https://github.com/intridea/multi_json/commit/644d1c5c7c7f6a27663b11668527b346094e38b9)
|
82
|
+
* [`Array` support for `symbolize_keys`](https://github.com/intridea/multi_json/commit/c885377d47a2aa39cb0d971fea78db2d2fa479a7)
|
83
|
+
|
84
|
+
1.0.2
|
85
|
+
-----
|
86
|
+
* [Allow encoding of rootless JSON when `ok_json` is used](https://github.com/intridea/multi_json/commit/d1cde7de97cb0f6152aef8daf14037521cdce8c6)
|
87
|
+
|
88
|
+
1.0.1
|
89
|
+
-----
|
90
|
+
* [Correct an issue with `ok_json` not being returned as the default engine](https://github.com/intridea/multi_json/commit/d33c141619c54cccd770199694da8fd1bd8f449d)
|
91
|
+
|
92
|
+
1.0.0
|
93
|
+
-----
|
94
|
+
* [Remove `ActiveSupport::JSON` support](https://github.com/intridea/multi_json/commit/c2f4140141d785a24b3f56e58811b0e561b37f6a)
|
95
|
+
* [Fix `@engine` ivar warning](https://github.com/intridea/multi_json/commit/3b978a8995721a8dffedc3b75a7f49e5494ec553)
|
96
|
+
* [Only `rescue` from parsing errors during decoding, not any `StandardError`](https://github.com/intridea/multi_json/commit/391d00b5e85294d42d41347605d8d46b4a7f66cc)
|
97
|
+
* [Rename `okjson` engine and vendored lib to `ok_json`](https://github.com/intridea/multi_json/commit/5bd1afc977a8208ddb0443e1d57cb79665c019f1)
|
98
|
+
* [Add `StringIO` support to `json` gem and `ok_json`](https://github.com/intridea/multi_json/commit/1706b11568db7f50af451fce5f4d679aeb3bbe8f)
|
99
|
+
|
100
|
+
0.0.5
|
101
|
+
-----
|
102
|
+
* [Trap all JSON decoding errors; raise `MultiJson::DecodeError`](https://github.com/intridea/multi_json/commit/dea9a1aef6dd1212aa1e5a37ab1669f9b045b732)
|
103
|
+
|
104
|
+
0.0.4
|
105
|
+
-----
|
106
|
+
* [Fix default_engine check for `json` gem](https://github.com/intridea/multi_json/commit/caced0c4e8c795922a109ebc00c3c4fa8635bed8)
|
107
|
+
* [Make requirement mapper an `Array` to preserve order in Ruby versions < 1.9](https://github.com/intridea/multi_json/commit/526f5f29a42131574a088ad9bbb43d7f48439b2c)
|
108
|
+
|
109
|
+
0.0.3
|
110
|
+
-----
|
111
|
+
* [Improved defaulting and documentation](https://github.com/sferik/twitter/commit/3a0e41b9e4b0909201045fa47704b78c9d949b73)
|
112
|
+
|
113
|
+
0.0.2
|
114
|
+
-----
|
115
|
+
|
116
|
+
* [Rename to `multi_json`](https://github.com/sferik/twitter/commit/461ab89ce071c8c9fabfc183581e0ec523788b62)
|
117
|
+
|
118
|
+
0.0.1
|
119
|
+
-----
|
120
|
+
|
121
|
+
* [Initial commit](https://github.com/sferik/twitter/commit/518c21ab299c500527491e6c049ab2229e22a805)
|
@@ -0,0 +1,46 @@
|
|
1
|
+
## Contributing
|
2
|
+
In the spirit of [free software][free-sw], **everyone** is encouraged to help
|
3
|
+
improve this project.
|
4
|
+
|
5
|
+
[free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
|
6
|
+
|
7
|
+
Here are some ways *you* can contribute:
|
8
|
+
|
9
|
+
* by using alpha, beta, and prerelease versions
|
10
|
+
* by reporting bugs
|
11
|
+
* by suggesting new features
|
12
|
+
* by writing or editing documentation
|
13
|
+
* by writing specifications
|
14
|
+
* by writing code (**no patch is too small**: fix typos, add comments, clean up
|
15
|
+
inconsistent whitespace)
|
16
|
+
* by refactoring code
|
17
|
+
* by closing [issues][]
|
18
|
+
* by reviewing patches
|
19
|
+
|
20
|
+
[issues]: https://github.com/intridea/multi_json/issues
|
21
|
+
|
22
|
+
## Submitting an Issue
|
23
|
+
We use the [GitHub issue tracker][issues] to track bugs and features. Before
|
24
|
+
submitting a bug report or feature request, check to make sure it hasn't
|
25
|
+
already been submitted. When submitting a bug report, please include a [Gist][]
|
26
|
+
that includes a stack trace and any details that may be necessary to reproduce
|
27
|
+
the bug, including your gem version, Ruby version, and operating system.
|
28
|
+
Ideally, a bug report should include a pull request with failing specs.
|
29
|
+
|
30
|
+
[gist]: https://gist.github.com/
|
31
|
+
|
32
|
+
## Submitting a Pull Request
|
33
|
+
1. [Fork the repository.][fork]
|
34
|
+
2. [Create a topic branch.][branch]
|
35
|
+
3. Add specs for your unimplemented feature or bug fix.
|
36
|
+
4. Run `bundle exec rake spec`. If your specs pass, return to step 3.
|
37
|
+
5. Implement your feature or bug fix.
|
38
|
+
6. Run `bundle exec rake spec`. If your specs fail, return to step 5.
|
39
|
+
7. Run `open coverage/index.html`. If your changes are not completely covered
|
40
|
+
by your tests, return to step 3.
|
41
|
+
8. Add, commit, and push your changes.
|
42
|
+
9. [Submit a pull request.][pr]
|
43
|
+
|
44
|
+
[fork]: http://help.github.com/fork-a-repo/
|
45
|
+
[branch]: http://learn.github.com/p/branching.html
|
46
|
+
[pr]: http://help.github.com/send-pull-requests/
|
@@ -0,0 +1,31 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rake', '>= 0.9'
|
4
|
+
gem 'yard', '>= 0.8'
|
5
|
+
|
6
|
+
platforms :ruby_18 do
|
7
|
+
gem 'json', '~> 1.4', :require => nil
|
8
|
+
end
|
9
|
+
|
10
|
+
gem 'json_pure', '~> 1.4', :require => nil
|
11
|
+
|
12
|
+
platforms :ruby, :mswin, :mingw do
|
13
|
+
gem 'oj', '~> 2.0', :require => nil
|
14
|
+
gem 'yajl-ruby', '~> 1.0', :require => nil
|
15
|
+
end
|
16
|
+
platforms :jruby do
|
17
|
+
gem 'gson', '>= 0.6', :require => nil
|
18
|
+
end
|
19
|
+
|
20
|
+
group :development do
|
21
|
+
gem 'kramdown', '>= 0.14'
|
22
|
+
gem 'pry'
|
23
|
+
gem 'pry-debugger', :platforms => :mri_19
|
24
|
+
end
|
25
|
+
|
26
|
+
group :test do
|
27
|
+
gem 'rspec', '>= 2.11'
|
28
|
+
gem 'simplecov', :require => false
|
29
|
+
end
|
30
|
+
|
31
|
+
gemspec
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010-2013 Michael Bleigh, Josh Kalderimis, Erik Michaels-Ober, Pavel Pravosud
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# MultiJSON
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/multi_json.png)][gem]
|
3
|
+
[![Build Status](https://secure.travis-ci.org/intridea/multi_json.png?branch=master)][travis]
|
4
|
+
[![Dependency Status](https://gemnasium.com/intridea/multi_json.png?travis)][gemnasium]
|
5
|
+
[![Code Climate](https://codeclimate.com/github/intridea/multi_json.png)][codeclimate]
|
6
|
+
|
7
|
+
[gem]: https://rubygems.org/gems/multi_json
|
8
|
+
[travis]: http://travis-ci.org/intridea/multi_json
|
9
|
+
[gemnasium]: https://gemnasium.com/intridea/multi_json
|
10
|
+
[codeclimate]: https://codeclimate.com/github/intridea/multi_json
|
11
|
+
|
12
|
+
Lots of Ruby libraries parse JSON and everyone has their favorite JSON coder.
|
13
|
+
Instead of choosing a single JSON coder and forcing users of your library to be
|
14
|
+
stuck with it, you can use MultiJSON instead, which will simply choose the
|
15
|
+
fastest available JSON coder. Here's how to use it:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'multi_json'
|
19
|
+
|
20
|
+
MultiJson.load('{"abc":"def"}') #=> {"abc" => "def"}
|
21
|
+
MultiJson.load('{"abc":"def"}', :symbolize_keys => true) #=> {:abc => "def"}
|
22
|
+
MultiJson.dump({:abc => 'def'}) # convert Ruby back to JSON
|
23
|
+
MultiJson.dump({:abc => 'def'}, :pretty => true) # encoded in a pretty form (if supported by the coder)
|
24
|
+
```
|
25
|
+
|
26
|
+
When loading invalid JSON, multiJSON will throw a `MultiJson::LoadError`. `MultiJson::DecodeError` is an alias for backwards compatibility.
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
MultiJson.load('invalid json') #=> MultiJson::LoadError
|
30
|
+
```
|
31
|
+
|
32
|
+
The `use` method, which sets the MultiJson adapter, takes either a symbol or a
|
33
|
+
class (to allow for custom JSON parsers) that responds to both `.load` and `.dump`
|
34
|
+
at the class level.
|
35
|
+
|
36
|
+
MultiJSON tries to have intelligent defaulting. That is, if you have any of the
|
37
|
+
supported engines already loaded, it will utilize them before attempting to
|
38
|
+
load any. When loading, libraries are ordered by speed. First Oj, then Yajl,
|
39
|
+
then the JSON gem, then JSON pure. If no other JSON library is available,
|
40
|
+
MultiJSON falls back to [OkJson][], a simple, vendorable JSON parser.
|
41
|
+
|
42
|
+
[okjson]: https://github.com/kr/okjson
|
43
|
+
|
44
|
+
## Supported JSON Engines
|
45
|
+
|
46
|
+
* [Oj](https://github.com/ohler55/oj) Optimized JSON by Peter Ohler
|
47
|
+
* [Yajl](https://github.com/brianmario/yajl-ruby) Yet Another JSON Library by Brian Lopez
|
48
|
+
* [JSON](https://github.com/flori/json) The default JSON gem with C-extensions (ships with Ruby 1.9)
|
49
|
+
* [JSON Pure](https://github.com/flori/json) A Ruby variant of the JSON gem
|
50
|
+
* [NSJSONSerialization](https://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSJSONSerialization_Class/Reference/Reference.html) Wrapper for Apple's NSJSONSerialization in the Cocoa Framework (MacRuby only)
|
51
|
+
* [gson.rb](https://github.com/avsej/gson.rb) A Ruby wrapper for google-gson library (JRuby only)
|
52
|
+
* [OkJson][okjson] A simple, vendorable JSON parser
|
53
|
+
|
54
|
+
## Supported Ruby Versions
|
55
|
+
This library aims to support and is [tested against][travis] the following Ruby
|
56
|
+
implementations:
|
57
|
+
|
58
|
+
* Ruby 1.8.7
|
59
|
+
* Ruby 1.9.2
|
60
|
+
* Ruby 1.9.3
|
61
|
+
* Ruby 2.0.0
|
62
|
+
* [JRuby][]
|
63
|
+
* [Rubinius][]
|
64
|
+
* [MacRuby][] (not tested on Travis CI)
|
65
|
+
|
66
|
+
[jruby]: http://www.jruby.org/
|
67
|
+
[rubinius]: http://rubini.us/
|
68
|
+
[macruby]: http://www.macruby.org/
|
69
|
+
|
70
|
+
If something doesn't work on one of these interpreters, it's a bug.
|
71
|
+
|
72
|
+
This library may inadvertently work (or seem to work) on other Ruby
|
73
|
+
implementations, however support will only be provided for the versions listed
|
74
|
+
above.
|
75
|
+
|
76
|
+
If you would like this library to support another Ruby version, you may
|
77
|
+
volunteer to be a maintainer. Being a maintainer entails making sure all tests
|
78
|
+
run and pass on that implementation. When something breaks on your
|
79
|
+
implementation, you will be responsible for providing patches in a timely
|
80
|
+
fashion. If critical issues for a particular implementation exist at the time
|
81
|
+
of a major release, support for that Ruby version may be dropped.
|
82
|
+
|
83
|
+
## Versioning
|
84
|
+
|
85
|
+
This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations
|
86
|
+
of this scheme should be reported as bugs. Specifically, if a minor or patch
|
87
|
+
version is released that breaks backward compatibility, that version should be
|
88
|
+
immediately yanked and/or a new version should be immediately released that
|
89
|
+
restores compatibility. Breaking changes to the public API will only be
|
90
|
+
introduced with new major versions. As a result of this policy, you can (and
|
91
|
+
should) specify a dependency on this gem using the [Pessimistic Version
|
92
|
+
Constraint][pvc] with two digits of precision. For example:
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
spec.add_dependency 'multi_json', '~> 1.0'
|
96
|
+
```
|
97
|
+
|
98
|
+
[semver]: http://semver.org/
|
99
|
+
[pvc]: http://docs.rubygems.org/read/chapter/16#page74
|
100
|
+
|
101
|
+
## Copyright
|
102
|
+
Copyright (c) 2010-2013 Michael Bleigh, Josh Kalderimis, Erik Michaels-Ober,
|
103
|
+
and Pavel Pravosud. See [LICENSE][] for details.
|
104
|
+
|
105
|
+
[license]: LICENSE.md
|