nutshell-crm 0.0.1
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.
- data/.gitignore +21 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/README +0 -0
- data/Rakefile +2 -0
- data/lib/nutshell-crm.rb +78 -0
- data/lib/nutshell-crm/version.rb +3 -0
- data/nutshell-crm.gemspec +28 -0
- data/spec/nutshell-crm_spec.rb +212 -0
- data/spec/spec_helper.rb +8 -0
- data/vendor/bundle/bin/autospec +19 -0
- data/vendor/bundle/bin/htmldiff +21 -0
- data/vendor/bundle/bin/httparty +19 -0
- data/vendor/bundle/bin/ldiff +21 -0
- data/vendor/bundle/bin/rspec +19 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/.gemtest +0 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/History.rdoc +54 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/License.rdoc +38 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/Manifest.txt +27 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/README.rdoc +72 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/Rakefile +26 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/bin/htmldiff +32 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/bin/ldiff +6 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/diff-lcs.gemspec +51 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/docs/COPYING.txt +340 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/docs/artistic.html +289 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff-lcs.rb +5 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs.rb +1105 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/array.rb +21 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/block.rb +51 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/callbacks.rb +322 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/change.rb +169 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/htmldiff.rb +151 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/hunk.rb +242 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/ldiff.rb +210 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/string.rb +19 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/diff_spec.rb +35 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/lcs_spec.rb +36 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/patch_spec.rb +390 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/sdiff_spec.rb +204 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/spec_helper.rb +284 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/traverse_balanced_spec.rb +286 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/traverse_sequences_spec.rb +83 -0
- data/vendor/bundle/gems/httparty-0.8.1/.gitignore +9 -0
- data/vendor/bundle/gems/httparty-0.8.1/Gemfile +8 -0
- data/vendor/bundle/gems/httparty-0.8.1/History +259 -0
- data/vendor/bundle/gems/httparty-0.8.1/MIT-LICENSE +20 -0
- data/vendor/bundle/gems/httparty-0.8.1/README.rdoc +54 -0
- data/vendor/bundle/gems/httparty-0.8.1/Rakefile +15 -0
- data/vendor/bundle/gems/httparty-0.8.1/bin/httparty +108 -0
- data/vendor/bundle/gems/httparty-0.8.1/cucumber.yml +1 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/aaws.rb +32 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/basic.rb +32 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/crack.rb +19 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/custom_parsers.rb +67 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/delicious.rb +37 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/google.rb +16 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/rubyurl.rb +14 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/tripit_sign_in.rb +33 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/twitter.rb +31 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/whoismyrep.rb +10 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/basic_authentication.feature +20 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/command_line.feature +7 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/deals_with_http_error_codes.feature +26 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/digest_authentication.feature +20 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/handles_compressed_responses.feature +19 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/handles_multiple_formats.feature +34 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/steps/env.rb +22 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/steps/httparty_response_steps.rb +26 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/steps/httparty_steps.rb +27 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/steps/mongrel_helper.rb +94 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/steps/remote_service_steps.rb +69 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/supports_redirection.feature +22 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/supports_timeout_option.feature +13 -0
- data/vendor/bundle/gems/httparty-0.8.1/httparty.gemspec +24 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty.rb +452 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/cookie_hash.rb +22 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/core_extensions.rb +9 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/exceptions.rb +26 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/hash_conversions.rb +51 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/module_inheritable_attributes.rb +34 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/net_digest_auth.rb +71 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/parser.rb +141 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/request.rb +257 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/response.rb +85 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/version.rb +3 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/delicious.xml +23 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/empty.xml +0 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/google.html +3 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generate.sh +29 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/1fe462c2.0 +16 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/bogushost.crt +13 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/ca.crt +16 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/ca.key +15 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/selfsigned.crt +14 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/server.crt +13 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/server.key +15 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/openssl-exts.cnf +9 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/twitter.json +1 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/twitter.xml +403 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/undefined_method_add_node_for_nil.xml +2 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/cookie_hash_spec.rb +71 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/net_digest_auth_spec.rb +93 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/parser_spec.rb +155 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/request_spec.rb +544 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/response_spec.rb +193 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/ssl_spec.rb +54 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty_spec.rb +621 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/spec.opts +3 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/spec_helper.rb +22 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_helper.rb +25 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_server.rb +69 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/support/stub_response.rb +30 -0
- data/vendor/bundle/gems/httparty-0.8.1/website/css/common.css +47 -0
- data/vendor/bundle/gems/httparty-0.8.1/website/index.html +73 -0
- data/vendor/bundle/gems/json-1.6.3/.gitignore +8 -0
- data/vendor/bundle/gems/json-1.6.3/.travis.yml +15 -0
- data/vendor/bundle/gems/json-1.6.3/CHANGES +223 -0
- data/vendor/bundle/gems/json-1.6.3/COPYING +58 -0
- data/vendor/bundle/gems/json-1.6.3/COPYING-json-jruby +57 -0
- data/vendor/bundle/gems/json-1.6.3/GPL +340 -0
- data/vendor/bundle/gems/json-1.6.3/Gemfile +11 -0
- data/vendor/bundle/gems/json-1.6.3/README-json-jruby.markdown +33 -0
- data/vendor/bundle/gems/json-1.6.3/README.rdoc +358 -0
- data/vendor/bundle/gems/json-1.6.3/Rakefile +408 -0
- data/vendor/bundle/gems/json-1.6.3/TODO +1 -0
- data/vendor/bundle/gems/json-1.6.3/VERSION +1 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/.keep +0 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data/.keep +0 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/generator2_benchmark.rb +222 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/generator_benchmark.rb +224 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/ohai.json +1216 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/ohai.ruby +1 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/parser2_benchmark.rb +251 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/parser_benchmark.rb +259 -0
- data/vendor/bundle/gems/json-1.6.3/data/example.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/data/index.html +38 -0
- data/vendor/bundle/gems/json-1.6.3/data/prototype.js +4184 -0
- data/vendor/bundle/gems/json-1.6.3/diagrams/.keep +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/fbuffer/fbuffer.h +156 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/Makefile +187 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/extconf.rb +13 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.bundle +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.c +1384 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.h +161 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.o +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/json/ext/generator.bundle +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/json/ext/parser.bundle +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/Makefile +187 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/extconf.rb +13 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.bundle +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.c +2197 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.h +77 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.o +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.rl +920 -0
- data/vendor/bundle/gems/json-1.6.3/install.rb +19 -0
- data/vendor/bundle/gems/json-1.6.3/java/lib/bytelist-1.0.6.jar +0 -0
- data/vendor/bundle/gems/json-1.6.3/java/lib/jcodings.jar +0 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/ByteListTranscoder.java +167 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Generator.java +437 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/GeneratorMethods.java +232 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/GeneratorService.java +43 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/GeneratorState.java +522 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/OptionsReader.java +119 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Parser.java +2589 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Parser.rl +913 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/ParserService.java +35 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/RuntimeInfo.java +121 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/StringDecoder.java +166 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/StringEncoder.java +106 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Utils.java +89 -0
- data/vendor/bundle/gems/json-1.6.3/json-java.gemspec +22 -0
- data/vendor/bundle/gems/json-1.6.3/json.gemspec +40 -0
- data/vendor/bundle/gems/json-1.6.3/json_pure.gemspec +42 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json.rb +62 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/bigdecimal.rb +21 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/complex.rb +22 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/core.rb +11 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/date.rb +34 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/date_time.rb +50 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/exception.rb +31 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/ostruct.rb +31 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/range.rb +29 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/rational.rb +22 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/regexp.rb +30 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/struct.rb +30 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/symbol.rb +25 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/time.rb +35 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/common.rb +470 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/ext.rb +21 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/ext/.keep +0 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/pure.rb +21 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/pure/generator.rb +468 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/pure/parser.rb +359 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/version.rb +8 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail1.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail10.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail11.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail12.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail13.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail14.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail18.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail19.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail2.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail20.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail21.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail22.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail23.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail24.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail25.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail27.json +2 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail28.json +2 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail3.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail4.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail5.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail6.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail7.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail8.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail9.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass1.json +56 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass15.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass16.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass17.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass2.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass26.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass3.json +6 -0
- data/vendor/bundle/gems/json-1.6.3/tests/setup_variant.rb +11 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json.rb +476 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_addition.rb +188 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_encoding.rb +65 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_fixtures.rb +35 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_generate.rb +249 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_string_matching.rb +40 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_unicode.rb +72 -0
- data/vendor/bundle/gems/json-1.6.3/tools/fuzz.rb +139 -0
- data/vendor/bundle/gems/json-1.6.3/tools/server.rb +62 -0
- data/vendor/bundle/gems/multi_json-1.0.4/.document +5 -0
- data/vendor/bundle/gems/multi_json-1.0.4/.rspec +3 -0
- data/vendor/bundle/gems/multi_json-1.0.4/.travis.yml +7 -0
- data/vendor/bundle/gems/multi_json-1.0.4/Gemfile +6 -0
- data/vendor/bundle/gems/multi_json-1.0.4/LICENSE.md +20 -0
- data/vendor/bundle/gems/multi_json-1.0.4/README.md +94 -0
- data/vendor/bundle/gems/multi_json-1.0.4/Rakefile +25 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json.rb +85 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/json_common.rb +27 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/json_gem.rb +12 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/json_pure.rb +12 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/ok_json.rb +48 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/yajl.rb +18 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/vendor/ok_json.rb +587 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/version.rb +3 -0
- data/vendor/bundle/gems/multi_json-1.0.4/multi_json.gemspec +22 -0
- data/vendor/bundle/gems/multi_json-1.0.4/spec/helper.rb +35 -0
- data/vendor/bundle/gems/multi_json-1.0.4/spec/multi_json_spec.rb +178 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/.gemtest +0 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/.gitignore +10 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/.rspec +3 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/.travis.yml +7 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/.yardopts +5 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/Gemfile +9 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/LICENSE.md +20 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/README.md +113 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/Rakefile +23 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml.rb +237 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/libxml.rb +30 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/libxml2_parser.rb +66 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/nokogiri.rb +32 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/ox.rb +97 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/rexml.rb +113 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/version.rb +3 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/multi_xml.gemspec +24 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/spec/helper.rb +3 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/spec/multi_xml_spec.rb +41 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/spec/parser_shared_example.rb +552 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/spec/speed.rb +63 -0
- data/vendor/bundle/gems/rspec-2.7.0/.document +2 -0
- data/vendor/bundle/gems/rspec-2.7.0/.gitignore +8 -0
- data/vendor/bundle/gems/rspec-2.7.0/Gemfile +7 -0
- data/vendor/bundle/gems/rspec-2.7.0/License.txt +22 -0
- data/vendor/bundle/gems/rspec-2.7.0/README.markdown +47 -0
- data/vendor/bundle/gems/rspec-2.7.0/Rakefile +30 -0
- data/vendor/bundle/gems/rspec-2.7.0/lib/rspec.rb +4 -0
- data/vendor/bundle/gems/rspec-2.7.0/lib/rspec/version.rb +5 -0
- data/vendor/bundle/gems/rspec-2.7.0/rspec.gemspec +33 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/README.md +68 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/exe/autospec +13 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/exe/rspec +25 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/Autotest.md +38 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/README.md +17 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/Upgrade.md +364 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/README.md +28 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/configure.feature +22 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/example_name_option.feature +86 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/exit_status.feature +83 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/format_option.feature +81 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/line_number_appended_to_path.feature +140 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/line_number_option.feature +58 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/pattern_option.feature +31 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/rake_task.feature +68 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/ruby.feature +22 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/tag.feature +90 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/alias_example_to.feature +48 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/custom_settings.feature +84 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/default_path.feature +38 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/fail_fast.feature +77 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/read_options_from_file.feature +87 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/example_groups/basic_structure.feature +55 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/example_groups/shared_context.feature +74 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/example_groups/shared_examples.feature +204 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/expectation_framework_integration/configure_expectation_framework.feature +73 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/exclusion_filters.feature +139 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/if_and_unless.feature +168 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/inclusion_filters.feature +105 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/run_all_when_everything_filtered.feature +46 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/formatters/custom_formatter.feature +36 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/formatters/text_formatter.feature +46 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/helper_methods/arbitrary_methods.feature +40 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/helper_methods/let.feature +50 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/helper_methods/modules.feature +149 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/hooks/around_hooks.feature +343 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/hooks/before_and_after_hooks.feature +423 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/hooks/filtering.feature +234 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/metadata/current_example.feature +17 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/metadata/described_class.feature +17 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/metadata/user_defined.feature +113 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_any_framework.feature +106 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_flexmock.feature +96 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_mocha.feature +97 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_rr.feature +98 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_rspec.feature +97 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/pending/pending_examples.feature +229 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/spec_files/arbitrary_file_suffix.feature +13 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/step_definitions/additional_cli_steps.rb +30 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/attribute_of_subject.feature +122 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/explicit_subject.feature +78 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_receiver.feature +29 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature +30 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/support/env.rb +5 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/autotest/discover.rb +1 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/autotest/rspec2.rb +73 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/autorun.rb +2 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core.rb +81 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb +63 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb +32 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/command_line_configuration.rb +62 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb +558 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/configuration_options.rb +139 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/deprecation.rb +48 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/drb_command_line.rb +23 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/dsl.rb +11 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/errors.rb +13 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/example.rb +178 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/example_group.rb +348 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/expecting/with_rspec.rb +9 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/expecting/with_stdlib.rb +9 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions.rb +3 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions/instance_eval_with_args.rb +39 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions/kernel.rb +9 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions/module_eval_with_args.rb +34 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/base_formatter.rb +172 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/base_text_formatter.rb +185 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/documentation_formatter.rb +71 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/helpers.rb +24 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/html_formatter.rb +458 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/progress_formatter.rb +32 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/snippet_extractor.rb +58 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/text_mate_formatter.rb +34 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/hooks.rb +160 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/let.rb +101 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/load_path.rb +3 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/metadata.rb +229 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/metadata_hash_builder.rb +93 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_absolutely_nothing.rb +11 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_flexmock.rb +27 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_mocha.rb +23 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_rr.rb +27 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_rspec.rb +23 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/option_parser.rb +147 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/pending.rb +38 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/rake_task.rb +201 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/reporter.rb +78 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/ruby_project.rb +44 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb +86 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/shared_context.rb +16 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/shared_example_group.rb +67 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/subject.rb +175 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/version.rb +7 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/world.rb +150 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/monkey.rb +1 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/monkey/spork/test_framework/rspec.rb +8 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/autotest/discover_spec.rb +19 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/autotest/failed_results_re_spec.rb +45 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/autotest/rspec_spec.rb +123 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/command_line_configuration_spec.rb +26 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/command_line_spec.rb +169 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/command_line_spec_output.txt +0 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/configuration_options_spec.rb +437 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/configuration_spec.rb +920 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/deprecations_spec.rb +66 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/drb_command_line_spec.rb +124 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/example_group_spec.rb +1046 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/example_spec.rb +289 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/base_formatter_spec.rb +80 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/base_text_formatter_spec.rb +344 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/documentation_formatter_spec.rb +66 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/helpers_spec.rb +46 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +462 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.8.7.html +399 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.9.2.html +406 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.9.3.html +406 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatter_spec.rb +81 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/progress_formatter_spec.rb +30 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/snippet_extractor_spec.rb +18 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +462 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +399 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +406 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.9.3.html +406 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatter_spec.rb +84 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/hooks_filtering_spec.rb +227 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/hooks_spec.rb +143 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/kernel_extensions_spec.rb +9 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/let_spec.rb +55 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/metadata_spec.rb +383 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/option_parser_spec.rb +86 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/pending_example_spec.rb +187 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/rake_task_spec.rb +138 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/reporter_spec.rb +86 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/a_bar.rb +0 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/a_foo.rb +0 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/a_spec.rb +1 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/custom_example_group_runner.rb +14 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/formatter_specs.rb +60 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/utf8_encoded.rb +8 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/rspec_matchers_spec.rb +45 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/ruby_project_spec.rb +24 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/runner_spec.rb +82 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/shared_context_spec.rb +30 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/shared_example_group_spec.rb +84 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/subject_spec.rb +199 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/world_spec.rb +315 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core_spec.rb +31 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/spec_helper.rb +92 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/support/matchers.rb +75 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/support/shared_example_groups.rb +41 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/support/spec_files.rb +44 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/README.md +24 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/README.markdown +49 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/Upgrade.md +53 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/README.md +73 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/be.feature +135 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/be_within.feature +43 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/cover.feature +45 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/equality.feature +145 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/exist.feature +43 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/expect_change.feature +59 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/expect_error.feature +138 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/have.feature +103 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/include.feature +121 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/match.feature +50 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/operators.feature +221 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/predicates.feature +128 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/respond_to.feature +78 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/satisfy.feature +31 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/throw_symbol.feature +85 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/types.feature +114 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/access_running_example.feature +53 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_diffable_matcher.feature +27 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_matcher.feature +340 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_matcher_outside_rspec.feature +38 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_matcher_with_fluent_interface.feature +24 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/customized_message.feature +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/diffing.feature +85 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/implicit_docstrings.feature +52 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/step_definitions/additional_cli_steps.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/support/env.rb +5 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/test_frameworks/test_unit.feature +46 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec-expectations.rb +1 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations.rb +37 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/deprecation.rb +38 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/differ.rb +62 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/errors.rb +9 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions.rb +3 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions/array.rb +9 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions/kernel.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions/object.rb +39 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/fail_with.rb +54 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/handler.rb +50 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/version.rb +8 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers.rb +206 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be.rb +213 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_close.rb +9 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_kind_of.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_within.rb +37 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/block_aliases.rb +19 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/change.rb +197 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/compatibility.rb +14 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/cover.rb +35 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eq.rb +46 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb +41 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/equal.rb +48 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/errors.rb +5 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/exist.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/extensions/instance_eval_with_args.rb +39 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/generated_descriptions.rb +36 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/has.rb +44 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/have.rb +168 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/include.rb +54 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/match.rb +21 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/match_array.rb +71 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/matcher.rb +165 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/method_missing.rb +12 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/operator_matcher.rb +87 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/pretty.rb +37 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/raise_error.rb +130 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/respond_to.rb +85 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/satisfy.rb +51 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/throw_symbol.rb +121 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/differ_spec.rb +96 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/extensions/kernel_spec.rb +45 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/fail_with_spec.rb +70 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/handler_spec.rb +206 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_close_spec.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_instance_of_spec.rb +36 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_kind_of_spec.rb +33 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_spec.rb +452 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_within_spec.rb +64 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/change_spec.rb +522 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/compatibility_spec.rb +28 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/cover_spec.rb +65 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/description_generation_spec.rb +176 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb +25 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb +38 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eql_spec.rb +37 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/equal_spec.rb +57 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/exist_spec.rb +104 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/has_spec.rb +113 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/have_spec.rb +458 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/include_spec.rb +341 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/match_array_spec.rb +108 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/match_spec.rb +57 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/matcher_spec.rb +420 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/matchers_spec.rb +31 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb +23 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/operator_matcher_spec.rb +221 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/raise_error_spec.rb +339 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/respond_to_spec.rb +292 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/satisfy_spec.rb +40 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/throw_symbol_spec.rb +113 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/spec_helper.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/support/classes.rb +56 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/support/matchers.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/support/ruby_version.rb +10 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/README.md +40 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/README.markdown +67 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/Scope.md +17 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/Upgrade.md +22 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/README.md +27 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/explicit.feature +60 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/general_matchers.feature +85 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/type_matchers.feature +25 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/README.md +58 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/any_instance.feature +21 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/block_local_expectations.feature.pending +55 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/expect_message.feature +94 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/receive_counts.feature +209 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/warn_when_expectation_is_set_on_nil.feature +50 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/README.md +43 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/any_instance.feature +133 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/as_null_object.feature +36 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/simple_return_value.feature +64 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/stub_chain.feature +51 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/stub_implementation.feature +26 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/to_ary.feature +47 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/outside_rspec/configuration.feature +82 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/outside_rspec/standalone.feature +32 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/step_definitions/additional_cli_steps.rb +4 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/support/env.rb +6 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks.rb +196 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance.rb +29 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/chain.rb +49 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/expectation_chain.rb +33 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/message_chains.rb +48 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/recorder.rb +168 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/stub_chain.rb +35 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/stub_chain_chain.rb +34 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/argument_expectation.rb +54 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/argument_matchers.rb +227 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/error_generator.rb +97 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/errors.rb +10 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/instance_exec.rb +31 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/marshal.rb +23 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb +23 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/framework.rb +18 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/message_expectation.rb +357 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/method_double.rb +165 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/methods.rb +98 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/mock.rb +79 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/order_group.rb +29 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/proxy.rb +158 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/serialization.rb +28 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/space.rb +28 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/spec_methods.rb +53 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/standalone.rb +3 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/version.rb +7 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/spec/mocks.rb +2 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/and_yield_spec.rb +114 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/any_instance/message_chains_spec.rb +40 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/any_instance_spec.rb +785 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/any_number_of_times_spec.rb +30 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/argument_expectation_spec.rb +37 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/at_least_spec.rb +103 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/at_most_spec.rb +99 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/block_return_value_spec.rb +45 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_10260_spec.rb +8 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_10263_spec.rb +25 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_11545_spec.rb +32 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_496_spec.rb +17 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_600_spec.rb +22 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_7611_spec.rb +16 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_8165_spec.rb +31 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_830_spec.rb +21 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_957_spec.rb +22 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/double_spec.rb +12 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/failing_argument_matchers_spec.rb +95 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/hash_including_matcher_spec.rb +90 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/hash_not_including_matcher_spec.rb +67 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/mock_ordering_spec.rb +94 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/mock_space_spec.rb +54 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/mock_spec.rb +702 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/multiple_return_value_spec.rb +191 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/nil_expectation_warning_spec.rb +62 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/null_object_mock_spec.rb +78 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/once_counts_spec.rb +53 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/options_hash_spec.rb +35 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/partial_mock_spec.rb +156 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb +95 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/passing_argument_matchers_spec.rb +142 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/precise_counts_spec.rb +58 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/record_messages_spec.rb +26 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/serialization_spec.rb +111 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stash_spec.rb +27 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stub_chain_spec.rb +149 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stub_implementation_spec.rb +68 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stub_spec.rb +235 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb +26 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/to_ary_spec.rb +40 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/twice_counts_spec.rb +67 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks_spec.rb +51 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/spec_helper.rb +52 -0
- data/vendor/bundle/specifications/diff-lcs-1.1.3.gemspec +35 -0
- data/vendor/bundle/specifications/httparty-0.8.1.gemspec +34 -0
- data/vendor/bundle/specifications/json-1.6.3.gemspec +39 -0
- data/vendor/bundle/specifications/multi_json-1.0.4.gemspec +40 -0
- data/vendor/bundle/specifications/multi_xml-0.4.1.gemspec +49 -0
- data/vendor/bundle/specifications/rspec-2.7.0.gemspec +38 -0
- data/vendor/bundle/specifications/rspec-core-2.7.1.gemspec +31 -0
- data/vendor/bundle/specifications/rspec-expectations-2.7.0.gemspec +32 -0
- data/vendor/bundle/specifications/rspec-mocks-2.7.0.gemspec +29 -0
- metadata +771 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#ifndef _PARSER_H_
|
|
2
|
+
#define _PARSER_H_
|
|
3
|
+
|
|
4
|
+
#include "ruby.h"
|
|
5
|
+
|
|
6
|
+
#ifndef HAVE_RUBY_RE_H
|
|
7
|
+
#include "re.h"
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
#ifdef HAVE_RUBY_ST_H
|
|
11
|
+
#include "ruby/st.h"
|
|
12
|
+
#else
|
|
13
|
+
#include "st.h"
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
#define option_given_p(opts, key) RTEST(rb_funcall(opts, i_key_p, 1, key))
|
|
17
|
+
|
|
18
|
+
/* unicode */
|
|
19
|
+
|
|
20
|
+
typedef unsigned long UTF32; /* at least 32 bits */
|
|
21
|
+
typedef unsigned short UTF16; /* at least 16 bits */
|
|
22
|
+
typedef unsigned char UTF8; /* typically 8 bits */
|
|
23
|
+
|
|
24
|
+
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
|
|
25
|
+
#define UNI_SUR_HIGH_START (UTF32)0xD800
|
|
26
|
+
#define UNI_SUR_HIGH_END (UTF32)0xDBFF
|
|
27
|
+
#define UNI_SUR_LOW_START (UTF32)0xDC00
|
|
28
|
+
#define UNI_SUR_LOW_END (UTF32)0xDFFF
|
|
29
|
+
|
|
30
|
+
typedef struct JSON_ParserStruct {
|
|
31
|
+
VALUE Vsource;
|
|
32
|
+
char *source;
|
|
33
|
+
long len;
|
|
34
|
+
char *memo;
|
|
35
|
+
VALUE create_id;
|
|
36
|
+
int max_nesting;
|
|
37
|
+
int current_nesting;
|
|
38
|
+
int allow_nan;
|
|
39
|
+
int parsing_name;
|
|
40
|
+
int symbolize_names;
|
|
41
|
+
int quirks_mode;
|
|
42
|
+
VALUE object_class;
|
|
43
|
+
VALUE array_class;
|
|
44
|
+
int create_additions;
|
|
45
|
+
VALUE match_string;
|
|
46
|
+
FBuffer *fbuffer;
|
|
47
|
+
} JSON_Parser;
|
|
48
|
+
|
|
49
|
+
#define GET_PARSER \
|
|
50
|
+
GET_PARSER_INIT; \
|
|
51
|
+
if (!json->Vsource) rb_raise(rb_eTypeError, "uninitialized instance")
|
|
52
|
+
#define GET_PARSER_INIT \
|
|
53
|
+
JSON_Parser *json; \
|
|
54
|
+
Data_Get_Struct(self, JSON_Parser, json)
|
|
55
|
+
|
|
56
|
+
#define MinusInfinity "-Infinity"
|
|
57
|
+
#define EVIL 0x666
|
|
58
|
+
|
|
59
|
+
static UTF32 unescape_unicode(const unsigned char *p);
|
|
60
|
+
static int convert_UTF32_to_UTF8(char *buf, UTF32 ch);
|
|
61
|
+
static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result);
|
|
62
|
+
static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result);
|
|
63
|
+
static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result);
|
|
64
|
+
static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result);
|
|
65
|
+
static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result);
|
|
66
|
+
static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd);
|
|
67
|
+
static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *result);
|
|
68
|
+
static VALUE convert_encoding(VALUE source);
|
|
69
|
+
static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self);
|
|
70
|
+
static VALUE cParser_parse(VALUE self);
|
|
71
|
+
static JSON_Parser *JSON_allocate();
|
|
72
|
+
static void JSON_mark(JSON_Parser *json);
|
|
73
|
+
static void JSON_free(JSON_Parser *json);
|
|
74
|
+
static VALUE cJSON_parser_s_allocate(VALUE klass);
|
|
75
|
+
static VALUE cParser_source(VALUE self);
|
|
76
|
+
|
|
77
|
+
#endif
|
|
Binary file
|
|
@@ -0,0 +1,920 @@
|
|
|
1
|
+
#include "../fbuffer/fbuffer.h"
|
|
2
|
+
#include "parser.h"
|
|
3
|
+
|
|
4
|
+
/* unicode */
|
|
5
|
+
|
|
6
|
+
static const char digit_values[256] = {
|
|
7
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
8
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
9
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1,
|
|
10
|
+
-1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1,
|
|
11
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
12
|
+
10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
13
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
14
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
15
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
16
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
17
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
18
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
19
|
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
20
|
+
-1, -1, -1, -1, -1, -1, -1
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
static UTF32 unescape_unicode(const unsigned char *p)
|
|
24
|
+
{
|
|
25
|
+
char b;
|
|
26
|
+
UTF32 result = 0;
|
|
27
|
+
b = digit_values[p[0]];
|
|
28
|
+
if (b < 0) return UNI_REPLACEMENT_CHAR;
|
|
29
|
+
result = (result << 4) | b;
|
|
30
|
+
b = digit_values[p[1]];
|
|
31
|
+
result = (result << 4) | b;
|
|
32
|
+
if (b < 0) return UNI_REPLACEMENT_CHAR;
|
|
33
|
+
b = digit_values[p[2]];
|
|
34
|
+
result = (result << 4) | b;
|
|
35
|
+
if (b < 0) return UNI_REPLACEMENT_CHAR;
|
|
36
|
+
b = digit_values[p[3]];
|
|
37
|
+
result = (result << 4) | b;
|
|
38
|
+
if (b < 0) return UNI_REPLACEMENT_CHAR;
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static int convert_UTF32_to_UTF8(char *buf, UTF32 ch)
|
|
43
|
+
{
|
|
44
|
+
int len = 1;
|
|
45
|
+
if (ch <= 0x7F) {
|
|
46
|
+
buf[0] = (char) ch;
|
|
47
|
+
} else if (ch <= 0x07FF) {
|
|
48
|
+
buf[0] = (char) ((ch >> 6) | 0xC0);
|
|
49
|
+
buf[1] = (char) ((ch & 0x3F) | 0x80);
|
|
50
|
+
len++;
|
|
51
|
+
} else if (ch <= 0xFFFF) {
|
|
52
|
+
buf[0] = (char) ((ch >> 12) | 0xE0);
|
|
53
|
+
buf[1] = (char) (((ch >> 6) & 0x3F) | 0x80);
|
|
54
|
+
buf[2] = (char) ((ch & 0x3F) | 0x80);
|
|
55
|
+
len += 2;
|
|
56
|
+
} else if (ch <= 0x1fffff) {
|
|
57
|
+
buf[0] =(char) ((ch >> 18) | 0xF0);
|
|
58
|
+
buf[1] =(char) (((ch >> 12) & 0x3F) | 0x80);
|
|
59
|
+
buf[2] =(char) (((ch >> 6) & 0x3F) | 0x80);
|
|
60
|
+
buf[3] =(char) ((ch & 0x3F) | 0x80);
|
|
61
|
+
len += 3;
|
|
62
|
+
} else {
|
|
63
|
+
buf[0] = '?';
|
|
64
|
+
}
|
|
65
|
+
return len;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#ifdef HAVE_RUBY_ENCODING_H
|
|
69
|
+
static VALUE CEncoding_ASCII_8BIT, CEncoding_UTF_8, CEncoding_UTF_16BE,
|
|
70
|
+
CEncoding_UTF_16LE, CEncoding_UTF_32BE, CEncoding_UTF_32LE;
|
|
71
|
+
static ID i_encoding, i_encode;
|
|
72
|
+
#else
|
|
73
|
+
static ID i_iconv;
|
|
74
|
+
#endif
|
|
75
|
+
|
|
76
|
+
static VALUE mJSON, mExt, cParser, eParserError, eNestingError;
|
|
77
|
+
static VALUE CNaN, CInfinity, CMinusInfinity;
|
|
78
|
+
|
|
79
|
+
static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
|
|
80
|
+
i_chr, i_max_nesting, i_allow_nan, i_symbolize_names, i_quirks_mode,
|
|
81
|
+
i_object_class, i_array_class, i_key_p, i_deep_const_get, i_match,
|
|
82
|
+
i_match_string, i_aset, i_leftshift;
|
|
83
|
+
|
|
84
|
+
%%{
|
|
85
|
+
machine JSON_common;
|
|
86
|
+
|
|
87
|
+
cr = '\n';
|
|
88
|
+
cr_neg = [^\n];
|
|
89
|
+
ws = [ \t\r\n];
|
|
90
|
+
c_comment = '/*' ( any* - (any* '*/' any* ) ) '*/';
|
|
91
|
+
cpp_comment = '//' cr_neg* cr;
|
|
92
|
+
comment = c_comment | cpp_comment;
|
|
93
|
+
ignore = ws | comment;
|
|
94
|
+
name_separator = ':';
|
|
95
|
+
value_separator = ',';
|
|
96
|
+
Vnull = 'null';
|
|
97
|
+
Vfalse = 'false';
|
|
98
|
+
Vtrue = 'true';
|
|
99
|
+
VNaN = 'NaN';
|
|
100
|
+
VInfinity = 'Infinity';
|
|
101
|
+
VMinusInfinity = '-Infinity';
|
|
102
|
+
begin_value = [nft\"\-\[\{NI] | digit;
|
|
103
|
+
begin_object = '{';
|
|
104
|
+
end_object = '}';
|
|
105
|
+
begin_array = '[';
|
|
106
|
+
end_array = ']';
|
|
107
|
+
begin_string = '"';
|
|
108
|
+
begin_name = begin_string;
|
|
109
|
+
begin_number = digit | '-';
|
|
110
|
+
}%%
|
|
111
|
+
|
|
112
|
+
%%{
|
|
113
|
+
machine JSON_object;
|
|
114
|
+
include JSON_common;
|
|
115
|
+
|
|
116
|
+
write data;
|
|
117
|
+
|
|
118
|
+
action parse_value {
|
|
119
|
+
VALUE v = Qnil;
|
|
120
|
+
char *np = JSON_parse_value(json, fpc, pe, &v);
|
|
121
|
+
if (np == NULL) {
|
|
122
|
+
fhold; fbreak;
|
|
123
|
+
} else {
|
|
124
|
+
if (NIL_P(json->object_class)) {
|
|
125
|
+
rb_hash_aset(*result, last_name, v);
|
|
126
|
+
} else {
|
|
127
|
+
rb_funcall(*result, i_aset, 2, last_name, v);
|
|
128
|
+
}
|
|
129
|
+
fexec np;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
action parse_name {
|
|
134
|
+
char *np;
|
|
135
|
+
json->parsing_name = 1;
|
|
136
|
+
np = JSON_parse_string(json, fpc, pe, &last_name);
|
|
137
|
+
json->parsing_name = 0;
|
|
138
|
+
if (np == NULL) { fhold; fbreak; } else fexec np;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
action exit { fhold; fbreak; }
|
|
142
|
+
|
|
143
|
+
pair = ignore* begin_name >parse_name ignore* name_separator ignore* begin_value >parse_value;
|
|
144
|
+
next_pair = ignore* value_separator pair;
|
|
145
|
+
|
|
146
|
+
main := (
|
|
147
|
+
begin_object
|
|
148
|
+
(pair (next_pair)*)? ignore*
|
|
149
|
+
end_object
|
|
150
|
+
) @exit;
|
|
151
|
+
}%%
|
|
152
|
+
|
|
153
|
+
static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result)
|
|
154
|
+
{
|
|
155
|
+
int cs = EVIL;
|
|
156
|
+
VALUE last_name = Qnil;
|
|
157
|
+
VALUE object_class = json->object_class;
|
|
158
|
+
|
|
159
|
+
if (json->max_nesting && json->current_nesting > json->max_nesting) {
|
|
160
|
+
rb_raise(eNestingError, "nesting of %d is too deep", json->current_nesting);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
*result = NIL_P(object_class) ? rb_hash_new() : rb_class_new_instance(0, 0, object_class);
|
|
164
|
+
|
|
165
|
+
%% write init;
|
|
166
|
+
%% write exec;
|
|
167
|
+
|
|
168
|
+
if (cs >= JSON_object_first_final) {
|
|
169
|
+
if (json->create_additions) {
|
|
170
|
+
VALUE klassname = rb_hash_aref(*result, json->create_id);
|
|
171
|
+
if (!NIL_P(klassname)) {
|
|
172
|
+
VALUE klass = rb_funcall(mJSON, i_deep_const_get, 1, klassname);
|
|
173
|
+
if (RTEST(rb_funcall(klass, i_json_creatable_p, 0))) {
|
|
174
|
+
*result = rb_funcall(klass, i_json_create, 1, *result);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return p + 1;
|
|
179
|
+
} else {
|
|
180
|
+
return NULL;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
%%{
|
|
186
|
+
machine JSON_value;
|
|
187
|
+
include JSON_common;
|
|
188
|
+
|
|
189
|
+
write data;
|
|
190
|
+
|
|
191
|
+
action parse_null {
|
|
192
|
+
*result = Qnil;
|
|
193
|
+
}
|
|
194
|
+
action parse_false {
|
|
195
|
+
*result = Qfalse;
|
|
196
|
+
}
|
|
197
|
+
action parse_true {
|
|
198
|
+
*result = Qtrue;
|
|
199
|
+
}
|
|
200
|
+
action parse_nan {
|
|
201
|
+
if (json->allow_nan) {
|
|
202
|
+
*result = CNaN;
|
|
203
|
+
} else {
|
|
204
|
+
rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
action parse_infinity {
|
|
208
|
+
if (json->allow_nan) {
|
|
209
|
+
*result = CInfinity;
|
|
210
|
+
} else {
|
|
211
|
+
rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
action parse_string {
|
|
215
|
+
char *np = JSON_parse_string(json, fpc, pe, result);
|
|
216
|
+
if (np == NULL) { fhold; fbreak; } else fexec np;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
action parse_number {
|
|
220
|
+
char *np;
|
|
221
|
+
if(pe > fpc + 9 - json->quirks_mode && !strncmp(MinusInfinity, fpc, 9)) {
|
|
222
|
+
if (json->allow_nan) {
|
|
223
|
+
*result = CMinusInfinity;
|
|
224
|
+
fexec p + 10;
|
|
225
|
+
fhold; fbreak;
|
|
226
|
+
} else {
|
|
227
|
+
rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
np = JSON_parse_float(json, fpc, pe, result);
|
|
231
|
+
if (np != NULL) fexec np;
|
|
232
|
+
np = JSON_parse_integer(json, fpc, pe, result);
|
|
233
|
+
if (np != NULL) fexec np;
|
|
234
|
+
fhold; fbreak;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
action parse_array {
|
|
238
|
+
char *np;
|
|
239
|
+
json->current_nesting++;
|
|
240
|
+
np = JSON_parse_array(json, fpc, pe, result);
|
|
241
|
+
json->current_nesting--;
|
|
242
|
+
if (np == NULL) { fhold; fbreak; } else fexec np;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
action parse_object {
|
|
246
|
+
char *np;
|
|
247
|
+
json->current_nesting++;
|
|
248
|
+
np = JSON_parse_object(json, fpc, pe, result);
|
|
249
|
+
json->current_nesting--;
|
|
250
|
+
if (np == NULL) { fhold; fbreak; } else fexec np;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
action exit { fhold; fbreak; }
|
|
254
|
+
|
|
255
|
+
main := (
|
|
256
|
+
Vnull @parse_null |
|
|
257
|
+
Vfalse @parse_false |
|
|
258
|
+
Vtrue @parse_true |
|
|
259
|
+
VNaN @parse_nan |
|
|
260
|
+
VInfinity @parse_infinity |
|
|
261
|
+
begin_number >parse_number |
|
|
262
|
+
begin_string >parse_string |
|
|
263
|
+
begin_array >parse_array |
|
|
264
|
+
begin_object >parse_object
|
|
265
|
+
) %*exit;
|
|
266
|
+
}%%
|
|
267
|
+
|
|
268
|
+
static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result)
|
|
269
|
+
{
|
|
270
|
+
int cs = EVIL;
|
|
271
|
+
|
|
272
|
+
%% write init;
|
|
273
|
+
%% write exec;
|
|
274
|
+
|
|
275
|
+
if (cs >= JSON_value_first_final) {
|
|
276
|
+
return p;
|
|
277
|
+
} else {
|
|
278
|
+
return NULL;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
%%{
|
|
283
|
+
machine JSON_integer;
|
|
284
|
+
|
|
285
|
+
write data;
|
|
286
|
+
|
|
287
|
+
action exit { fhold; fbreak; }
|
|
288
|
+
|
|
289
|
+
main := '-'? ('0' | [1-9][0-9]*) (^[0-9]? @exit);
|
|
290
|
+
}%%
|
|
291
|
+
|
|
292
|
+
static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result)
|
|
293
|
+
{
|
|
294
|
+
int cs = EVIL;
|
|
295
|
+
|
|
296
|
+
%% write init;
|
|
297
|
+
json->memo = p;
|
|
298
|
+
%% write exec;
|
|
299
|
+
|
|
300
|
+
if (cs >= JSON_integer_first_final) {
|
|
301
|
+
long len = p - json->memo;
|
|
302
|
+
fbuffer_clear(json->fbuffer);
|
|
303
|
+
fbuffer_append(json->fbuffer, json->memo, len);
|
|
304
|
+
fbuffer_append_char(json->fbuffer, '\0');
|
|
305
|
+
*result = rb_cstr2inum(FBUFFER_PTR(json->fbuffer), 10);
|
|
306
|
+
return p + 1;
|
|
307
|
+
} else {
|
|
308
|
+
return NULL;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
%%{
|
|
313
|
+
machine JSON_float;
|
|
314
|
+
include JSON_common;
|
|
315
|
+
|
|
316
|
+
write data;
|
|
317
|
+
|
|
318
|
+
action exit { fhold; fbreak; }
|
|
319
|
+
|
|
320
|
+
main := '-'? (
|
|
321
|
+
(('0' | [1-9][0-9]*) '.' [0-9]+ ([Ee] [+\-]?[0-9]+)?)
|
|
322
|
+
| (('0' | [1-9][0-9]*) ([Ee] [+\-]?[0-9]+))
|
|
323
|
+
) (^[0-9Ee.\-]? @exit );
|
|
324
|
+
}%%
|
|
325
|
+
|
|
326
|
+
static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
|
|
327
|
+
{
|
|
328
|
+
int cs = EVIL;
|
|
329
|
+
|
|
330
|
+
%% write init;
|
|
331
|
+
json->memo = p;
|
|
332
|
+
%% write exec;
|
|
333
|
+
|
|
334
|
+
if (cs >= JSON_float_first_final) {
|
|
335
|
+
long len = p - json->memo;
|
|
336
|
+
fbuffer_clear(json->fbuffer);
|
|
337
|
+
fbuffer_append(json->fbuffer, json->memo, len);
|
|
338
|
+
fbuffer_append_char(json->fbuffer, '\0');
|
|
339
|
+
*result = rb_float_new(rb_cstr_to_dbl(FBUFFER_PTR(json->fbuffer), 1));
|
|
340
|
+
return p + 1;
|
|
341
|
+
} else {
|
|
342
|
+
return NULL;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
%%{
|
|
348
|
+
machine JSON_array;
|
|
349
|
+
include JSON_common;
|
|
350
|
+
|
|
351
|
+
write data;
|
|
352
|
+
|
|
353
|
+
action parse_value {
|
|
354
|
+
VALUE v = Qnil;
|
|
355
|
+
char *np = JSON_parse_value(json, fpc, pe, &v);
|
|
356
|
+
if (np == NULL) {
|
|
357
|
+
fhold; fbreak;
|
|
358
|
+
} else {
|
|
359
|
+
if (NIL_P(json->array_class)) {
|
|
360
|
+
rb_ary_push(*result, v);
|
|
361
|
+
} else {
|
|
362
|
+
rb_funcall(*result, i_leftshift, 1, v);
|
|
363
|
+
}
|
|
364
|
+
fexec np;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
action exit { fhold; fbreak; }
|
|
369
|
+
|
|
370
|
+
next_element = value_separator ignore* begin_value >parse_value;
|
|
371
|
+
|
|
372
|
+
main := begin_array ignore*
|
|
373
|
+
((begin_value >parse_value ignore*)
|
|
374
|
+
(ignore* next_element ignore*)*)?
|
|
375
|
+
end_array @exit;
|
|
376
|
+
}%%
|
|
377
|
+
|
|
378
|
+
static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result)
|
|
379
|
+
{
|
|
380
|
+
int cs = EVIL;
|
|
381
|
+
VALUE array_class = json->array_class;
|
|
382
|
+
|
|
383
|
+
if (json->max_nesting && json->current_nesting > json->max_nesting) {
|
|
384
|
+
rb_raise(eNestingError, "nesting of %d is too deep", json->current_nesting);
|
|
385
|
+
}
|
|
386
|
+
*result = NIL_P(array_class) ? rb_ary_new() : rb_class_new_instance(0, 0, array_class);
|
|
387
|
+
|
|
388
|
+
%% write init;
|
|
389
|
+
%% write exec;
|
|
390
|
+
|
|
391
|
+
if(cs >= JSON_array_first_final) {
|
|
392
|
+
return p + 1;
|
|
393
|
+
} else {
|
|
394
|
+
rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
|
|
395
|
+
return NULL;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
|
|
400
|
+
{
|
|
401
|
+
char *p = string, *pe = string, *unescape;
|
|
402
|
+
int unescape_len;
|
|
403
|
+
|
|
404
|
+
while (pe < stringEnd) {
|
|
405
|
+
if (*pe == '\\') {
|
|
406
|
+
unescape = (char *) "?";
|
|
407
|
+
unescape_len = 1;
|
|
408
|
+
if (pe > p) rb_str_buf_cat(result, p, pe - p);
|
|
409
|
+
switch (*++pe) {
|
|
410
|
+
case 'n':
|
|
411
|
+
unescape = (char *) "\n";
|
|
412
|
+
break;
|
|
413
|
+
case 'r':
|
|
414
|
+
unescape = (char *) "\r";
|
|
415
|
+
break;
|
|
416
|
+
case 't':
|
|
417
|
+
unescape = (char *) "\t";
|
|
418
|
+
break;
|
|
419
|
+
case '"':
|
|
420
|
+
unescape = (char *) "\"";
|
|
421
|
+
break;
|
|
422
|
+
case '\\':
|
|
423
|
+
unescape = (char *) "\\";
|
|
424
|
+
break;
|
|
425
|
+
case 'b':
|
|
426
|
+
unescape = (char *) "\b";
|
|
427
|
+
break;
|
|
428
|
+
case 'f':
|
|
429
|
+
unescape = (char *) "\f";
|
|
430
|
+
break;
|
|
431
|
+
case 'u':
|
|
432
|
+
if (pe > stringEnd - 4) {
|
|
433
|
+
return Qnil;
|
|
434
|
+
} else {
|
|
435
|
+
char buf[4];
|
|
436
|
+
UTF32 ch = unescape_unicode((unsigned char *) ++pe);
|
|
437
|
+
pe += 3;
|
|
438
|
+
if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
|
|
439
|
+
pe++;
|
|
440
|
+
if (pe > stringEnd - 6) return Qnil;
|
|
441
|
+
if (pe[0] == '\\' && pe[1] == 'u') {
|
|
442
|
+
UTF32 sur = unescape_unicode((unsigned char *) pe + 2);
|
|
443
|
+
ch = (((ch & 0x3F) << 10) | ((((ch >> 6) & 0xF) + 1) << 16)
|
|
444
|
+
| (sur & 0x3FF));
|
|
445
|
+
pe += 5;
|
|
446
|
+
} else {
|
|
447
|
+
unescape = (char *) "?";
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
unescape_len = convert_UTF32_to_UTF8(buf, ch);
|
|
452
|
+
unescape = buf;
|
|
453
|
+
}
|
|
454
|
+
break;
|
|
455
|
+
default:
|
|
456
|
+
p = pe;
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
rb_str_buf_cat(result, unescape, unescape_len);
|
|
460
|
+
p = ++pe;
|
|
461
|
+
} else {
|
|
462
|
+
pe++;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
rb_str_buf_cat(result, p, pe - p);
|
|
466
|
+
return result;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
%%{
|
|
470
|
+
machine JSON_string;
|
|
471
|
+
include JSON_common;
|
|
472
|
+
|
|
473
|
+
write data;
|
|
474
|
+
|
|
475
|
+
action parse_string {
|
|
476
|
+
*result = json_string_unescape(*result, json->memo + 1, p);
|
|
477
|
+
if (NIL_P(*result)) {
|
|
478
|
+
fhold;
|
|
479
|
+
fbreak;
|
|
480
|
+
} else {
|
|
481
|
+
FORCE_UTF8(*result);
|
|
482
|
+
fexec p + 1;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
action exit { fhold; fbreak; }
|
|
487
|
+
|
|
488
|
+
main := '"' ((^([\"\\] | 0..0x1f) | '\\'[\"\\/bfnrt] | '\\u'[0-9a-fA-F]{4} | '\\'^([\"\\/bfnrtu]|0..0x1f))* %parse_string) '"' @exit;
|
|
489
|
+
}%%
|
|
490
|
+
|
|
491
|
+
static int
|
|
492
|
+
match_i(VALUE regexp, VALUE klass, VALUE memo)
|
|
493
|
+
{
|
|
494
|
+
if (regexp == Qundef) return ST_STOP;
|
|
495
|
+
if (RTEST(rb_funcall(klass, i_json_creatable_p, 0)) &&
|
|
496
|
+
RTEST(rb_funcall(regexp, i_match, 1, rb_ary_entry(memo, 0)))) {
|
|
497
|
+
rb_ary_push(memo, klass);
|
|
498
|
+
return ST_STOP;
|
|
499
|
+
}
|
|
500
|
+
return ST_CONTINUE;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *result)
|
|
504
|
+
{
|
|
505
|
+
int cs = EVIL;
|
|
506
|
+
VALUE match_string;
|
|
507
|
+
|
|
508
|
+
*result = rb_str_buf_new(0);
|
|
509
|
+
%% write init;
|
|
510
|
+
json->memo = p;
|
|
511
|
+
%% write exec;
|
|
512
|
+
|
|
513
|
+
if (json->create_additions && RTEST(match_string = json->match_string)) {
|
|
514
|
+
VALUE klass;
|
|
515
|
+
VALUE memo = rb_ary_new2(2);
|
|
516
|
+
rb_ary_push(memo, *result);
|
|
517
|
+
rb_hash_foreach(match_string, match_i, memo);
|
|
518
|
+
klass = rb_ary_entry(memo, 1);
|
|
519
|
+
if (RTEST(klass)) {
|
|
520
|
+
*result = rb_funcall(klass, i_json_create, 1, *result);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
if (json->symbolize_names && json->parsing_name) {
|
|
525
|
+
*result = rb_str_intern(*result);
|
|
526
|
+
}
|
|
527
|
+
if (cs >= JSON_string_first_final) {
|
|
528
|
+
return p + 1;
|
|
529
|
+
} else {
|
|
530
|
+
return NULL;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/*
|
|
535
|
+
* Document-class: JSON::Ext::Parser
|
|
536
|
+
*
|
|
537
|
+
* This is the JSON parser implemented as a C extension. It can be configured
|
|
538
|
+
* to be used by setting
|
|
539
|
+
*
|
|
540
|
+
* JSON.parser = JSON::Ext::Parser
|
|
541
|
+
*
|
|
542
|
+
* with the method parser= in JSON.
|
|
543
|
+
*
|
|
544
|
+
*/
|
|
545
|
+
|
|
546
|
+
static VALUE convert_encoding(VALUE source)
|
|
547
|
+
{
|
|
548
|
+
char *ptr = RSTRING_PTR(source);
|
|
549
|
+
long len = RSTRING_LEN(source);
|
|
550
|
+
if (len < 2) {
|
|
551
|
+
rb_raise(eParserError, "A JSON text must at least contain two octets!");
|
|
552
|
+
}
|
|
553
|
+
#ifdef HAVE_RUBY_ENCODING_H
|
|
554
|
+
{
|
|
555
|
+
VALUE encoding = rb_funcall(source, i_encoding, 0);
|
|
556
|
+
if (encoding == CEncoding_ASCII_8BIT) {
|
|
557
|
+
if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
|
|
558
|
+
source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_32BE);
|
|
559
|
+
} else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
|
|
560
|
+
source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16BE);
|
|
561
|
+
} else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
|
|
562
|
+
source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_32LE);
|
|
563
|
+
} else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
|
|
564
|
+
source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16LE);
|
|
565
|
+
} else {
|
|
566
|
+
source = rb_str_dup(source);
|
|
567
|
+
FORCE_UTF8(source);
|
|
568
|
+
}
|
|
569
|
+
} else {
|
|
570
|
+
source = rb_funcall(source, i_encode, 1, CEncoding_UTF_8);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
#else
|
|
574
|
+
if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
|
|
575
|
+
source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-32be"), source);
|
|
576
|
+
} else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
|
|
577
|
+
source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-16be"), source);
|
|
578
|
+
} else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
|
|
579
|
+
source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-32le"), source);
|
|
580
|
+
} else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
|
|
581
|
+
source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-16le"), source);
|
|
582
|
+
}
|
|
583
|
+
#endif
|
|
584
|
+
return source;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/*
|
|
588
|
+
* call-seq: new(source, opts => {})
|
|
589
|
+
*
|
|
590
|
+
* Creates a new JSON::Ext::Parser instance for the string _source_.
|
|
591
|
+
*
|
|
592
|
+
* Creates a new JSON::Ext::Parser instance for the string _source_.
|
|
593
|
+
*
|
|
594
|
+
* It will be configured by the _opts_ hash. _opts_ can have the following
|
|
595
|
+
* keys:
|
|
596
|
+
*
|
|
597
|
+
* _opts_ can have the following keys:
|
|
598
|
+
* * *max_nesting*: The maximum depth of nesting allowed in the parsed data
|
|
599
|
+
* structures. Disable depth checking with :max_nesting => false|nil|0, it
|
|
600
|
+
* defaults to 19.
|
|
601
|
+
* * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
|
|
602
|
+
* defiance of RFC 4627 to be parsed by the Parser. This option defaults to
|
|
603
|
+
* false.
|
|
604
|
+
* * *symbolize_names*: If set to true, returns symbols for the names
|
|
605
|
+
* (keys) in a JSON object. Otherwise strings are returned, which is also
|
|
606
|
+
* the default.
|
|
607
|
+
* * *create_additions*: If set to false, the Parser doesn't create
|
|
608
|
+
* additions even if a matchin class and create_id was found. This option
|
|
609
|
+
* defaults to true.
|
|
610
|
+
* * *object_class*: Defaults to Hash
|
|
611
|
+
* * *array_class*: Defaults to Array
|
|
612
|
+
*/
|
|
613
|
+
static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
|
|
614
|
+
{
|
|
615
|
+
VALUE source, opts;
|
|
616
|
+
GET_PARSER_INIT;
|
|
617
|
+
|
|
618
|
+
if (json->Vsource) {
|
|
619
|
+
rb_raise(rb_eTypeError, "already initialized instance");
|
|
620
|
+
}
|
|
621
|
+
rb_scan_args(argc, argv, "11", &source, &opts);
|
|
622
|
+
if (!NIL_P(opts)) {
|
|
623
|
+
opts = rb_convert_type(opts, T_HASH, "Hash", "to_hash");
|
|
624
|
+
if (NIL_P(opts)) {
|
|
625
|
+
rb_raise(rb_eArgError, "opts needs to be like a hash");
|
|
626
|
+
} else {
|
|
627
|
+
VALUE tmp = ID2SYM(i_max_nesting);
|
|
628
|
+
if (option_given_p(opts, tmp)) {
|
|
629
|
+
VALUE max_nesting = rb_hash_aref(opts, tmp);
|
|
630
|
+
if (RTEST(max_nesting)) {
|
|
631
|
+
Check_Type(max_nesting, T_FIXNUM);
|
|
632
|
+
json->max_nesting = FIX2INT(max_nesting);
|
|
633
|
+
} else {
|
|
634
|
+
json->max_nesting = 0;
|
|
635
|
+
}
|
|
636
|
+
} else {
|
|
637
|
+
json->max_nesting = 19;
|
|
638
|
+
}
|
|
639
|
+
tmp = ID2SYM(i_allow_nan);
|
|
640
|
+
if (option_given_p(opts, tmp)) {
|
|
641
|
+
json->allow_nan = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
|
642
|
+
} else {
|
|
643
|
+
json->allow_nan = 0;
|
|
644
|
+
}
|
|
645
|
+
tmp = ID2SYM(i_symbolize_names);
|
|
646
|
+
if (option_given_p(opts, tmp)) {
|
|
647
|
+
json->symbolize_names = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
|
|
648
|
+
} else {
|
|
649
|
+
json->symbolize_names = 0;
|
|
650
|
+
}
|
|
651
|
+
tmp = ID2SYM(i_quirks_mode);
|
|
652
|
+
if (option_given_p(opts, tmp)) {
|
|
653
|
+
VALUE quirks_mode = rb_hash_aref(opts, tmp);
|
|
654
|
+
json->quirks_mode = RTEST(quirks_mode) ? 1 : 0;
|
|
655
|
+
} else {
|
|
656
|
+
json->quirks_mode = 0;
|
|
657
|
+
}
|
|
658
|
+
tmp = ID2SYM(i_create_additions);
|
|
659
|
+
if (option_given_p(opts, tmp)) {
|
|
660
|
+
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
|
|
661
|
+
} else {
|
|
662
|
+
json->create_additions = 1;
|
|
663
|
+
}
|
|
664
|
+
tmp = ID2SYM(i_create_id);
|
|
665
|
+
if (option_given_p(opts, tmp)) {
|
|
666
|
+
json->create_id = rb_hash_aref(opts, tmp);
|
|
667
|
+
} else {
|
|
668
|
+
json->create_id = rb_funcall(mJSON, i_create_id, 0);
|
|
669
|
+
}
|
|
670
|
+
tmp = ID2SYM(i_object_class);
|
|
671
|
+
if (option_given_p(opts, tmp)) {
|
|
672
|
+
json->object_class = rb_hash_aref(opts, tmp);
|
|
673
|
+
} else {
|
|
674
|
+
json->object_class = Qnil;
|
|
675
|
+
}
|
|
676
|
+
tmp = ID2SYM(i_array_class);
|
|
677
|
+
if (option_given_p(opts, tmp)) {
|
|
678
|
+
json->array_class = rb_hash_aref(opts, tmp);
|
|
679
|
+
} else {
|
|
680
|
+
json->array_class = Qnil;
|
|
681
|
+
}
|
|
682
|
+
tmp = ID2SYM(i_match_string);
|
|
683
|
+
if (option_given_p(opts, tmp)) {
|
|
684
|
+
VALUE match_string = rb_hash_aref(opts, tmp);
|
|
685
|
+
json->match_string = RTEST(match_string) ? match_string : Qnil;
|
|
686
|
+
} else {
|
|
687
|
+
json->match_string = Qnil;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
} else {
|
|
691
|
+
json->max_nesting = 19;
|
|
692
|
+
json->allow_nan = 0;
|
|
693
|
+
json->create_additions = 1;
|
|
694
|
+
json->create_id = rb_funcall(mJSON, i_create_id, 0);
|
|
695
|
+
json->object_class = Qnil;
|
|
696
|
+
json->array_class = Qnil;
|
|
697
|
+
}
|
|
698
|
+
source = rb_convert_type(source, T_STRING, "String", "to_str");
|
|
699
|
+
if (!json->quirks_mode) {
|
|
700
|
+
source = convert_encoding(StringValue(source));
|
|
701
|
+
}
|
|
702
|
+
json->current_nesting = 0;
|
|
703
|
+
json->len = RSTRING_LEN(source);
|
|
704
|
+
json->source = RSTRING_PTR(source);;
|
|
705
|
+
json->Vsource = source;
|
|
706
|
+
return self;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
%%{
|
|
710
|
+
machine JSON;
|
|
711
|
+
|
|
712
|
+
write data;
|
|
713
|
+
|
|
714
|
+
include JSON_common;
|
|
715
|
+
|
|
716
|
+
action parse_object {
|
|
717
|
+
char *np;
|
|
718
|
+
json->current_nesting = 1;
|
|
719
|
+
np = JSON_parse_object(json, fpc, pe, &result);
|
|
720
|
+
if (np == NULL) { fhold; fbreak; } else fexec np;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
action parse_array {
|
|
724
|
+
char *np;
|
|
725
|
+
json->current_nesting = 1;
|
|
726
|
+
np = JSON_parse_array(json, fpc, pe, &result);
|
|
727
|
+
if (np == NULL) { fhold; fbreak; } else fexec np;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
main := ignore* (
|
|
731
|
+
begin_object >parse_object |
|
|
732
|
+
begin_array >parse_array
|
|
733
|
+
) ignore*;
|
|
734
|
+
}%%
|
|
735
|
+
|
|
736
|
+
static VALUE cParser_parse_strict(VALUE self)
|
|
737
|
+
{
|
|
738
|
+
char *p, *pe;
|
|
739
|
+
int cs = EVIL;
|
|
740
|
+
VALUE result = Qnil;
|
|
741
|
+
GET_PARSER;
|
|
742
|
+
|
|
743
|
+
%% write init;
|
|
744
|
+
p = json->source;
|
|
745
|
+
pe = p + json->len;
|
|
746
|
+
%% write exec;
|
|
747
|
+
|
|
748
|
+
if (cs >= JSON_first_final && p == pe) {
|
|
749
|
+
return result;
|
|
750
|
+
} else {
|
|
751
|
+
rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
|
|
752
|
+
return Qnil;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
%%{
|
|
758
|
+
machine JSON_quirks_mode;
|
|
759
|
+
|
|
760
|
+
write data;
|
|
761
|
+
|
|
762
|
+
include JSON_common;
|
|
763
|
+
|
|
764
|
+
action parse_value {
|
|
765
|
+
char *np = JSON_parse_value(json, fpc, pe, &result);
|
|
766
|
+
if (np == NULL) { fhold; fbreak; } else fexec np;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
main := ignore* (
|
|
770
|
+
begin_value >parse_value
|
|
771
|
+
) ignore*;
|
|
772
|
+
}%%
|
|
773
|
+
|
|
774
|
+
static VALUE cParser_parse_quirks_mode(VALUE self)
|
|
775
|
+
{
|
|
776
|
+
char *p, *pe;
|
|
777
|
+
int cs = EVIL;
|
|
778
|
+
VALUE result = Qnil;
|
|
779
|
+
GET_PARSER;
|
|
780
|
+
|
|
781
|
+
%% write init;
|
|
782
|
+
p = json->source;
|
|
783
|
+
pe = p + json->len;
|
|
784
|
+
%% write exec;
|
|
785
|
+
|
|
786
|
+
if (cs >= JSON_quirks_mode_first_final && p == pe) {
|
|
787
|
+
return result;
|
|
788
|
+
} else {
|
|
789
|
+
rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
|
|
790
|
+
return Qnil;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/*
|
|
795
|
+
* call-seq: parse()
|
|
796
|
+
*
|
|
797
|
+
* Parses the current JSON text _source_ and returns the complete data
|
|
798
|
+
* structure as a result.
|
|
799
|
+
*/
|
|
800
|
+
static VALUE cParser_parse(VALUE self)
|
|
801
|
+
{
|
|
802
|
+
GET_PARSER;
|
|
803
|
+
|
|
804
|
+
if (json->quirks_mode) {
|
|
805
|
+
return cParser_parse_quirks_mode(self);
|
|
806
|
+
} else {
|
|
807
|
+
return cParser_parse_strict(self);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
static JSON_Parser *JSON_allocate()
|
|
813
|
+
{
|
|
814
|
+
JSON_Parser *json = ALLOC(JSON_Parser);
|
|
815
|
+
MEMZERO(json, JSON_Parser, 1);
|
|
816
|
+
json->fbuffer = fbuffer_alloc(0);
|
|
817
|
+
return json;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
static void JSON_mark(JSON_Parser *json)
|
|
821
|
+
{
|
|
822
|
+
rb_gc_mark_maybe(json->Vsource);
|
|
823
|
+
rb_gc_mark_maybe(json->create_id);
|
|
824
|
+
rb_gc_mark_maybe(json->object_class);
|
|
825
|
+
rb_gc_mark_maybe(json->array_class);
|
|
826
|
+
rb_gc_mark_maybe(json->match_string);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
static void JSON_free(JSON_Parser *json)
|
|
830
|
+
{
|
|
831
|
+
fbuffer_free(json->fbuffer);
|
|
832
|
+
ruby_xfree(json);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
static VALUE cJSON_parser_s_allocate(VALUE klass)
|
|
836
|
+
{
|
|
837
|
+
JSON_Parser *json = JSON_allocate();
|
|
838
|
+
return Data_Wrap_Struct(klass, JSON_mark, JSON_free, json);
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/*
|
|
842
|
+
* call-seq: source()
|
|
843
|
+
*
|
|
844
|
+
* Returns a copy of the current _source_ string, that was used to construct
|
|
845
|
+
* this Parser.
|
|
846
|
+
*/
|
|
847
|
+
static VALUE cParser_source(VALUE self)
|
|
848
|
+
{
|
|
849
|
+
GET_PARSER;
|
|
850
|
+
return rb_str_dup(json->Vsource);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
/*
|
|
854
|
+
* call-seq: quirks_mode?()
|
|
855
|
+
*
|
|
856
|
+
* Returns a true, if this parser is in quirks_mode, false otherwise.
|
|
857
|
+
*/
|
|
858
|
+
static VALUE cParser_quirks_mode_p(VALUE self)
|
|
859
|
+
{
|
|
860
|
+
GET_PARSER;
|
|
861
|
+
return json->quirks_mode ? Qtrue : Qfalse;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
void Init_parser()
|
|
866
|
+
{
|
|
867
|
+
rb_require("json/common");
|
|
868
|
+
mJSON = rb_define_module("JSON");
|
|
869
|
+
mExt = rb_define_module_under(mJSON, "Ext");
|
|
870
|
+
cParser = rb_define_class_under(mExt, "Parser", rb_cObject);
|
|
871
|
+
eParserError = rb_path2class("JSON::ParserError");
|
|
872
|
+
eNestingError = rb_path2class("JSON::NestingError");
|
|
873
|
+
rb_define_alloc_func(cParser, cJSON_parser_s_allocate);
|
|
874
|
+
rb_define_method(cParser, "initialize", cParser_initialize, -1);
|
|
875
|
+
rb_define_method(cParser, "parse", cParser_parse, 0);
|
|
876
|
+
rb_define_method(cParser, "source", cParser_source, 0);
|
|
877
|
+
rb_define_method(cParser, "quirks_mode?", cParser_quirks_mode_p, 0);
|
|
878
|
+
|
|
879
|
+
CNaN = rb_const_get(mJSON, rb_intern("NaN"));
|
|
880
|
+
CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
|
|
881
|
+
CMinusInfinity = rb_const_get(mJSON, rb_intern("MinusInfinity"));
|
|
882
|
+
|
|
883
|
+
i_json_creatable_p = rb_intern("json_creatable?");
|
|
884
|
+
i_json_create = rb_intern("json_create");
|
|
885
|
+
i_create_id = rb_intern("create_id");
|
|
886
|
+
i_create_additions = rb_intern("create_additions");
|
|
887
|
+
i_chr = rb_intern("chr");
|
|
888
|
+
i_max_nesting = rb_intern("max_nesting");
|
|
889
|
+
i_allow_nan = rb_intern("allow_nan");
|
|
890
|
+
i_symbolize_names = rb_intern("symbolize_names");
|
|
891
|
+
i_quirks_mode = rb_intern("quirks_mode");
|
|
892
|
+
i_object_class = rb_intern("object_class");
|
|
893
|
+
i_array_class = rb_intern("array_class");
|
|
894
|
+
i_match = rb_intern("match");
|
|
895
|
+
i_match_string = rb_intern("match_string");
|
|
896
|
+
i_key_p = rb_intern("key?");
|
|
897
|
+
i_deep_const_get = rb_intern("deep_const_get");
|
|
898
|
+
i_aset = rb_intern("[]=");
|
|
899
|
+
i_leftshift = rb_intern("<<");
|
|
900
|
+
#ifdef HAVE_RUBY_ENCODING_H
|
|
901
|
+
CEncoding_UTF_8 = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-8"));
|
|
902
|
+
CEncoding_UTF_16BE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-16be"));
|
|
903
|
+
CEncoding_UTF_16LE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-16le"));
|
|
904
|
+
CEncoding_UTF_32BE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-32be"));
|
|
905
|
+
CEncoding_UTF_32LE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-32le"));
|
|
906
|
+
CEncoding_ASCII_8BIT = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("ascii-8bit"));
|
|
907
|
+
i_encoding = rb_intern("encoding");
|
|
908
|
+
i_encode = rb_intern("encode");
|
|
909
|
+
#else
|
|
910
|
+
i_iconv = rb_intern("iconv");
|
|
911
|
+
#endif
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/*
|
|
915
|
+
* Local variables:
|
|
916
|
+
* mode: c
|
|
917
|
+
* c-file-style: ruby
|
|
918
|
+
* indent-tabs-mode: nil
|
|
919
|
+
* End:
|
|
920
|
+
*/
|