cli-nasa 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.DS_Store +0 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +6 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +38 -0
- data/LICENSE.txt +21 -0
- data/README.md +56 -0
- data/Rakefile +6 -0
- data/bin/run_me +10 -0
- data/cli-nasa.gemspec +28 -0
- data/config/environment.rb +5 -0
- data/lib/models/content.rb +28 -0
- data/lib/services/cli.rb +202 -0
- data/lib/services/cli_nasa_API.rb +28 -0
- data/lib/services/version.rb +4 -0
- data/vendor/bundle/ruby/2.7.0/bin/htmldiff +27 -0
- data/vendor/bundle/ruby/2.7.0/bin/httparty +27 -0
- data/vendor/bundle/ruby/2.7.0/bin/ldiff +27 -0
- data/vendor/bundle/ruby/2.7.0/bin/rake +27 -0
- data/vendor/bundle/ruby/2.7.0/bin/rspec +27 -0
- data/vendor/bundle/ruby/2.7.0/bin/ruby_executable_hooks +25 -0
- data/vendor/bundle/ruby/2.7.0/cache/diff-lcs-1.4.4.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/httparty-0.18.1.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/json-2.3.1.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/mime-types-3.3.1.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/mime-types-data-3.2020.0512.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/multi_xml-0.6.0.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/rake-12.3.3.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/rspec-3.9.0.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/rspec-core-3.9.2.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/rspec-expectations-3.9.2.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/rspec-mocks-3.9.1.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/cache/rspec-support-3.9.3.gem +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-18/2.7.0/json-2.3.1/gem.build_complete +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-18/2.7.0/json-2.3.1/gem_make.out +13 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-18/2.7.0/json-2.3.1/json/ext/generator.bundle +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-18/2.7.0/json-2.3.1/json/ext/parser.bundle +0 -0
- data/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-18/2.7.0/json-2.3.1/mkmf.log +62 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/.rspec +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/Code-of-Conduct.md +74 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/Contributing.md +118 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/History.md +319 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/License.md +39 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/Manifest.txt +45 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/README.rdoc +84 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/Rakefile +74 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/autotest/discover.rb +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/bin/htmldiff +35 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/bin/ldiff +9 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/docs/COPYING.txt +339 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/docs/artistic.txt +127 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff-lcs.rb +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs.rb +739 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs/array.rb +7 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs/backports.rb +9 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs/block.rb +37 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs/callbacks.rb +325 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs/change.rb +174 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs/htmldiff.rb +150 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs/hunk.rb +358 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs/internals.rb +304 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs/ldiff.rb +171 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/lib/diff/lcs/string.rb +5 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/change_spec.rb +89 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/diff_spec.rb +51 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/fixtures/aX +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/fixtures/bXaX +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/fixtures/ds1.csv +50 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/fixtures/ds2.csv +51 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/fixtures/ldiff/output.diff +4 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/fixtures/ldiff/output.diff-c +7 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/fixtures/ldiff/output.diff-e +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/fixtures/ldiff/output.diff-f +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/fixtures/ldiff/output.diff-u +5 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/hunk_spec.rb +83 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/issues_spec.rb +154 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/lcs_spec.rb +56 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/ldiff_spec.rb +87 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/patch_spec.rb +416 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/sdiff_spec.rb +214 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/spec_helper.rb +375 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/traverse_balanced_spec.rb +310 -0
- data/vendor/bundle/ruby/2.7.0/gems/diff-lcs-1.4.4/spec/traverse_sequences_spec.rb +139 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/.editorconfig +18 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/.gitignore +13 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/.rubocop.yml +92 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/.rubocop_todo.yml +124 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/.simplecov +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/.travis.yml +11 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/CONTRIBUTING.md +23 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/Changelog.md +530 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/Gemfile +24 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/Guardfile +16 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/README.md +81 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/Rakefile +10 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/bin/httparty +123 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/cucumber.yml +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/docs/README.md +106 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/README.md +86 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/aaws.rb +32 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/basic.rb +28 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/body_stream.rb +14 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/crack.rb +19 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/custom_parsers.rb +68 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/delicious.rb +37 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/google.rb +16 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/headers_and_user_agents.rb +10 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/logging.rb +36 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/microsoft_graph.rb +52 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/multipart.rb +22 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/nokogiri_html_parser.rb +19 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/peer_cert.rb +9 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/rescue_json.rb +17 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/rubyurl.rb +14 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/stackexchange.rb +24 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/stream_download.rb +26 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/tripit_sign_in.rb +44 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/twitter.rb +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/examples/whoismyrep.rb +10 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/httparty.gemspec +30 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty.rb +668 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/connection_adapter.rb +254 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/cookie_hash.rb +21 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/exceptions.rb +33 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/hash_conversions.rb +69 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/headers_processor.rb +30 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/logger/apache_formatter.rb +45 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/logger/curl_formatter.rb +91 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/logger/logger.rb +28 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/logger/logstash_formatter.rb +59 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/module_inheritable_attributes.rb +56 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/net_digest_auth.rb +136 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/parser.rb +150 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/request.rb +379 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/request/body.rb +84 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/request/multipart_boundary.rb +11 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response.rb +154 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response/headers.rb +33 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/response_fragment.rb +19 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/text_encoder.rb +70 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/utils.rb +11 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/lib/httparty/version.rb +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/script/release +42 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/website/css/common.css +47 -0
- data/vendor/bundle/ruby/2.7.0/gems/httparty-0.18.1/website/index.html +73 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/.gitignore +18 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/.travis.yml +26 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/CHANGES.md +424 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/Gemfile +14 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/README-json-jruby.md +33 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/README.md +425 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/Rakefile +334 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/VERSION +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/diagrams/.keep +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/fbuffer/fbuffer.h +187 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/generator/.sitearchdir.-.json.-.ext.time +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/generator/depend +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/generator/extconf.rb +4 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/generator/generator.c +1569 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/generator/generator.h +171 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/parser/.sitearchdir.-.json.-.ext.time +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/parser/depend +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/parser/extconf.rb +6 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/parser/parser.c +2137 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/parser/parser.h +91 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/ext/parser/parser.rl +897 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/ext/json/extconf.rb +2 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/install.rb +23 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/ByteListTranscoder.java +166 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/Generator.java +466 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/GeneratorMethods.java +231 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/GeneratorService.java +42 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/GeneratorState.java +490 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/OptionsReader.java +113 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/Parser.java +2362 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/Parser.rl +893 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/ParserService.java +34 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/RuntimeInfo.java +116 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/StringDecoder.java +166 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/StringEncoder.java +111 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/Utils.java +88 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/json-java.gemspec +37 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/json.gemspec +139 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/json_pure.gemspec +33 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json.rb +412 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/bigdecimal.rb +29 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/complex.rb +29 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/core.rb +12 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/date.rb +34 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/date_time.rb +50 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/exception.rb +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/ostruct.rb +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/range.rb +29 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/rational.rb +28 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/regexp.rb +30 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/set.rb +29 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/struct.rb +30 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/symbol.rb +25 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/add/time.rb +38 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/common.rb +691 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/ext.rb +15 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/ext/.keep +0 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/generic_object.rb +71 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/pure.rb +15 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/pure/generator.rb +459 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/pure/parser.rb +319 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/lib/json/version.rb +9 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/references/rfc7159.txt +899 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail10.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail11.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail12.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail13.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail14.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail18.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail19.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail2.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail20.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail21.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail22.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail23.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail24.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail25.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail27.json +2 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail28.json +2 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail3.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail4.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail5.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail6.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail7.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail8.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/fail9.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/obsolete_fail1.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/pass1.json +56 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/pass15.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/pass16.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/pass17.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/pass2.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/pass26.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/fixtures/pass3.json +6 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/json_addition_test.rb +203 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/json_common_interface_test.rb +126 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/json_encoding_test.rb +107 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/json_ext_parser_test.rb +15 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/json_fixtures_test.rb +37 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/json_generator_test.rb +421 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/json_generic_object_test.rb +82 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/json_parser_test.rb +472 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/json_string_matching_test.rb +38 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tests/test_helper.rb +17 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tools/diff.sh +18 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tools/fuzz.rb +131 -0
- data/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/tools/server.rb +62 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/Code-of-Conduct.md +73 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/Contributing.md +143 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/History.md +240 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/Licence.md +25 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/Manifest.txt +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/README.rdoc +193 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/Rakefile +284 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime-types.rb +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/type.rb +587 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/type/columnar.rb +57 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/types.rb +231 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/types/_columnar.rb +136 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/types/cache.rb +58 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/types/columnar.rb +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/types/container.rb +96 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/types/deprecations.rb +32 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/types/full.rb +19 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/types/loader.rb +146 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/types/logger.rb +39 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/lib/mime/types/registry.rb +90 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/bad-fixtures/malformed +9 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/fixture/json.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/fixture/old-data +9 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/fixture/yaml.yaml +55 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/minitest_helper.rb +13 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/test_mime_type.rb +610 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/test_mime_types.rb +169 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/test_mime_types_cache.rb +118 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/test_mime_types_class.rb +159 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/test_mime_types_lazy.rb +49 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-3.3.1/test/test_mime_types_loader.rb +32 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/Code-of-Conduct.md +75 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/Contributing.md +163 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/History.md +436 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/Licence.md +25 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/Manifest.txt +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/README.md +63 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/Rakefile +94 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/data/mime-types.json +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/data/mime.content_type.column +2277 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/data/mime.docs.column +2277 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/data/mime.encoding.column +2277 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/data/mime.flags.column +2277 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/data/mime.friendly.column +2277 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/data/mime.pext.column +2277 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/data/mime.use_instead.column +2277 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/data/mime.xrefs.column +2277 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/lib/mime-types-data.rb +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/lib/mime/types/data.rb +21 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/application.yaml +16703 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/audio.yaml +1679 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/chemical.yaml +71 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/conference.yaml +9 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/drawing.yaml +15 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/font.yaml +65 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/image.yaml +1217 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/message.yaml +200 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/model.yaml +322 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/multipart.yaml +179 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/text.yaml +1075 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/video.yaml +1070 -0
- data/vendor/bundle/ruby/2.7.0/gems/mime-types-data-3.2020.0512/types/world.yaml +8 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/.yardopts +8 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/CHANGELOG.md +93 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/CONTRIBUTING.md +51 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/LICENSE.md +20 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/README.md +95 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/lib/multi_xml.rb +305 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/lib/multi_xml/parsers/libxml.rb +33 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/lib/multi_xml/parsers/libxml2_parser.rb +72 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/lib/multi_xml/parsers/nokogiri.rb +35 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/lib/multi_xml/parsers/oga.rb +73 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/lib/multi_xml/parsers/ox.rb +91 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/lib/multi_xml/parsers/rexml.rb +113 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/lib/multi_xml/version.rb +45 -0
- data/vendor/bundle/ruby/2.7.0/gems/multi_xml-0.6.0/multi_xml.gemspec +19 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/CONTRIBUTING.rdoc +43 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/Gemfile +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/History.rdoc +2344 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/README.rdoc +156 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/Rakefile +41 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/azure-pipelines.yml +11 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/bin/bundle +105 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/bin/console +7 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/bin/rake +29 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/bin/rdoc +29 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/bin/rubocop +29 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/bin/setup +6 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/command_line_usage.rdoc +158 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/glossary.rdoc +42 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/jamis.rb +592 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/rake.1 +156 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/rakefile.rdoc +622 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/exe/rake +27 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake.rb +71 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/application.rb +824 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/backtrace.rb +24 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/clean.rb +78 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/cloneable.rb +17 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/cpu_counter.rb +107 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/default_loader.rb +15 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/dsl_definition.rb +195 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/early_time.rb +22 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/ext/core.rb +26 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/ext/string.rb +176 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/file_creation_task.rb +25 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/file_list.rb +435 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/file_task.rb +54 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/file_utils.rb +137 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/file_utils_ext.rb +145 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/invocation_chain.rb +57 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/invocation_exception_mixin.rb +17 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/late_time.rb +18 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/linked_list.rb +112 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/loaders/makefile.rb +54 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/multi_task.rb +14 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/name_space.rb +38 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/packagetask.rb +207 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/phony.rb +16 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/private_reader.rb +21 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/promise.rb +100 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/pseudo_status.rb +30 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/rake_module.rb +67 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/rake_test_loader.rb +27 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/scope.rb +43 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/task.rb +413 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/task_argument_error.rb +8 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/task_arguments.rb +109 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/task_manager.rb +324 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/tasklib.rb +12 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/testtask.rb +224 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/thread_history_display.rb +49 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/thread_pool.rb +163 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/trace_output.rb +23 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/version.rb +10 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/lib/rake/win32.rb +51 -0
- data/vendor/bundle/ruby/2.7.0/gems/rake-12.3.3/rake.gemspec +42 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-3.9.0/LICENSE.md +27 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-3.9.0/README.md +43 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-3.9.0/lib/rspec.rb +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-3.9.0/lib/rspec/version.rb +5 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/.document +5 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/.yardopts +8 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/Changelog.md +2291 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/LICENSE.md +26 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/README.md +384 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/exe/rspec +4 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/autorun.rb +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core.rb +186 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/backtrace_formatter.rb +65 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/bisect/coordinator.rb +62 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/bisect/example_minimizer.rb +173 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/bisect/fork_runner.rb +135 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/bisect/server.rb +61 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/bisect/shell_command.rb +126 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/bisect/shell_runner.rb +73 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/bisect/utilities.rb +58 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/configuration.rb +2363 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/configuration_options.rb +233 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/did_you_mean.rb +46 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/drb.rb +113 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/dsl.rb +98 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/example.rb +656 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb +900 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/example_status_persister.rb +235 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/filter_manager.rb +231 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/flat_map.rb +20 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters.rb +273 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/base_bisect_formatter.rb +45 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/base_formatter.rb +70 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/base_text_formatter.rb +75 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/bisect_drb_formatter.rb +29 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/bisect_progress_formatter.rb +157 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/console_codes.rb +68 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/documentation_formatter.rb +102 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/exception_presenter.rb +511 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/failure_list_formatter.rb +23 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/helpers.rb +110 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/html_formatter.rb +153 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/html_printer.rb +414 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/html_snippet_extractor.rb +120 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/json_formatter.rb +102 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/profile_formatter.rb +68 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/progress_formatter.rb +29 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/protocol.rb +182 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/snippet_extractor.rb +134 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/formatters/syntax_highlighter.rb +91 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/hooks.rb +641 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/invocations.rb +87 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/memoized_helpers.rb +554 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/metadata.rb +498 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/metadata_filter.rb +255 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/mocking_adapters/null.rb +14 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/mocking_adapters/rr.rb +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/notifications.rb +521 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/option_parser.rb +316 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/ordering.rb +158 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/output_wrapper.rb +29 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/pending.rb +165 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/profiler.rb +34 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/project_initializer.rb +48 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/project_initializer/.rspec +1 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/project_initializer/spec/spec_helper.rb +100 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/rake_task.rb +188 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/reporter.rb +265 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/ruby_project.rb +53 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb +204 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/sandbox.rb +37 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/set.rb +54 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/shared_context.rb +55 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/shared_example_group.rb +271 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/shell_escape.rb +49 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/version.rb +9 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/warnings.rb +40 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.2/lib/rspec/core/world.rb +276 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/.document +5 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/.yardopts +6 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/Changelog.md +1191 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/LICENSE.md +25 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/README.md +320 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations.rb +82 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/block_snippet_extractor.rb +253 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/configuration.rb +215 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/expectation_target.rb +127 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/fail_with.rb +39 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/failure_aggregator.rb +194 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/handler.rb +170 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/minitest_integration.rb +58 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/syntax.rb +132 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/version.rb +8 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers.rb +1038 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/aliased_matcher.rb +116 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in.rb +52 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/all.rb +86 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/base_matcher.rb +193 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/be.rb +288 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/be_between.rb +77 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/be_instance_of.rb +26 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/be_kind_of.rb +20 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/be_within.rb +72 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/change.rb +428 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/compound.rb +276 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/contain_exactly.rb +302 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/cover.rb +24 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/eq.rb +40 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/eql.rb +34 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/equal.rb +81 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/exist.rb +90 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/has.rb +103 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/include.rb +149 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/match.rb +106 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/operators.rb +128 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/output.rb +200 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/raise_error.rb +230 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/respond_to.rb +199 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/satisfy.rb +60 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/start_or_end_with.rb +94 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/throw_symbol.rb +132 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/built_in/yield.rb +441 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/composable.rb +171 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/dsl.rb +540 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/english_phrasing.rb +58 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +82 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/fail_matchers.rb +42 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/generated_descriptions.rb +41 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/matcher_delegator.rb +35 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/matchers/matcher_protocol.rb +99 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/.document +5 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/.yardopts +6 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/Changelog.md +1133 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/LICENSE.md +25 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/README.md +463 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks.rb +130 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance.rb +11 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/chain.rb +111 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/error_generator.rb +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/expect_chain_chain.rb +31 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/expectation_chain.rb +50 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/message_chains.rb +83 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/proxy.rb +116 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/recorder.rb +294 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/stub_chain.rb +51 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/stub_chain_chain.rb +23 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/argument_list_matcher.rb +100 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/argument_matchers.rb +322 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/configuration.rb +212 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/error_generator.rb +369 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/example_methods.rb +434 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/instance_method_stasher.rb +146 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/marshal_extension.rb +41 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/matchers/expectation_customization.rb +20 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/matchers/have_received.rb +134 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/matchers/receive.rb +132 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/matchers/receive_message_chain.rb +82 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/matchers/receive_messages.rb +77 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/message_chain.rb +87 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/message_expectation.rb +751 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/method_double.rb +287 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/method_reference.rb +202 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/minitest_integration.rb +68 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/mutate_const.rb +339 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/object_reference.rb +149 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/order_group.rb +81 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/proxy.rb +503 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/space.rb +238 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/standalone.rb +3 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/syntax.rb +325 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/targets.rb +124 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/test_double.rb +171 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/verifying_double.rb +129 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/verifying_message_expectation.rb +54 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/verifying_proxy.rb +220 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/version.rb +9 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/Changelog.md +302 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/LICENSE.md +23 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/README.md +40 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support.rb +149 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/caller_filter.rb +83 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/comparable_version.rb +46 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/differ.rb +215 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/directory_maker.rb +63 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/encoded_string.rb +161 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/fuzzy_matcher.rb +48 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/hunk_generator.rb +47 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/matcher_definition.rb +42 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/method_signature_verifier.rb +438 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/mutex.rb +73 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/object_formatter.rb +275 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/recursive_const_methods.rb +76 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/reentrant_mutex.rb +61 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/ruby_features.rb +190 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/source.rb +75 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/source/location.rb +21 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/source/node.rb +110 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/source/token.rb +87 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/spec.rb +81 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/spec/deprecation_helpers.rb +64 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/spec/formatting_support.rb +9 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/spec/in_sub_process.rb +69 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/spec/library_wide_checks.rb +150 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/spec/shell_out.rb +89 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/spec/stderr_splitter.rb +75 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/spec/string_matcher.rb +46 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/spec/with_isolated_directory.rb +13 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/spec/with_isolated_stderr.rb +13 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/version.rb +7 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/warnings.rb +39 -0
- data/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.3/lib/rspec/support/with_keywords_when_needed.rb +33 -0
- data/vendor/bundle/ruby/2.7.0/specifications/diff-lcs-1.4.4.gemspec +50 -0
- data/vendor/bundle/ruby/2.7.0/specifications/httparty-0.18.1.gemspec +36 -0
- data/vendor/bundle/ruby/2.7.0/specifications/json-2.3.1.gemspec +0 -0
- data/vendor/bundle/ruby/2.7.0/specifications/mime-types-3.3.1.gemspec +67 -0
- data/vendor/bundle/ruby/2.7.0/specifications/mime-types-data-3.2020.0512.gemspec +50 -0
- data/vendor/bundle/ruby/2.7.0/specifications/multi_xml-0.6.0.gemspec +30 -0
- data/vendor/bundle/ruby/2.7.0/specifications/rake-12.3.3.gemspec +43 -0
- data/vendor/bundle/ruby/2.7.0/specifications/rspec-3.9.0.gemspec +39 -0
- data/vendor/bundle/ruby/2.7.0/specifications/rspec-core-3.9.2.gemspec +53 -0
- data/vendor/bundle/ruby/2.7.0/specifications/rspec-expectations-3.9.2.gemspec +44 -0
- data/vendor/bundle/ruby/2.7.0/specifications/rspec-mocks-3.9.1.gemspec +44 -0
- data/vendor/bundle/ruby/2.7.0/specifications/rspec-support-3.9.3.gemspec +36 -0
- metadata +680 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
defined?(::BigDecimal) or require 'bigdecimal'
|
6
|
+
|
7
|
+
class BigDecimal
|
8
|
+
# Import a JSON Marshalled object.
|
9
|
+
#
|
10
|
+
# method used for JSON marshalling support.
|
11
|
+
def self.json_create(object)
|
12
|
+
BigDecimal._load object['b']
|
13
|
+
end
|
14
|
+
|
15
|
+
# Marshal the object to JSON.
|
16
|
+
#
|
17
|
+
# method used for JSON marshalling support.
|
18
|
+
def as_json(*)
|
19
|
+
{
|
20
|
+
JSON.create_id => self.class.name,
|
21
|
+
'b' => _dump,
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# return the JSON value
|
26
|
+
def to_json(*args)
|
27
|
+
as_json.to_json(*args)
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
defined?(::Complex) or require 'complex'
|
6
|
+
|
7
|
+
class Complex
|
8
|
+
|
9
|
+
# Deserializes JSON string by converting Real value <tt>r</tt>, imaginary
|
10
|
+
# value <tt>i</tt>, to a Complex object.
|
11
|
+
def self.json_create(object)
|
12
|
+
Complex(object['r'], object['i'])
|
13
|
+
end
|
14
|
+
|
15
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
16
|
+
# object.
|
17
|
+
def as_json(*)
|
18
|
+
{
|
19
|
+
JSON.create_id => self.class.name,
|
20
|
+
'r' => real,
|
21
|
+
'i' => imag,
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Stores class name (Complex) along with real value <tt>r</tt> and imaginary value <tt>i</tt> as JSON string
|
26
|
+
def to_json(*args)
|
27
|
+
as_json.to_json(*args)
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
# This file requires the implementations of ruby core's custom objects for
|
3
|
+
# serialisation/deserialisation.
|
4
|
+
|
5
|
+
require 'json/add/date'
|
6
|
+
require 'json/add/date_time'
|
7
|
+
require 'json/add/exception'
|
8
|
+
require 'json/add/range'
|
9
|
+
require 'json/add/regexp'
|
10
|
+
require 'json/add/struct'
|
11
|
+
require 'json/add/symbol'
|
12
|
+
require 'json/add/time'
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
require 'date'
|
6
|
+
|
7
|
+
class Date
|
8
|
+
|
9
|
+
# Deserializes JSON string by converting Julian year <tt>y</tt>, month
|
10
|
+
# <tt>m</tt>, day <tt>d</tt> and Day of Calendar Reform <tt>sg</tt> to Date.
|
11
|
+
def self.json_create(object)
|
12
|
+
civil(*object.values_at('y', 'm', 'd', 'sg'))
|
13
|
+
end
|
14
|
+
|
15
|
+
alias start sg unless method_defined?(:start)
|
16
|
+
|
17
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
18
|
+
# object.
|
19
|
+
def as_json(*)
|
20
|
+
{
|
21
|
+
JSON.create_id => self.class.name,
|
22
|
+
'y' => year,
|
23
|
+
'm' => month,
|
24
|
+
'd' => day,
|
25
|
+
'sg' => start,
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Stores class name (Date) with Julian year <tt>y</tt>, month <tt>m</tt>, day
|
30
|
+
# <tt>d</tt> and Day of Calendar Reform <tt>sg</tt> as JSON string
|
31
|
+
def to_json(*args)
|
32
|
+
as_json.to_json(*args)
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
require 'date'
|
6
|
+
|
7
|
+
class DateTime
|
8
|
+
|
9
|
+
# Deserializes JSON string by converting year <tt>y</tt>, month <tt>m</tt>,
|
10
|
+
# day <tt>d</tt>, hour <tt>H</tt>, minute <tt>M</tt>, second <tt>S</tt>,
|
11
|
+
# offset <tt>of</tt> and Day of Calendar Reform <tt>sg</tt> to DateTime.
|
12
|
+
def self.json_create(object)
|
13
|
+
args = object.values_at('y', 'm', 'd', 'H', 'M', 'S')
|
14
|
+
of_a, of_b = object['of'].split('/')
|
15
|
+
if of_b and of_b != '0'
|
16
|
+
args << Rational(of_a.to_i, of_b.to_i)
|
17
|
+
else
|
18
|
+
args << of_a
|
19
|
+
end
|
20
|
+
args << object['sg']
|
21
|
+
civil(*args)
|
22
|
+
end
|
23
|
+
|
24
|
+
alias start sg unless method_defined?(:start)
|
25
|
+
|
26
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
27
|
+
# object.
|
28
|
+
def as_json(*)
|
29
|
+
{
|
30
|
+
JSON.create_id => self.class.name,
|
31
|
+
'y' => year,
|
32
|
+
'm' => month,
|
33
|
+
'd' => day,
|
34
|
+
'H' => hour,
|
35
|
+
'M' => min,
|
36
|
+
'S' => sec,
|
37
|
+
'of' => offset.to_s,
|
38
|
+
'sg' => start,
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Stores class name (DateTime) with Julian year <tt>y</tt>, month <tt>m</tt>,
|
43
|
+
# day <tt>d</tt>, hour <tt>H</tt>, minute <tt>M</tt>, second <tt>S</tt>,
|
44
|
+
# offset <tt>of</tt> and Day of Calendar Reform <tt>sg</tt> as JSON string
|
45
|
+
def to_json(*args)
|
46
|
+
as_json.to_json(*args)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
|
6
|
+
class Exception
|
7
|
+
|
8
|
+
# Deserializes JSON string by constructing new Exception object with message
|
9
|
+
# <tt>m</tt> and backtrace <tt>b</tt> serialized with <tt>to_json</tt>
|
10
|
+
def self.json_create(object)
|
11
|
+
result = new(object['m'])
|
12
|
+
result.set_backtrace object['b']
|
13
|
+
result
|
14
|
+
end
|
15
|
+
|
16
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
17
|
+
# object.
|
18
|
+
def as_json(*)
|
19
|
+
{
|
20
|
+
JSON.create_id => self.class.name,
|
21
|
+
'm' => message,
|
22
|
+
'b' => backtrace,
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Stores class name (Exception) with message <tt>m</tt> and backtrace array
|
27
|
+
# <tt>b</tt> as JSON string
|
28
|
+
def to_json(*args)
|
29
|
+
as_json.to_json(*args)
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
require 'ostruct'
|
6
|
+
|
7
|
+
class OpenStruct
|
8
|
+
|
9
|
+
# Deserializes JSON string by constructing new Struct object with values
|
10
|
+
# <tt>t</tt> serialized by <tt>to_json</tt>.
|
11
|
+
def self.json_create(object)
|
12
|
+
new(object['t'] || object[:t])
|
13
|
+
end
|
14
|
+
|
15
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
16
|
+
# object.
|
17
|
+
def as_json(*)
|
18
|
+
klass = self.class.name
|
19
|
+
klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
|
20
|
+
{
|
21
|
+
JSON.create_id => klass,
|
22
|
+
't' => table,
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Stores class name (OpenStruct) with this struct's values <tt>t</tt> as a
|
27
|
+
# JSON string.
|
28
|
+
def to_json(*args)
|
29
|
+
as_json.to_json(*args)
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
|
6
|
+
class Range
|
7
|
+
|
8
|
+
# Deserializes JSON string by constructing new Range object with arguments
|
9
|
+
# <tt>a</tt> serialized by <tt>to_json</tt>.
|
10
|
+
def self.json_create(object)
|
11
|
+
new(*object['a'])
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
15
|
+
# object.
|
16
|
+
def as_json(*)
|
17
|
+
{
|
18
|
+
JSON.create_id => self.class.name,
|
19
|
+
'a' => [ first, last, exclude_end? ]
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Stores class name (Range) with JSON array of arguments <tt>a</tt> which
|
24
|
+
# include <tt>first</tt> (integer), <tt>last</tt> (integer), and
|
25
|
+
# <tt>exclude_end?</tt> (boolean) as JSON string.
|
26
|
+
def to_json(*args)
|
27
|
+
as_json.to_json(*args)
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
defined?(::Rational) or require 'rational'
|
6
|
+
|
7
|
+
class Rational
|
8
|
+
# Deserializes JSON string by converting numerator value <tt>n</tt>,
|
9
|
+
# denominator value <tt>d</tt>, to a Rational object.
|
10
|
+
def self.json_create(object)
|
11
|
+
Rational(object['n'], object['d'])
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
15
|
+
# object.
|
16
|
+
def as_json(*)
|
17
|
+
{
|
18
|
+
JSON.create_id => self.class.name,
|
19
|
+
'n' => numerator,
|
20
|
+
'd' => denominator,
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
# Stores class name (Rational) along with numerator value <tt>n</tt> and denominator value <tt>d</tt> as JSON string
|
25
|
+
def to_json(*args)
|
26
|
+
as_json.to_json(*args)
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
|
6
|
+
class Regexp
|
7
|
+
|
8
|
+
# Deserializes JSON string by constructing new Regexp object with source
|
9
|
+
# <tt>s</tt> (Regexp or String) and options <tt>o</tt> serialized by
|
10
|
+
# <tt>to_json</tt>
|
11
|
+
def self.json_create(object)
|
12
|
+
new(object['s'], object['o'])
|
13
|
+
end
|
14
|
+
|
15
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
16
|
+
# object.
|
17
|
+
def as_json(*)
|
18
|
+
{
|
19
|
+
JSON.create_id => self.class.name,
|
20
|
+
'o' => options,
|
21
|
+
's' => source,
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Stores class name (Regexp) with options <tt>o</tt> and source <tt>s</tt>
|
26
|
+
# (Regexp or String) as JSON string
|
27
|
+
def to_json(*args)
|
28
|
+
as_json.to_json(*args)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
2
|
+
require 'json'
|
3
|
+
end
|
4
|
+
defined?(::Set) or require 'set'
|
5
|
+
|
6
|
+
class Set
|
7
|
+
# Import a JSON Marshalled object.
|
8
|
+
#
|
9
|
+
# method used for JSON marshalling support.
|
10
|
+
def self.json_create(object)
|
11
|
+
new object['a']
|
12
|
+
end
|
13
|
+
|
14
|
+
# Marshal the object to JSON.
|
15
|
+
#
|
16
|
+
# method used for JSON marshalling support.
|
17
|
+
def as_json(*)
|
18
|
+
{
|
19
|
+
JSON.create_id => self.class.name,
|
20
|
+
'a' => to_a,
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
# return the JSON value
|
25
|
+
def to_json(*args)
|
26
|
+
as_json.to_json(*args)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
|
6
|
+
class Struct
|
7
|
+
|
8
|
+
# Deserializes JSON string by constructing new Struct object with values
|
9
|
+
# <tt>v</tt> serialized by <tt>to_json</tt>.
|
10
|
+
def self.json_create(object)
|
11
|
+
new(*object['v'])
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
15
|
+
# object.
|
16
|
+
def as_json(*)
|
17
|
+
klass = self.class.name
|
18
|
+
klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
|
19
|
+
{
|
20
|
+
JSON.create_id => klass,
|
21
|
+
'v' => values,
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Stores class name (Struct) with Struct values <tt>v</tt> as a JSON string.
|
26
|
+
# Only named structs are supported.
|
27
|
+
def to_json(*args)
|
28
|
+
as_json.to_json(*args)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
|
6
|
+
class Symbol
|
7
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
8
|
+
# object.
|
9
|
+
def as_json(*)
|
10
|
+
{
|
11
|
+
JSON.create_id => self.class.name,
|
12
|
+
's' => to_s,
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
# Stores class name (Symbol) with String representation of Symbol as a JSON string.
|
17
|
+
def to_json(*a)
|
18
|
+
as_json.to_json(*a)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Deserializes JSON string by converting the <tt>string</tt> value stored in the object to a Symbol
|
22
|
+
def self.json_create(o)
|
23
|
+
o['s'].to_sym
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
|
6
|
+
class Time
|
7
|
+
|
8
|
+
# Deserializes JSON string by converting time since epoch to Time
|
9
|
+
def self.json_create(object)
|
10
|
+
if usec = object.delete('u') # used to be tv_usec -> tv_nsec
|
11
|
+
object['n'] = usec * 1000
|
12
|
+
end
|
13
|
+
if method_defined?(:tv_nsec)
|
14
|
+
at(object['s'], Rational(object['n'], 1000))
|
15
|
+
else
|
16
|
+
at(object['s'], object['n'] / 1000)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# Returns a hash, that will be turned into a JSON object and represent this
|
21
|
+
# object.
|
22
|
+
def as_json(*)
|
23
|
+
nanoseconds = [ tv_usec * 1000 ]
|
24
|
+
respond_to?(:tv_nsec) and nanoseconds << tv_nsec
|
25
|
+
nanoseconds = nanoseconds.max
|
26
|
+
{
|
27
|
+
JSON.create_id => self.class.name,
|
28
|
+
's' => tv_sec,
|
29
|
+
'n' => nanoseconds,
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Stores class name (Time) with number of seconds since epoch and number of
|
34
|
+
# microseconds for Time as JSON string
|
35
|
+
def to_json(*args)
|
36
|
+
as_json.to_json(*args)
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,691 @@
|
|
1
|
+
#frozen_string_literal: false
|
2
|
+
require 'json/version'
|
3
|
+
require 'json/generic_object'
|
4
|
+
|
5
|
+
module JSON
|
6
|
+
class << self
|
7
|
+
# If +object+ is a
|
8
|
+
# {String-convertible object}[doc/implicit_conversion_rdoc.html#label-String-Convertible+Objects]
|
9
|
+
# (implementing +to_str+), calls JSON.parse with +object+ and +opts+:
|
10
|
+
# json = '[0, 1, null]'
|
11
|
+
# JSON[json]# => [0, 1, nil]
|
12
|
+
#
|
13
|
+
# Otherwise, calls JSON.generate with +object+ and +opts+:
|
14
|
+
# ruby = [0, 1, nil]
|
15
|
+
# JSON[ruby] # => '[0,1,null]'
|
16
|
+
def [](object, opts = {})
|
17
|
+
if object.respond_to? :to_str
|
18
|
+
JSON.parse(object.to_str, opts)
|
19
|
+
else
|
20
|
+
JSON.generate(object, opts)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Returns the JSON parser class that is used by JSON. This is either
|
25
|
+
# JSON::Ext::Parser or JSON::Pure::Parser:
|
26
|
+
# JSON.parser # => JSON::Ext::Parser
|
27
|
+
attr_reader :parser
|
28
|
+
|
29
|
+
# Set the JSON parser class _parser_ to be used by JSON.
|
30
|
+
def parser=(parser) # :nodoc:
|
31
|
+
@parser = parser
|
32
|
+
remove_const :Parser if const_defined?(:Parser, false)
|
33
|
+
const_set :Parser, parser
|
34
|
+
end
|
35
|
+
|
36
|
+
# Return the constant located at _path_. The format of _path_ has to be
|
37
|
+
# either ::A::B::C or A::B::C. In any case, A has to be located at the top
|
38
|
+
# level (absolute namespace path?). If there doesn't exist a constant at
|
39
|
+
# the given path, an ArgumentError is raised.
|
40
|
+
def deep_const_get(path) # :nodoc:
|
41
|
+
path.to_s.split(/::/).inject(Object) do |p, c|
|
42
|
+
case
|
43
|
+
when c.empty? then p
|
44
|
+
when p.const_defined?(c, true) then p.const_get(c)
|
45
|
+
else
|
46
|
+
begin
|
47
|
+
p.const_missing(c)
|
48
|
+
rescue NameError => e
|
49
|
+
raise ArgumentError, "can't get const #{path}: #{e}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Set the module _generator_ to be used by JSON.
|
56
|
+
def generator=(generator) # :nodoc:
|
57
|
+
old, $VERBOSE = $VERBOSE, nil
|
58
|
+
@generator = generator
|
59
|
+
generator_methods = generator::GeneratorMethods
|
60
|
+
for const in generator_methods.constants
|
61
|
+
klass = deep_const_get(const)
|
62
|
+
modul = generator_methods.const_get(const)
|
63
|
+
klass.class_eval do
|
64
|
+
instance_methods(false).each do |m|
|
65
|
+
m.to_s == 'to_json' and remove_method m
|
66
|
+
end
|
67
|
+
include modul
|
68
|
+
end
|
69
|
+
end
|
70
|
+
self.state = generator::State
|
71
|
+
const_set :State, self.state
|
72
|
+
const_set :SAFE_STATE_PROTOTYPE, State.new
|
73
|
+
const_set :FAST_STATE_PROTOTYPE, State.new(
|
74
|
+
:indent => '',
|
75
|
+
:space => '',
|
76
|
+
:object_nl => "",
|
77
|
+
:array_nl => "",
|
78
|
+
:max_nesting => false
|
79
|
+
)
|
80
|
+
const_set :PRETTY_STATE_PROTOTYPE, State.new(
|
81
|
+
:indent => ' ',
|
82
|
+
:space => ' ',
|
83
|
+
:object_nl => "\n",
|
84
|
+
:array_nl => "\n"
|
85
|
+
)
|
86
|
+
ensure
|
87
|
+
$VERBOSE = old
|
88
|
+
end
|
89
|
+
|
90
|
+
# Returns the JSON generator module that is used by JSON. This is
|
91
|
+
# either JSON::Ext::Generator or JSON::Pure::Generator:
|
92
|
+
# JSON.generator # => JSON::Ext::Generator
|
93
|
+
attr_reader :generator
|
94
|
+
|
95
|
+
# Sets or Returns the JSON generator state class that is used by JSON. This is
|
96
|
+
# either JSON::Ext::Generator::State or JSON::Pure::Generator::State:
|
97
|
+
# JSON.state # => JSON::Ext::Generator::State
|
98
|
+
attr_accessor :state
|
99
|
+
|
100
|
+
# Sets or returns create identifier, which is used to decide if the _json_create_
|
101
|
+
# hook of a class should be called; initial value is +json_class+:
|
102
|
+
# JSON.create_id # => 'json_class'
|
103
|
+
attr_accessor :create_id
|
104
|
+
end
|
105
|
+
self.create_id = 'json_class'
|
106
|
+
|
107
|
+
NaN = 0.0/0
|
108
|
+
|
109
|
+
Infinity = 1.0/0
|
110
|
+
|
111
|
+
MinusInfinity = -Infinity
|
112
|
+
|
113
|
+
# The base exception for JSON errors.
|
114
|
+
class JSONError < StandardError
|
115
|
+
def self.wrap(exception)
|
116
|
+
obj = new("Wrapped(#{exception.class}): #{exception.message.inspect}")
|
117
|
+
obj.set_backtrace exception.backtrace
|
118
|
+
obj
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# This exception is raised if a parser error occurs.
|
123
|
+
class ParserError < JSONError; end
|
124
|
+
|
125
|
+
# This exception is raised if the nesting of parsed data structures is too
|
126
|
+
# deep.
|
127
|
+
class NestingError < ParserError; end
|
128
|
+
|
129
|
+
# :stopdoc:
|
130
|
+
class CircularDatastructure < NestingError; end
|
131
|
+
# :startdoc:
|
132
|
+
|
133
|
+
# This exception is raised if a generator or unparser error occurs.
|
134
|
+
class GeneratorError < JSONError; end
|
135
|
+
# For backwards compatibility
|
136
|
+
UnparserError = GeneratorError # :nodoc:
|
137
|
+
|
138
|
+
# This exception is raised if the required unicode support is missing on the
|
139
|
+
# system. Usually this means that the iconv library is not installed.
|
140
|
+
class MissingUnicodeSupport < JSONError; end
|
141
|
+
|
142
|
+
module_function
|
143
|
+
|
144
|
+
# :call-seq:
|
145
|
+
# JSON.parse(source, opts) -> object
|
146
|
+
#
|
147
|
+
# Argument +source+ contains the \String to be parsed. It must be a
|
148
|
+
# {String-convertible object}[doc/implicit_conversion_rdoc.html#label-String-Convertible+Objects]
|
149
|
+
# (implementing +to_str+), and must contain valid \JSON data.
|
150
|
+
#
|
151
|
+
# Argument +opts+, if given, contains options for the parsing, and must be a
|
152
|
+
# {Hash-convertible object}[doc/implicit_conversion_rdoc.html#label-Hash-Convertible+Objects]
|
153
|
+
# (implementing +to_hash+).
|
154
|
+
#
|
155
|
+
# Returns the Ruby objects created by parsing the given +source+.
|
156
|
+
#
|
157
|
+
# ---
|
158
|
+
#
|
159
|
+
# When +source+ is a \JSON array, returns a Ruby \Array:
|
160
|
+
# source = '["foo", 1.0, true, false, null]'
|
161
|
+
# ruby = JSON.parse(source)
|
162
|
+
# ruby # => ["foo", 1.0, true, false, nil]
|
163
|
+
# ruby.class # => Array
|
164
|
+
#
|
165
|
+
# When +source+ is a \JSON object, returns a Ruby \Hash:
|
166
|
+
# source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}'
|
167
|
+
# ruby = JSON.parse(source)
|
168
|
+
# ruby # => {"a"=>"foo", "b"=>1.0, "c"=>true, "d"=>false, "e"=>nil}
|
169
|
+
# ruby.class # => Hash
|
170
|
+
#
|
171
|
+
# For examples of parsing for all \JSON data types, see
|
172
|
+
# {Parsing \JSON}[#module-JSON-label-Parsing+JSON].
|
173
|
+
#
|
174
|
+
# ====== Input Options
|
175
|
+
#
|
176
|
+
# Option +max_nesting+ (\Integer) specifies the maximum nesting depth allowed;
|
177
|
+
# defaults to +100+; specify +false+ to disable depth checking.
|
178
|
+
#
|
179
|
+
# With the default, +false+:
|
180
|
+
# source = '[0, [1, [2, [3]]]]'
|
181
|
+
# ruby = JSON.parse(source)
|
182
|
+
# ruby # => [0, [1, [2, [3]]]]
|
183
|
+
# Too deep:
|
184
|
+
# # Raises JSON::NestingError (nesting of 2 is too deep):
|
185
|
+
# JSON.parse(source, {max_nesting: 1})
|
186
|
+
# Bad value:
|
187
|
+
# # Raises TypeError (wrong argument type Symbol (expected Fixnum)):
|
188
|
+
# JSON.parse(source, {max_nesting: :foo})
|
189
|
+
#
|
190
|
+
# ---
|
191
|
+
#
|
192
|
+
# Option +allow_nan+ (boolean) specifies whether to allow
|
193
|
+
# NaN, Infinity, and MinusInfinity in +source+;
|
194
|
+
# defaults to +false+.
|
195
|
+
#
|
196
|
+
# With the default, +false+:
|
197
|
+
# # Raises JSON::ParserError (225: unexpected token at '[NaN]'):
|
198
|
+
# JSON.parse('[NaN]')
|
199
|
+
# # Raises JSON::ParserError (232: unexpected token at '[Infinity]'):
|
200
|
+
# JSON.parse('[Infinity]')
|
201
|
+
# # Raises JSON::ParserError (248: unexpected token at '[-Infinity]'):
|
202
|
+
# JSON.parse('[-Infinity]')
|
203
|
+
# Allow:
|
204
|
+
# source = '[NaN, Infinity, -Infinity]'
|
205
|
+
# ruby = JSON.parse(source, {allow_nan: true})
|
206
|
+
# ruby # => [NaN, Infinity, -Infinity]
|
207
|
+
#
|
208
|
+
# ====== Output Options
|
209
|
+
#
|
210
|
+
# Option +symbolize_names+ (boolean) specifies whether returned \Hash keys
|
211
|
+
# should be Symbols;
|
212
|
+
# defaults to +false+ (use Strings).
|
213
|
+
#
|
214
|
+
# With the default, +false+:
|
215
|
+
# source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}'
|
216
|
+
# ruby = JSON.parse(source)
|
217
|
+
# ruby # => {"a"=>"foo", "b"=>1.0, "c"=>true, "d"=>false, "e"=>nil}
|
218
|
+
# Use Symbols:
|
219
|
+
# ruby = JSON.parse(source, {symbolize_names: true})
|
220
|
+
# ruby # => {:a=>"foo", :b=>1.0, :c=>true, :d=>false, :e=>nil}
|
221
|
+
#
|
222
|
+
# ---
|
223
|
+
#
|
224
|
+
# Option +object_class+ (\Class) specifies the Ruby class to be used
|
225
|
+
# for each \JSON object;
|
226
|
+
# defaults to \Hash.
|
227
|
+
#
|
228
|
+
# With the default, \Hash:
|
229
|
+
# source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}'
|
230
|
+
# ruby = JSON.parse(source)
|
231
|
+
# ruby.class # => Hash
|
232
|
+
# Use class \OpenStruct:
|
233
|
+
# ruby = JSON.parse(source, {object_class: OpenStruct})
|
234
|
+
# ruby # => #<OpenStruct a="foo", b=1.0, c=true, d=false, e=nil>
|
235
|
+
#
|
236
|
+
# ---
|
237
|
+
#
|
238
|
+
# Option +array_class+ (\Class) specifies the Ruby class to be used
|
239
|
+
# for each \JSON array;
|
240
|
+
# defaults to \Array.
|
241
|
+
#
|
242
|
+
# With the default, \Array:
|
243
|
+
# source = '["foo", 1.0, true, false, null]'
|
244
|
+
# ruby = JSON.parse(source)
|
245
|
+
# ruby.class # => Array
|
246
|
+
# Use class \Set:
|
247
|
+
# ruby = JSON.parse(source, {array_class: Set})
|
248
|
+
# ruby # => #<Set: {"foo", 1.0, true, false, nil}>
|
249
|
+
#
|
250
|
+
# ---
|
251
|
+
#
|
252
|
+
# Option +create_additions+ (boolean) specifies whether to use \JSON additions in parsing.
|
253
|
+
# See {\JSON Additions}[#module-JSON-label-JSON+Additions].
|
254
|
+
#
|
255
|
+
# ====== Exceptions
|
256
|
+
#
|
257
|
+
# Raises an exception if +source+ is not valid JSON:
|
258
|
+
#
|
259
|
+
# # Raises JSON::ParserError (783: unexpected token at ''):
|
260
|
+
# JSON.parse('')
|
261
|
+
#
|
262
|
+
def parse(source, opts = {})
|
263
|
+
Parser.new(source, **(opts||{})).parse
|
264
|
+
end
|
265
|
+
|
266
|
+
# :call-seq:
|
267
|
+
# JSON.parse!(source, opts) -> object
|
268
|
+
#
|
269
|
+
# Calls
|
270
|
+
# parse(source, opts)
|
271
|
+
# with +source+ and possibly modified +opts+.
|
272
|
+
#
|
273
|
+
# Differences from JSON.parse:
|
274
|
+
# - Option +max_nesting+, if not provided, defaults to +false+,
|
275
|
+
# which disables checking for nesting depth.
|
276
|
+
# - Option +allow_nan+, if not provided, defaults to +true+.
|
277
|
+
def parse!(source, opts = {})
|
278
|
+
opts = {
|
279
|
+
:max_nesting => false,
|
280
|
+
:allow_nan => true
|
281
|
+
}.merge(opts)
|
282
|
+
Parser.new(source, **(opts||{})).parse
|
283
|
+
end
|
284
|
+
|
285
|
+
# :call-seq:
|
286
|
+
# JSON.generate(obj, opts = nil) -> new_string
|
287
|
+
#
|
288
|
+
# Argument +obj+ is the Ruby object to be converted to \JSON.
|
289
|
+
#
|
290
|
+
# Argument +opts+, if given, contains options for the generation, and must be a
|
291
|
+
# {Hash-convertible object}[doc/implicit_conversion_rdoc.html#label-Hash-Convertible+Objects]
|
292
|
+
# (implementing +to_hash+).
|
293
|
+
#
|
294
|
+
# Returns a \String containing the generated \JSON data.
|
295
|
+
#
|
296
|
+
# See also JSON.fast_generate, JSON.pretty_generate.
|
297
|
+
#
|
298
|
+
# ---
|
299
|
+
#
|
300
|
+
# When +obj+ is an
|
301
|
+
# {Array-convertible object}[doc/implicit_conversion_rdoc.html#label-Array-Convertible+Objects]
|
302
|
+
# (implementing +to_ary+), returns a \String containing a \JSON array:
|
303
|
+
# obj = ["foo", 1.0, true, false, nil]
|
304
|
+
# json = JSON.generate(obj)
|
305
|
+
# json # => '["foo",1.0,true,false,null]'
|
306
|
+
#
|
307
|
+
# When +obj+ is a
|
308
|
+
# {Hash-convertible object}[doc/implicit_conversion_rdoc.html#label-Hash-Convertible+Objects],
|
309
|
+
# return a \String containing a \JSON object:
|
310
|
+
# obj = {foo: 0, bar: 's', baz: :bat}
|
311
|
+
# json = JSON.generate(obj)
|
312
|
+
# json # => '{"foo":0,"bar":"s","baz":"bat"}'
|
313
|
+
#
|
314
|
+
# For examples of generating from other Ruby objects, see
|
315
|
+
# {Generating \JSON from Other Objects}[#module-JSON-label-Generating+JSON+from+Other+Objects].
|
316
|
+
#
|
317
|
+
# ====== Input Options
|
318
|
+
#
|
319
|
+
# Option +allow_nan+ (boolean) specifies whether
|
320
|
+
# +NaN+, +Infinity+, and <tt>-Infinity</tt> may be generated;
|
321
|
+
# defaults to +false+.
|
322
|
+
#
|
323
|
+
# With the default, +false+:
|
324
|
+
# # Raises JSON::GeneratorError (920: NaN not allowed in JSON):
|
325
|
+
# JSON.generate(JSON::NaN)
|
326
|
+
# # Raises JSON::GeneratorError (917: Infinity not allowed in JSON):
|
327
|
+
# JSON.generate(JSON::Infinity)
|
328
|
+
# # Raises JSON::GeneratorError (917: -Infinity not allowed in JSON):
|
329
|
+
# JSON.generate(JSON::MinusInfinity)
|
330
|
+
#
|
331
|
+
# Allow:
|
332
|
+
# ruby = [Float::NaN, Float::Infinity, Float::MinusInfinity]
|
333
|
+
# JSON.generate(ruby, allow_nan: true) # => '[NaN,Infinity,-Infinity]'
|
334
|
+
#
|
335
|
+
# ---
|
336
|
+
#
|
337
|
+
# Option +max_nesting+ (\Integer) specifies the maximum nesting depth
|
338
|
+
# in +obj+; defaults to +100+.
|
339
|
+
#
|
340
|
+
# With the default, +100+:
|
341
|
+
# obj = [[[[[[0]]]]]]
|
342
|
+
# JSON.generate(obj) # => '[[[[[[0]]]]]]'
|
343
|
+
#
|
344
|
+
# Too deep:
|
345
|
+
# # Raises JSON::NestingError (nesting of 2 is too deep):
|
346
|
+
# JSON.generate(obj, max_nesting: 2)
|
347
|
+
#
|
348
|
+
# ====== Output Options
|
349
|
+
#
|
350
|
+
# The default formatting options generate the most compact
|
351
|
+
# \JSON data, all on one line and with no whitespace.
|
352
|
+
#
|
353
|
+
# You can use these formatting options to generate
|
354
|
+
# \JSON data in a more open format, using whitespace.
|
355
|
+
# See also JSON.pretty_generate.
|
356
|
+
#
|
357
|
+
# - Option +array_nl+ (\String) specifies a string (usually a newline)
|
358
|
+
# to be inserted after each \JSON array; defaults to the empty \String, <tt>''</tt>.
|
359
|
+
# - Option +object_nl+ (\String) specifies a string (usually a newline)
|
360
|
+
# to be inserted after each \JSON object; defaults to the empty \String, <tt>''</tt>.
|
361
|
+
# - Option +indent+ (\String) specifies the string (usually spaces) to be
|
362
|
+
# used for indentation; defaults to the empty \String, <tt>''</tt>;
|
363
|
+
# defaults to the empty \String, <tt>''</tt>;
|
364
|
+
# has no effect unless options +array_nl+ or +object_nl+ specify newlines.
|
365
|
+
# - Option +space+ (\String) specifies a string (usually a space) to be
|
366
|
+
# inserted after the colon in each \JSON object's pair;
|
367
|
+
# defaults to the empty \String, <tt>''</tt>.
|
368
|
+
# - Option +space_before+ (\String) specifies a string (usually a space) to be
|
369
|
+
# inserted before the colon in each \JSON object's pair;
|
370
|
+
# defaults to the empty \String, <tt>''</tt>.
|
371
|
+
#
|
372
|
+
# In this example, +obj+ is used first to generate the shortest
|
373
|
+
# \JSON data (no whitespace), then again with all formatting options
|
374
|
+
# specified:
|
375
|
+
#
|
376
|
+
# obj = {foo: [:bar, :baz], bat: {bam: 0, bad: 1}}
|
377
|
+
# json = JSON.generate(obj)
|
378
|
+
# puts 'Compact:', json
|
379
|
+
# opts = {
|
380
|
+
# array_nl: "\n",
|
381
|
+
# object_nl: "\n",
|
382
|
+
# indent+: ' ',
|
383
|
+
# space_before: ' ',
|
384
|
+
# space: ' '
|
385
|
+
# }
|
386
|
+
# puts 'Open:', JSON.generate(obj, opts)
|
387
|
+
#
|
388
|
+
# Output:
|
389
|
+
# Compact:
|
390
|
+
# {"foo":["bar","baz"],"bat":{"bam":0,"bad":1}}
|
391
|
+
# Open:
|
392
|
+
# {
|
393
|
+
# "foo" : [
|
394
|
+
# "bar",
|
395
|
+
# "baz"
|
396
|
+
# ],
|
397
|
+
# "bat" : {
|
398
|
+
# "bam" : 0,
|
399
|
+
# "bad" : 1
|
400
|
+
# }
|
401
|
+
# }
|
402
|
+
#
|
403
|
+
# ---
|
404
|
+
#
|
405
|
+
# Raises an exception if any formatting option is not a \String.
|
406
|
+
#
|
407
|
+
# ====== Exceptions
|
408
|
+
#
|
409
|
+
# Raises an exception if +obj+ contains circular references:
|
410
|
+
# a = []; b = []; a.push(b); b.push(a)
|
411
|
+
# # Raises JSON::NestingError (nesting of 100 is too deep):
|
412
|
+
# JSON.generate(a)
|
413
|
+
#
|
414
|
+
def generate(obj, opts = nil)
|
415
|
+
if State === opts
|
416
|
+
state, opts = opts, nil
|
417
|
+
else
|
418
|
+
state = SAFE_STATE_PROTOTYPE.dup
|
419
|
+
end
|
420
|
+
if opts
|
421
|
+
if opts.respond_to? :to_hash
|
422
|
+
opts = opts.to_hash
|
423
|
+
elsif opts.respond_to? :to_h
|
424
|
+
opts = opts.to_h
|
425
|
+
else
|
426
|
+
raise TypeError, "can't convert #{opts.class} into Hash"
|
427
|
+
end
|
428
|
+
state = state.configure(opts)
|
429
|
+
end
|
430
|
+
state.generate(obj)
|
431
|
+
end
|
432
|
+
|
433
|
+
# :stopdoc:
|
434
|
+
# I want to deprecate these later, so I'll first be silent about them, and
|
435
|
+
# later delete them.
|
436
|
+
alias unparse generate
|
437
|
+
module_function :unparse
|
438
|
+
# :startdoc:
|
439
|
+
|
440
|
+
# Arguments +obj+ and +opts+ here are the same as
|
441
|
+
# arguments +obj+ and +opts+ in JSON.generate.
|
442
|
+
#
|
443
|
+
# By default, generates \JSON data without checking
|
444
|
+
# for circular references in +obj+ (option +max_nesting+ set to +false+, disabled).
|
445
|
+
#
|
446
|
+
# Raises an exception if +obj+ contains circular references:
|
447
|
+
# a = []; b = []; a.push(b); b.push(a)
|
448
|
+
# # Raises SystemStackError (stack level too deep):
|
449
|
+
# JSON.fast_generate(a)
|
450
|
+
def fast_generate(obj, opts = nil)
|
451
|
+
if State === opts
|
452
|
+
state, opts = opts, nil
|
453
|
+
else
|
454
|
+
state = FAST_STATE_PROTOTYPE.dup
|
455
|
+
end
|
456
|
+
if opts
|
457
|
+
if opts.respond_to? :to_hash
|
458
|
+
opts = opts.to_hash
|
459
|
+
elsif opts.respond_to? :to_h
|
460
|
+
opts = opts.to_h
|
461
|
+
else
|
462
|
+
raise TypeError, "can't convert #{opts.class} into Hash"
|
463
|
+
end
|
464
|
+
state.configure(opts)
|
465
|
+
end
|
466
|
+
state.generate(obj)
|
467
|
+
end
|
468
|
+
|
469
|
+
# :stopdoc:
|
470
|
+
# I want to deprecate these later, so I'll first be silent about them, and later delete them.
|
471
|
+
alias fast_unparse fast_generate
|
472
|
+
module_function :fast_unparse
|
473
|
+
# :startdoc:
|
474
|
+
|
475
|
+
# :call-seq:
|
476
|
+
# JSON.pretty_generate(obj, opts = nil) -> new_string
|
477
|
+
#
|
478
|
+
# Arguments +obj+ and +opts+ here are the same as
|
479
|
+
# arguments +obj+ and +opts+ in JSON.generate.
|
480
|
+
#
|
481
|
+
# Default options are:
|
482
|
+
# {
|
483
|
+
# indent: ' ', # Two spaces
|
484
|
+
# space: ' ', # One space
|
485
|
+
# array_nl: "\n", # Newline
|
486
|
+
# object_nl: "\n" # Newline
|
487
|
+
# }
|
488
|
+
#
|
489
|
+
# Example:
|
490
|
+
# obj = {foo: [:bar, :baz], bat: {bam: 0, bad: 1}}
|
491
|
+
# json = JSON.pretty_generate(obj)
|
492
|
+
# puts json
|
493
|
+
# Output:
|
494
|
+
# {
|
495
|
+
# "foo": [
|
496
|
+
# "bar",
|
497
|
+
# "baz"
|
498
|
+
# ],
|
499
|
+
# "bat": {
|
500
|
+
# "bam": 0,
|
501
|
+
# "bad": 1
|
502
|
+
# }
|
503
|
+
# }
|
504
|
+
#
|
505
|
+
def pretty_generate(obj, opts = nil)
|
506
|
+
if State === opts
|
507
|
+
state, opts = opts, nil
|
508
|
+
else
|
509
|
+
state = PRETTY_STATE_PROTOTYPE.dup
|
510
|
+
end
|
511
|
+
if opts
|
512
|
+
if opts.respond_to? :to_hash
|
513
|
+
opts = opts.to_hash
|
514
|
+
elsif opts.respond_to? :to_h
|
515
|
+
opts = opts.to_h
|
516
|
+
else
|
517
|
+
raise TypeError, "can't convert #{opts.class} into Hash"
|
518
|
+
end
|
519
|
+
state.configure(opts)
|
520
|
+
end
|
521
|
+
state.generate(obj)
|
522
|
+
end
|
523
|
+
|
524
|
+
# :stopdoc:
|
525
|
+
# I want to deprecate these later, so I'll first be silent about them, and later delete them.
|
526
|
+
alias pretty_unparse pretty_generate
|
527
|
+
module_function :pretty_unparse
|
528
|
+
# :startdoc:
|
529
|
+
|
530
|
+
class << self
|
531
|
+
# Sets or returns default options for the JSON.load method.
|
532
|
+
# Initially:
|
533
|
+
# opts = JSON.load_default_options
|
534
|
+
# opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
|
535
|
+
attr_accessor :load_default_options
|
536
|
+
end
|
537
|
+
self.load_default_options = {
|
538
|
+
:max_nesting => false,
|
539
|
+
:allow_nan => true,
|
540
|
+
:allow_blank => true,
|
541
|
+
:create_additions => true,
|
542
|
+
}
|
543
|
+
|
544
|
+
# Load a ruby data structure from a JSON _source_ and return it. A source can
|
545
|
+
# either be a string-like object, an IO-like object, or an object responding
|
546
|
+
# to the read method. If _proc_ was given, it will be called with any nested
|
547
|
+
# Ruby object as an argument recursively in depth first order. To modify the
|
548
|
+
# default options pass in the optional _options_ argument as well.
|
549
|
+
#
|
550
|
+
# BEWARE: This method is meant to serialise data from trusted user input,
|
551
|
+
# like from your own database server or clients under your control, it could
|
552
|
+
# be dangerous to allow untrusted users to pass JSON sources into it. The
|
553
|
+
# default options for the parser can be changed via the load_default_options
|
554
|
+
# method.
|
555
|
+
#
|
556
|
+
# This method is part of the implementation of the load/dump interface of
|
557
|
+
# Marshal and YAML.
|
558
|
+
def load(source, proc = nil, options = {})
|
559
|
+
opts = load_default_options.merge options
|
560
|
+
if source.respond_to? :to_str
|
561
|
+
source = source.to_str
|
562
|
+
elsif source.respond_to? :to_io
|
563
|
+
source = source.to_io.read
|
564
|
+
elsif source.respond_to?(:read)
|
565
|
+
source = source.read
|
566
|
+
end
|
567
|
+
if opts[:allow_blank] && (source.nil? || source.empty?)
|
568
|
+
source = 'null'
|
569
|
+
end
|
570
|
+
result = parse(source, opts)
|
571
|
+
recurse_proc(result, &proc) if proc
|
572
|
+
result
|
573
|
+
end
|
574
|
+
|
575
|
+
# Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_
|
576
|
+
def recurse_proc(result, &proc)
|
577
|
+
case result
|
578
|
+
when Array
|
579
|
+
result.each { |x| recurse_proc x, &proc }
|
580
|
+
proc.call result
|
581
|
+
when Hash
|
582
|
+
result.each { |x, y| recurse_proc x, &proc; recurse_proc y, &proc }
|
583
|
+
proc.call result
|
584
|
+
else
|
585
|
+
proc.call result
|
586
|
+
end
|
587
|
+
end
|
588
|
+
|
589
|
+
alias restore load
|
590
|
+
module_function :restore
|
591
|
+
|
592
|
+
class << self
|
593
|
+
# Sets or returns the default options for the JSON.dump method.
|
594
|
+
# Initially:
|
595
|
+
# opts = JSON.dump_default_options
|
596
|
+
# opts # => {:max_nesting=>false, :allow_nan=>true}
|
597
|
+
attr_accessor :dump_default_options
|
598
|
+
end
|
599
|
+
self.dump_default_options = {
|
600
|
+
:max_nesting => false,
|
601
|
+
:allow_nan => true,
|
602
|
+
}
|
603
|
+
|
604
|
+
# Dumps _obj_ as a JSON string, i.e. calls generate on the object and returns
|
605
|
+
# the result.
|
606
|
+
#
|
607
|
+
# If anIO (an IO-like object or an object that responds to the write method)
|
608
|
+
# was given, the resulting JSON is written to it.
|
609
|
+
#
|
610
|
+
# If the number of nested arrays or objects exceeds _limit_, an ArgumentError
|
611
|
+
# exception is raised. This argument is similar (but not exactly the
|
612
|
+
# same!) to the _limit_ argument in Marshal.dump.
|
613
|
+
#
|
614
|
+
# The default options for the generator can be changed via the
|
615
|
+
# dump_default_options method.
|
616
|
+
#
|
617
|
+
# This method is part of the implementation of the load/dump interface of
|
618
|
+
# Marshal and YAML.
|
619
|
+
def dump(obj, anIO = nil, limit = nil)
|
620
|
+
if anIO and limit.nil?
|
621
|
+
anIO = anIO.to_io if anIO.respond_to?(:to_io)
|
622
|
+
unless anIO.respond_to?(:write)
|
623
|
+
limit = anIO
|
624
|
+
anIO = nil
|
625
|
+
end
|
626
|
+
end
|
627
|
+
opts = JSON.dump_default_options
|
628
|
+
opts = opts.merge(:max_nesting => limit) if limit
|
629
|
+
result = generate(obj, opts)
|
630
|
+
if anIO
|
631
|
+
anIO.write result
|
632
|
+
anIO
|
633
|
+
else
|
634
|
+
result
|
635
|
+
end
|
636
|
+
rescue JSON::NestingError
|
637
|
+
raise ArgumentError, "exceed depth limit"
|
638
|
+
end
|
639
|
+
|
640
|
+
# Encodes string using String.encode.
|
641
|
+
def self.iconv(to, from, string)
|
642
|
+
string.encode(to, from)
|
643
|
+
end
|
644
|
+
end
|
645
|
+
|
646
|
+
module ::Kernel
|
647
|
+
private
|
648
|
+
|
649
|
+
# Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in
|
650
|
+
# one line.
|
651
|
+
def j(*objs)
|
652
|
+
objs.each do |obj|
|
653
|
+
puts JSON::generate(obj, :allow_nan => true, :max_nesting => false)
|
654
|
+
end
|
655
|
+
nil
|
656
|
+
end
|
657
|
+
|
658
|
+
# Outputs _objs_ to STDOUT as JSON strings in a pretty format, with
|
659
|
+
# indentation and over many lines.
|
660
|
+
def jj(*objs)
|
661
|
+
objs.each do |obj|
|
662
|
+
puts JSON::pretty_generate(obj, :allow_nan => true, :max_nesting => false)
|
663
|
+
end
|
664
|
+
nil
|
665
|
+
end
|
666
|
+
|
667
|
+
# If _object_ is string-like, parse the string and return the parsed result as
|
668
|
+
# a Ruby data structure. Otherwise, generate a JSON text from the Ruby data
|
669
|
+
# structure object and return it.
|
670
|
+
#
|
671
|
+
# The _opts_ argument is passed through to generate/parse respectively. See
|
672
|
+
# generate and parse for their documentation.
|
673
|
+
def JSON(object, *args)
|
674
|
+
if object.respond_to? :to_str
|
675
|
+
JSON.parse(object.to_str, args.first)
|
676
|
+
else
|
677
|
+
JSON.generate(object, args.first)
|
678
|
+
end
|
679
|
+
end
|
680
|
+
end
|
681
|
+
|
682
|
+
# Extends any Class to include _json_creatable?_ method.
|
683
|
+
class ::Class
|
684
|
+
# Returns true if this class can be used to create an instance
|
685
|
+
# from a serialised JSON string. The class has to implement a class
|
686
|
+
# method _json_create_ that expects a hash as first parameter. The hash
|
687
|
+
# should include the required data.
|
688
|
+
def json_creatable?
|
689
|
+
respond_to?(:json_create)
|
690
|
+
end
|
691
|
+
end
|