bundle_depot 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +54 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/bin/bundle-depot +6 -0
- data/bundle_depot.gemspec +27 -0
- data/config/cucumber.yml +7 -0
- data/features/cli.feature +59 -0
- data/features/fetch.feature +60 -0
- data/features/step_definitions/cli_steps.rb +19 -0
- data/features/step_definitions/store_steps.rb +58 -0
- data/features/store.feature +30 -0
- data/features/support/capture_output.rb +49 -0
- data/features/support/env.rb +42 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/build_info/json_pure-1.8.1.info +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/cache/json_pure-1.8.1.gem +0 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/.gitignore +13 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/.travis.yml +20 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/CHANGES +284 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/COPYING +58 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/COPYING-json-jruby +57 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/GPL +340 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/Gemfile +11 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/README-json-jruby.markdown +33 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/README.rdoc +358 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/Rakefile +412 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/TODO +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/VERSION +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/data/example.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/data/index.html +38 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/data/prototype.js +4184 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/diagrams/.keep +0 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/ext/json/ext/fbuffer/fbuffer.h +181 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/ext/json/ext/generator/depend +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/ext/json/ext/generator/extconf.rb +14 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/ext/json/ext/generator/generator.c +1435 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/ext/json/ext/generator/generator.h +148 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/ext/json/ext/parser/depend +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/ext/json/ext/parser/extconf.rb +13 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/ext/json/ext/parser/parser.c +2204 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/ext/json/ext/parser/parser.h +77 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/ext/json/ext/parser/parser.rl +927 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/install.rb +23 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/ByteListTranscoder.java +167 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/Generator.java +444 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/GeneratorMethods.java +232 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/GeneratorService.java +43 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/GeneratorState.java +543 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/OptionsReader.java +114 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/Parser.java +2644 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/Parser.rl +968 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/ParserService.java +35 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/RuntimeInfo.java +121 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/StringDecoder.java +167 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/StringEncoder.java +106 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/java/src/json/ext/Utils.java +89 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/json-java.gemspec +23 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/json.gemspec +38 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/json_pure.gemspec +40 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/bigdecimal.rb +28 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/complex.rb +22 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/core.rb +11 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/date.rb +34 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/date_time.rb +50 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/exception.rb +31 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/ostruct.rb +31 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/range.rb +29 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/rational.rb +22 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/regexp.rb +30 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/struct.rb +30 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/symbol.rb +25 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/add/time.rb +38 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/common.rb +484 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/ext/.keep +0 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/ext.rb +21 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/generic_object.rb +70 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/pure/generator.rb +522 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/pure/parser.rb +359 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/pure.rb +21 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json/version.rb +8 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/lib/json.rb +62 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail1.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail10.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail11.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail12.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail13.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail14.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail18.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail19.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail2.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail20.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail21.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail22.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail23.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail24.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail25.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail27.json +2 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail28.json +2 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail3.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail4.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail5.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail6.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail7.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail8.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/fail9.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/pass1.json +56 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/pass15.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/pass16.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/pass17.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/pass2.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/pass26.json +1 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/fixtures/pass3.json +6 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/setup_variant.rb +11 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/test_json.rb +545 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/test_json_addition.rb +196 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/test_json_encoding.rb +65 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/test_json_fixtures.rb +35 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/test_json_generate.rb +322 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/test_json_generic_object.rb +75 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/test_json_string_matching.rb +39 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tests/test_json_unicode.rb +72 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tools/fuzz.rb +139 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/gems/json_pure-1.8.1/tools/server.rb +62 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c/ruby/2.0.0/specifications/json_pure-1.8.1.gemspec +38 -0
- data/fixtures/bundle/json/bde95daa2ce7dede336b4367b9e3a0690027bd6f071e0fdcb1b3047cf988963c.tar.gz +0 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/build_info/rake-10.1.0.info +1 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/cache/rake-10.1.0.gem +0 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/.gemtest +0 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/CHANGES +530 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/MIT-LICENSE +21 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/README.rdoc +187 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/Rakefile +375 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/TODO +21 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/command_line_usage.rdoc +152 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/example/Rakefile1 +38 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/example/Rakefile2 +35 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/example/a.c +6 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/example/b.c +6 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/example/main.c +11 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/glossary.rdoc +51 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/jamis.rb +591 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/proto_rake.rdoc +127 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/rake.1.gz +0 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/rakefile.rdoc +617 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/rational.rdoc +151 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.8.6.rdoc +55 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.9.4.rdoc +110 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.9.5.rdoc +114 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-0.9.6.rdoc +127 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-10.0.1.rdoc +187 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-10.0.2.rdoc +191 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/install.rb +80 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/alt_system.rb +108 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb +728 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb +20 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/clean.rb +55 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/cloneable.rb +16 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/contrib/compositepublisher.rb +21 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/contrib/ftptools.rb +139 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/contrib/publisher.rb +73 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/contrib/rubyforgepublisher.rb +16 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/contrib/sshpublisher.rb +50 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/contrib/sys.rb +2 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/default_loader.rb +10 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/dsl_definition.rb +157 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/early_time.rb +18 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/ext/core.rb +28 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/ext/module.rb +0 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/ext/string.rb +166 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/ext/time.rb +15 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_creation_task.rb +24 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb +416 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_task.rb +46 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_utils.rb +116 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_utils_ext.rb +144 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/gempackagetask.rb +2 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/invocation_chain.rb +57 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/invocation_exception_mixin.rb +16 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/linked_list.rb +103 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/loaders/makefile.rb +40 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/multi_task.rb +13 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/name_space.rb +25 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/packagetask.rb +190 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/pathmap.rb +1 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/phony.rb +15 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/private_reader.rb +20 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/promise.rb +99 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/pseudo_status.rb +29 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/rake_module.rb +37 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/rake_test_loader.rb +22 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/rdoctask.rb +2 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/ruby182_test_unit_fix.rb +27 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/runtest.rb +22 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/scope.rb +42 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb +378 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task_argument_error.rb +7 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task_arguments.rb +89 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task_manager.rb +297 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/tasklib.rb +22 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/testtask.rb +201 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/thread_history_display.rb +48 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/thread_pool.rb +161 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/trace_output.rb +22 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/version.rb +9 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake/win32.rb +56 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/lib/rake.rb +73 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/file_creation.rb +34 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/helper.rb +128 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/support/rakefile_definitions.rb +444 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/support/ruby_runner.rb +33 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_private_reader.rb +42 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake.rb +40 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_application.rb +517 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_application_options.rb +457 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_backtrace.rb +113 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_clean.rb +46 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_definitions.rb +79 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_directory_task.rb +57 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_dsl.rb +40 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_early_time.rb +31 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_extension.rb +59 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_file_creation_task.rb +56 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_file_list.rb +627 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_file_list_path_map.rb +8 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_file_task.rb +122 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_file_utils.rb +309 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_ftp_file.rb +74 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_functional.rb +466 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_invocation_chain.rb +64 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_linked_list.rb +84 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_makefile_loader.rb +46 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_multi_task.rb +58 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_name_space.rb +43 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_package_task.rb +79 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_path_map.rb +168 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_path_map_explode.rb +34 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_path_map_partial.rb +18 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_pseudo_status.rb +21 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_rake_test_loader.rb +20 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_reduce_compat.rb +26 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_require.rb +40 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_rules.rb +362 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_scope.rb +44 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_task.rb +376 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_task_argument_parsing.rb +103 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_task_arguments.rb +121 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_task_lib.rb +9 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_task_manager.rb +158 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_task_with_arguments.rb +171 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_test_task.rb +119 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_thread_pool.rb +142 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_top_level_functions.rb +71 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_rake_win32.rb +72 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_thread_history_display.rb +101 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/gems/rake-10.1.0/test/test_trace_output.rb +52 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d/ruby/2.0.0/specifications/rake-10.1.0.gemspec +35 -0
- data/fixtures/bundle/rake/4c3a94088cd7bd0ac6b190c7f40a19c809356cda7fbd7dd8860ed3155b8e5c3d.tar.gz +0 -0
- data/fixtures/project/json/Gemfile +3 -0
- data/fixtures/project/json/Gemfile.lock +10 -0
- data/fixtures/project/json/vendor/cache/json_pure-1.8.1.gem +0 -0
- data/fixtures/project/rake/Gemfile +3 -0
- data/fixtures/project/rake/Gemfile.lock +10 -0
- data/fixtures/project/rake/vendor/cache/rake-10.1.0.gem +0 -0
- data/lib/bundle_depot/cache.rb +136 -0
- data/lib/bundle_depot/cli.rb +51 -0
- data/lib/bundle_depot/version.rb +3 -0
- data/lib/bundle_depot.rb +6 -0
- metadata +417 -0
@@ -0,0 +1,543 @@
|
|
1
|
+
/*
|
2
|
+
* This code is copyrighted work by Daniel Luz <dev at mernen dot com>.
|
3
|
+
*
|
4
|
+
* Distributed under the Ruby and GPLv2 licenses; see COPYING and GPL files
|
5
|
+
* for details.
|
6
|
+
*/
|
7
|
+
package json.ext;
|
8
|
+
|
9
|
+
import org.jruby.Ruby;
|
10
|
+
import org.jruby.RubyBoolean;
|
11
|
+
import org.jruby.RubyClass;
|
12
|
+
import org.jruby.RubyHash;
|
13
|
+
import org.jruby.RubyInteger;
|
14
|
+
import org.jruby.RubyNumeric;
|
15
|
+
import org.jruby.RubyObject;
|
16
|
+
import org.jruby.RubyString;
|
17
|
+
import org.jruby.anno.JRubyMethod;
|
18
|
+
import org.jruby.runtime.Block;
|
19
|
+
import org.jruby.runtime.ObjectAllocator;
|
20
|
+
import org.jruby.runtime.ThreadContext;
|
21
|
+
import org.jruby.runtime.Visibility;
|
22
|
+
import org.jruby.runtime.builtin.IRubyObject;
|
23
|
+
import org.jruby.util.ByteList;
|
24
|
+
|
25
|
+
/**
|
26
|
+
* The <code>JSON::Ext::Generator::State</code> class.
|
27
|
+
*
|
28
|
+
* <p>This class is used to create State instances, that are use to hold data
|
29
|
+
* while generating a JSON text from a a Ruby data structure.
|
30
|
+
*
|
31
|
+
* @author mernen
|
32
|
+
*/
|
33
|
+
public class GeneratorState extends RubyObject {
|
34
|
+
/**
|
35
|
+
* The indenting unit string. Will be repeated several times for larger
|
36
|
+
* indenting levels.
|
37
|
+
*/
|
38
|
+
private ByteList indent = ByteList.EMPTY_BYTELIST;
|
39
|
+
/**
|
40
|
+
* The spacing to be added after a semicolon on a JSON object.
|
41
|
+
* @see #spaceBefore
|
42
|
+
*/
|
43
|
+
private ByteList space = ByteList.EMPTY_BYTELIST;
|
44
|
+
/**
|
45
|
+
* The spacing to be added before a semicolon on a JSON object.
|
46
|
+
* @see #space
|
47
|
+
*/
|
48
|
+
private ByteList spaceBefore = ByteList.EMPTY_BYTELIST;
|
49
|
+
/**
|
50
|
+
* Any suffix to be added after the comma for each element on a JSON object.
|
51
|
+
* It is assumed to be a newline, if set.
|
52
|
+
*/
|
53
|
+
private ByteList objectNl = ByteList.EMPTY_BYTELIST;
|
54
|
+
/**
|
55
|
+
* Any suffix to be added after the comma for each element on a JSON Array.
|
56
|
+
* It is assumed to be a newline, if set.
|
57
|
+
*/
|
58
|
+
private ByteList arrayNl = ByteList.EMPTY_BYTELIST;
|
59
|
+
|
60
|
+
/**
|
61
|
+
* The maximum level of nesting of structures allowed.
|
62
|
+
* <code>0</code> means disabled.
|
63
|
+
*/
|
64
|
+
private int maxNesting = DEFAULT_MAX_NESTING;
|
65
|
+
static final int DEFAULT_MAX_NESTING = 100;
|
66
|
+
/**
|
67
|
+
* Whether special float values (<code>NaN</code>, <code>Infinity</code>,
|
68
|
+
* <code>-Infinity</code>) are accepted.
|
69
|
+
* If set to <code>false</code>, an exception will be thrown upon
|
70
|
+
* encountering one.
|
71
|
+
*/
|
72
|
+
private boolean allowNaN = DEFAULT_ALLOW_NAN;
|
73
|
+
static final boolean DEFAULT_ALLOW_NAN = false;
|
74
|
+
/**
|
75
|
+
* If set to <code>true</code> all JSON documents generated do not contain
|
76
|
+
* any other characters than ASCII characters.
|
77
|
+
*/
|
78
|
+
private boolean asciiOnly = DEFAULT_ASCII_ONLY;
|
79
|
+
static final boolean DEFAULT_ASCII_ONLY = false;
|
80
|
+
/**
|
81
|
+
* If set to <code>true</code> all JSON values generated might not be
|
82
|
+
* RFC-conform JSON documents.
|
83
|
+
*/
|
84
|
+
private boolean quirksMode = DEFAULT_QUIRKS_MODE;
|
85
|
+
static final boolean DEFAULT_QUIRKS_MODE = false;
|
86
|
+
/**
|
87
|
+
* The initial buffer length of this state. (This isn't really used on all
|
88
|
+
* non-C implementations.)
|
89
|
+
*/
|
90
|
+
private int bufferInitialLength = DEFAULT_BUFFER_INITIAL_LENGTH;
|
91
|
+
static final int DEFAULT_BUFFER_INITIAL_LENGTH = 1024;
|
92
|
+
|
93
|
+
/**
|
94
|
+
* The current depth (inside a #to_json call)
|
95
|
+
*/
|
96
|
+
private int depth = 0;
|
97
|
+
|
98
|
+
static final ObjectAllocator ALLOCATOR = new ObjectAllocator() {
|
99
|
+
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
|
100
|
+
return new GeneratorState(runtime, klazz);
|
101
|
+
}
|
102
|
+
};
|
103
|
+
|
104
|
+
public GeneratorState(Ruby runtime, RubyClass metaClass) {
|
105
|
+
super(runtime, metaClass);
|
106
|
+
}
|
107
|
+
|
108
|
+
/**
|
109
|
+
* <code>State.from_state(opts)</code>
|
110
|
+
*
|
111
|
+
* <p>Creates a State object from <code>opts</code>, which ought to be
|
112
|
+
* {@link RubyHash Hash} to create a new <code>State</code> instance
|
113
|
+
* configured by <codes>opts</code>, something else to create an
|
114
|
+
* unconfigured instance. If <code>opts</code> is a <code>State</code>
|
115
|
+
* object, it is just returned.
|
116
|
+
* @param clazzParam The receiver of the method call
|
117
|
+
* ({@link RubyClass} <code>State</code>)
|
118
|
+
* @param opts The object to use as a base for the new <code>State</code>
|
119
|
+
* @param block The block passed to the method
|
120
|
+
* @return A <code>GeneratorState</code> as determined above
|
121
|
+
*/
|
122
|
+
@JRubyMethod(meta=true)
|
123
|
+
public static IRubyObject from_state(ThreadContext context,
|
124
|
+
IRubyObject klass, IRubyObject opts) {
|
125
|
+
return fromState(context, opts);
|
126
|
+
}
|
127
|
+
|
128
|
+
static GeneratorState fromState(ThreadContext context, IRubyObject opts) {
|
129
|
+
return fromState(context, RuntimeInfo.forRuntime(context.getRuntime()), opts);
|
130
|
+
}
|
131
|
+
|
132
|
+
static GeneratorState fromState(ThreadContext context, RuntimeInfo info,
|
133
|
+
IRubyObject opts) {
|
134
|
+
RubyClass klass = info.generatorStateClass.get();
|
135
|
+
if (opts != null) {
|
136
|
+
// if the given parameter is a Generator::State, return itself
|
137
|
+
if (klass.isInstance(opts)) return (GeneratorState)opts;
|
138
|
+
|
139
|
+
// if the given parameter is a Hash, pass it to the instantiator
|
140
|
+
if (context.getRuntime().getHash().isInstance(opts)) {
|
141
|
+
return (GeneratorState)klass.newInstance(context,
|
142
|
+
new IRubyObject[] {opts}, Block.NULL_BLOCK);
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
// for other values, return the safe prototype
|
147
|
+
return (GeneratorState)info.getSafeStatePrototype(context).dup();
|
148
|
+
}
|
149
|
+
|
150
|
+
/**
|
151
|
+
* <code>State#initialize(opts = {})</code>
|
152
|
+
*
|
153
|
+
* Instantiates a new <code>State</code> object, configured by <code>opts</code>.
|
154
|
+
*
|
155
|
+
* <code>opts</code> can have the following keys:
|
156
|
+
*
|
157
|
+
* <dl>
|
158
|
+
* <dt><code>:indent</code>
|
159
|
+
* <dd>a {@link RubyString String} used to indent levels (default: <code>""</code>)
|
160
|
+
* <dt><code>:space</code>
|
161
|
+
* <dd>a String that is put after a <code>':'</code> or <code>','</code>
|
162
|
+
* delimiter (default: <code>""</code>)
|
163
|
+
* <dt><code>:space_before</code>
|
164
|
+
* <dd>a String that is put before a <code>":"</code> pair delimiter
|
165
|
+
* (default: <code>""</code>)
|
166
|
+
* <dt><code>:object_nl</code>
|
167
|
+
* <dd>a String that is put at the end of a JSON object (default: <code>""</code>)
|
168
|
+
* <dt><code>:array_nl</code>
|
169
|
+
* <dd>a String that is put at the end of a JSON array (default: <code>""</code>)
|
170
|
+
* <dt><code>:allow_nan</code>
|
171
|
+
* <dd><code>true</code> if <code>NaN</code>, <code>Infinity</code>, and
|
172
|
+
* <code>-Infinity</code> should be generated, otherwise an exception is
|
173
|
+
* thrown if these values are encountered.
|
174
|
+
* This options defaults to <code>false</code>.
|
175
|
+
*/
|
176
|
+
@JRubyMethod(optional=1, visibility=Visibility.PRIVATE)
|
177
|
+
public IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
|
178
|
+
configure(context, args.length > 0 ? args[0] : null);
|
179
|
+
return this;
|
180
|
+
}
|
181
|
+
|
182
|
+
@JRubyMethod
|
183
|
+
public IRubyObject initialize_copy(ThreadContext context, IRubyObject vOrig) {
|
184
|
+
Ruby runtime = context.getRuntime();
|
185
|
+
if (!(vOrig instanceof GeneratorState)) {
|
186
|
+
throw runtime.newTypeError(vOrig, getType());
|
187
|
+
}
|
188
|
+
GeneratorState orig = (GeneratorState)vOrig;
|
189
|
+
this.indent = orig.indent;
|
190
|
+
this.space = orig.space;
|
191
|
+
this.spaceBefore = orig.spaceBefore;
|
192
|
+
this.objectNl = orig.objectNl;
|
193
|
+
this.arrayNl = orig.arrayNl;
|
194
|
+
this.maxNesting = orig.maxNesting;
|
195
|
+
this.allowNaN = orig.allowNaN;
|
196
|
+
this.asciiOnly = orig.asciiOnly;
|
197
|
+
this.quirksMode = orig.quirksMode;
|
198
|
+
this.bufferInitialLength = orig.bufferInitialLength;
|
199
|
+
this.depth = orig.depth;
|
200
|
+
return this;
|
201
|
+
}
|
202
|
+
|
203
|
+
/**
|
204
|
+
* Generates a valid JSON document from object <code>obj</code> and returns
|
205
|
+
* the result. If no valid JSON document can be created this method raises
|
206
|
+
* a GeneratorError exception.
|
207
|
+
*/
|
208
|
+
@JRubyMethod
|
209
|
+
public IRubyObject generate(ThreadContext context, IRubyObject obj) {
|
210
|
+
RubyString result = Generator.generateJson(context, obj, this);
|
211
|
+
if (!quirksMode && !objectOrArrayLiteral(result)) {
|
212
|
+
throw Utils.newException(context, Utils.M_GENERATOR_ERROR,
|
213
|
+
"only generation of JSON objects or arrays allowed");
|
214
|
+
}
|
215
|
+
RuntimeInfo info = RuntimeInfo.forRuntime(context.getRuntime());
|
216
|
+
if (info.encodingsSupported()) {
|
217
|
+
result.force_encoding(context, info.utf8.get());
|
218
|
+
}
|
219
|
+
return result;
|
220
|
+
}
|
221
|
+
|
222
|
+
/**
|
223
|
+
* Ensures the given string is in the form "[...]" or "{...}", being
|
224
|
+
* possibly surrounded by white space.
|
225
|
+
* The string's encoding must be ASCII-compatible.
|
226
|
+
* @param value
|
227
|
+
* @return
|
228
|
+
*/
|
229
|
+
private static boolean objectOrArrayLiteral(RubyString value) {
|
230
|
+
ByteList bl = value.getByteList();
|
231
|
+
int len = bl.length();
|
232
|
+
|
233
|
+
for (int pos = 0; pos < len - 1; pos++) {
|
234
|
+
int b = bl.get(pos);
|
235
|
+
if (Character.isWhitespace(b)) continue;
|
236
|
+
|
237
|
+
// match the opening brace
|
238
|
+
switch (b) {
|
239
|
+
case '[':
|
240
|
+
return matchClosingBrace(bl, pos, len, ']');
|
241
|
+
case '{':
|
242
|
+
return matchClosingBrace(bl, pos, len, '}');
|
243
|
+
default:
|
244
|
+
return false;
|
245
|
+
}
|
246
|
+
}
|
247
|
+
return false;
|
248
|
+
}
|
249
|
+
|
250
|
+
private static boolean matchClosingBrace(ByteList bl, int pos, int len,
|
251
|
+
int brace) {
|
252
|
+
for (int endPos = len - 1; endPos > pos; endPos--) {
|
253
|
+
int b = bl.get(endPos);
|
254
|
+
if (Character.isWhitespace(b)) continue;
|
255
|
+
return b == brace;
|
256
|
+
}
|
257
|
+
return false;
|
258
|
+
}
|
259
|
+
|
260
|
+
@JRubyMethod(name="[]", required=1)
|
261
|
+
public IRubyObject op_aref(ThreadContext context, IRubyObject vName) {
|
262
|
+
String name = vName.asJavaString();
|
263
|
+
if (getMetaClass().isMethodBound(name, true)) {
|
264
|
+
return send(context, vName, Block.NULL_BLOCK);
|
265
|
+
} else {
|
266
|
+
IRubyObject value = getInstanceVariables().getInstanceVariable("@" + name);
|
267
|
+
return value == null ? context.nil : value;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
@JRubyMethod(name="[]=", required=2)
|
272
|
+
public IRubyObject op_aset(ThreadContext context, IRubyObject vName, IRubyObject value) {
|
273
|
+
String name = vName.asJavaString();
|
274
|
+
String nameWriter = name + "=";
|
275
|
+
if (getMetaClass().isMethodBound(nameWriter, true)) {
|
276
|
+
return send(context, context.getRuntime().newString(nameWriter), value, Block.NULL_BLOCK);
|
277
|
+
} else {
|
278
|
+
getInstanceVariables().setInstanceVariable("@" + name, value);
|
279
|
+
}
|
280
|
+
return context.getRuntime().getNil();
|
281
|
+
}
|
282
|
+
|
283
|
+
public ByteList getIndent() {
|
284
|
+
return indent;
|
285
|
+
}
|
286
|
+
|
287
|
+
@JRubyMethod(name="indent")
|
288
|
+
public RubyString indent_get(ThreadContext context) {
|
289
|
+
return context.getRuntime().newString(indent);
|
290
|
+
}
|
291
|
+
|
292
|
+
@JRubyMethod(name="indent=")
|
293
|
+
public IRubyObject indent_set(ThreadContext context, IRubyObject indent) {
|
294
|
+
this.indent = prepareByteList(context, indent);
|
295
|
+
return indent;
|
296
|
+
}
|
297
|
+
|
298
|
+
public ByteList getSpace() {
|
299
|
+
return space;
|
300
|
+
}
|
301
|
+
|
302
|
+
@JRubyMethod(name="space")
|
303
|
+
public RubyString space_get(ThreadContext context) {
|
304
|
+
return context.getRuntime().newString(space);
|
305
|
+
}
|
306
|
+
|
307
|
+
@JRubyMethod(name="space=")
|
308
|
+
public IRubyObject space_set(ThreadContext context, IRubyObject space) {
|
309
|
+
this.space = prepareByteList(context, space);
|
310
|
+
return space;
|
311
|
+
}
|
312
|
+
|
313
|
+
public ByteList getSpaceBefore() {
|
314
|
+
return spaceBefore;
|
315
|
+
}
|
316
|
+
|
317
|
+
@JRubyMethod(name="space_before")
|
318
|
+
public RubyString space_before_get(ThreadContext context) {
|
319
|
+
return context.getRuntime().newString(spaceBefore);
|
320
|
+
}
|
321
|
+
|
322
|
+
@JRubyMethod(name="space_before=")
|
323
|
+
public IRubyObject space_before_set(ThreadContext context,
|
324
|
+
IRubyObject spaceBefore) {
|
325
|
+
this.spaceBefore = prepareByteList(context, spaceBefore);
|
326
|
+
return spaceBefore;
|
327
|
+
}
|
328
|
+
|
329
|
+
public ByteList getObjectNl() {
|
330
|
+
return objectNl;
|
331
|
+
}
|
332
|
+
|
333
|
+
@JRubyMethod(name="object_nl")
|
334
|
+
public RubyString object_nl_get(ThreadContext context) {
|
335
|
+
return context.getRuntime().newString(objectNl);
|
336
|
+
}
|
337
|
+
|
338
|
+
@JRubyMethod(name="object_nl=")
|
339
|
+
public IRubyObject object_nl_set(ThreadContext context,
|
340
|
+
IRubyObject objectNl) {
|
341
|
+
this.objectNl = prepareByteList(context, objectNl);
|
342
|
+
return objectNl;
|
343
|
+
}
|
344
|
+
|
345
|
+
public ByteList getArrayNl() {
|
346
|
+
return arrayNl;
|
347
|
+
}
|
348
|
+
|
349
|
+
@JRubyMethod(name="array_nl")
|
350
|
+
public RubyString array_nl_get(ThreadContext context) {
|
351
|
+
return context.getRuntime().newString(arrayNl);
|
352
|
+
}
|
353
|
+
|
354
|
+
@JRubyMethod(name="array_nl=")
|
355
|
+
public IRubyObject array_nl_set(ThreadContext context,
|
356
|
+
IRubyObject arrayNl) {
|
357
|
+
this.arrayNl = prepareByteList(context, arrayNl);
|
358
|
+
return arrayNl;
|
359
|
+
}
|
360
|
+
|
361
|
+
@JRubyMethod(name="check_circular?")
|
362
|
+
public RubyBoolean check_circular_p(ThreadContext context) {
|
363
|
+
return context.getRuntime().newBoolean(maxNesting != 0);
|
364
|
+
}
|
365
|
+
|
366
|
+
/**
|
367
|
+
* Returns the maximum level of nesting configured for this state.
|
368
|
+
*/
|
369
|
+
public int getMaxNesting() {
|
370
|
+
return maxNesting;
|
371
|
+
}
|
372
|
+
|
373
|
+
@JRubyMethod(name="max_nesting")
|
374
|
+
public RubyInteger max_nesting_get(ThreadContext context) {
|
375
|
+
return context.getRuntime().newFixnum(maxNesting);
|
376
|
+
}
|
377
|
+
|
378
|
+
@JRubyMethod(name="max_nesting=")
|
379
|
+
public IRubyObject max_nesting_set(IRubyObject max_nesting) {
|
380
|
+
maxNesting = RubyNumeric.fix2int(max_nesting);
|
381
|
+
return max_nesting;
|
382
|
+
}
|
383
|
+
|
384
|
+
public boolean allowNaN() {
|
385
|
+
return allowNaN;
|
386
|
+
}
|
387
|
+
|
388
|
+
@JRubyMethod(name="allow_nan?")
|
389
|
+
public RubyBoolean allow_nan_p(ThreadContext context) {
|
390
|
+
return context.getRuntime().newBoolean(allowNaN);
|
391
|
+
}
|
392
|
+
|
393
|
+
public boolean asciiOnly() {
|
394
|
+
return asciiOnly;
|
395
|
+
}
|
396
|
+
|
397
|
+
@JRubyMethod(name="ascii_only?")
|
398
|
+
public RubyBoolean ascii_only_p(ThreadContext context) {
|
399
|
+
return context.getRuntime().newBoolean(asciiOnly);
|
400
|
+
}
|
401
|
+
|
402
|
+
@JRubyMethod(name="quirks_mode")
|
403
|
+
public RubyBoolean quirks_mode_get(ThreadContext context) {
|
404
|
+
return context.getRuntime().newBoolean(quirksMode);
|
405
|
+
}
|
406
|
+
|
407
|
+
@JRubyMethod(name="quirks_mode=")
|
408
|
+
public IRubyObject quirks_mode_set(IRubyObject quirks_mode) {
|
409
|
+
quirksMode = quirks_mode.isTrue();
|
410
|
+
return quirks_mode.getRuntime().newBoolean(quirksMode);
|
411
|
+
}
|
412
|
+
|
413
|
+
@JRubyMethod(name="buffer_initial_length")
|
414
|
+
public RubyInteger buffer_initial_length_get(ThreadContext context) {
|
415
|
+
return context.getRuntime().newFixnum(bufferInitialLength);
|
416
|
+
}
|
417
|
+
|
418
|
+
@JRubyMethod(name="buffer_initial_length=")
|
419
|
+
public IRubyObject buffer_initial_length_set(IRubyObject buffer_initial_length) {
|
420
|
+
int newLength = RubyNumeric.fix2int(buffer_initial_length);
|
421
|
+
if (newLength > 0) bufferInitialLength = newLength;
|
422
|
+
return buffer_initial_length;
|
423
|
+
}
|
424
|
+
|
425
|
+
@JRubyMethod(name="quirks_mode?")
|
426
|
+
public RubyBoolean quirks_mode_p(ThreadContext context) {
|
427
|
+
return context.getRuntime().newBoolean(quirksMode);
|
428
|
+
}
|
429
|
+
|
430
|
+
public int getDepth() {
|
431
|
+
return depth;
|
432
|
+
}
|
433
|
+
|
434
|
+
@JRubyMethod(name="depth")
|
435
|
+
public RubyInteger depth_get(ThreadContext context) {
|
436
|
+
return context.getRuntime().newFixnum(depth);
|
437
|
+
}
|
438
|
+
|
439
|
+
@JRubyMethod(name="depth=")
|
440
|
+
public IRubyObject depth_set(IRubyObject vDepth) {
|
441
|
+
depth = RubyNumeric.fix2int(vDepth);
|
442
|
+
return vDepth;
|
443
|
+
}
|
444
|
+
|
445
|
+
private ByteList prepareByteList(ThreadContext context, IRubyObject value) {
|
446
|
+
RubyString str = value.convertToString();
|
447
|
+
RuntimeInfo info = RuntimeInfo.forRuntime(context.getRuntime());
|
448
|
+
if (info.encodingsSupported() && str.encoding(context) != info.utf8.get()) {
|
449
|
+
str = (RubyString)str.encode(context, info.utf8.get());
|
450
|
+
}
|
451
|
+
return str.getByteList().dup();
|
452
|
+
}
|
453
|
+
|
454
|
+
/**
|
455
|
+
* <code>State#configure(opts)</code>
|
456
|
+
*
|
457
|
+
* <p>Configures this State instance with the {@link RubyHash Hash}
|
458
|
+
* <code>opts</code>, and returns itself.
|
459
|
+
* @param vOpts The options hash
|
460
|
+
* @return The receiver
|
461
|
+
*/
|
462
|
+
@JRubyMethod(alias = "merge")
|
463
|
+
public IRubyObject configure(ThreadContext context, IRubyObject vOpts) {
|
464
|
+
OptionsReader opts = new OptionsReader(context, vOpts);
|
465
|
+
|
466
|
+
ByteList indent = opts.getString("indent");
|
467
|
+
if (indent != null) this.indent = indent;
|
468
|
+
|
469
|
+
ByteList space = opts.getString("space");
|
470
|
+
if (space != null) this.space = space;
|
471
|
+
|
472
|
+
ByteList spaceBefore = opts.getString("space_before");
|
473
|
+
if (spaceBefore != null) this.spaceBefore = spaceBefore;
|
474
|
+
|
475
|
+
ByteList arrayNl = opts.getString("array_nl");
|
476
|
+
if (arrayNl != null) this.arrayNl = arrayNl;
|
477
|
+
|
478
|
+
ByteList objectNl = opts.getString("object_nl");
|
479
|
+
if (objectNl != null) this.objectNl = objectNl;
|
480
|
+
|
481
|
+
maxNesting = opts.getInt("max_nesting", DEFAULT_MAX_NESTING);
|
482
|
+
allowNaN = opts.getBool("allow_nan", DEFAULT_ALLOW_NAN);
|
483
|
+
asciiOnly = opts.getBool("ascii_only", DEFAULT_ASCII_ONLY);
|
484
|
+
quirksMode = opts.getBool("quirks_mode", DEFAULT_QUIRKS_MODE);
|
485
|
+
bufferInitialLength = opts.getInt("buffer_initial_length", DEFAULT_BUFFER_INITIAL_LENGTH);
|
486
|
+
|
487
|
+
depth = opts.getInt("depth", 0);
|
488
|
+
|
489
|
+
return this;
|
490
|
+
}
|
491
|
+
|
492
|
+
/**
|
493
|
+
* <code>State#to_h()</code>
|
494
|
+
*
|
495
|
+
* <p>Returns the configuration instance variables as a hash, that can be
|
496
|
+
* passed to the configure method.
|
497
|
+
* @return the hash
|
498
|
+
*/
|
499
|
+
@JRubyMethod(alias = "to_hash")
|
500
|
+
public RubyHash to_h(ThreadContext context) {
|
501
|
+
Ruby runtime = context.getRuntime();
|
502
|
+
RubyHash result = RubyHash.newHash(runtime);
|
503
|
+
|
504
|
+
result.op_aset(context, runtime.newSymbol("indent"), indent_get(context));
|
505
|
+
result.op_aset(context, runtime.newSymbol("space"), space_get(context));
|
506
|
+
result.op_aset(context, runtime.newSymbol("space_before"), space_before_get(context));
|
507
|
+
result.op_aset(context, runtime.newSymbol("object_nl"), object_nl_get(context));
|
508
|
+
result.op_aset(context, runtime.newSymbol("array_nl"), array_nl_get(context));
|
509
|
+
result.op_aset(context, runtime.newSymbol("allow_nan"), allow_nan_p(context));
|
510
|
+
result.op_aset(context, runtime.newSymbol("ascii_only"), ascii_only_p(context));
|
511
|
+
result.op_aset(context, runtime.newSymbol("quirks_mode"), quirks_mode_p(context));
|
512
|
+
result.op_aset(context, runtime.newSymbol("max_nesting"), max_nesting_get(context));
|
513
|
+
result.op_aset(context, runtime.newSymbol("depth"), depth_get(context));
|
514
|
+
result.op_aset(context, runtime.newSymbol("buffer_initial_length"), buffer_initial_length_get(context));
|
515
|
+
for (String name: getInstanceVariableNameList()) {
|
516
|
+
result.op_aset(context, runtime.newSymbol(name.substring(1)), getInstanceVariables().getInstanceVariable(name));
|
517
|
+
}
|
518
|
+
return result;
|
519
|
+
}
|
520
|
+
|
521
|
+
public int increaseDepth() {
|
522
|
+
depth++;
|
523
|
+
checkMaxNesting();
|
524
|
+
return depth;
|
525
|
+
}
|
526
|
+
|
527
|
+
public int decreaseDepth() {
|
528
|
+
return --depth;
|
529
|
+
}
|
530
|
+
|
531
|
+
/**
|
532
|
+
* Checks if the current depth is allowed as per this state's options.
|
533
|
+
* @param context
|
534
|
+
* @param depth The corrent depth
|
535
|
+
*/
|
536
|
+
private void checkMaxNesting() {
|
537
|
+
if (maxNesting != 0 && depth > maxNesting) {
|
538
|
+
depth--;
|
539
|
+
throw Utils.newException(getRuntime().getCurrentContext(),
|
540
|
+
Utils.M_NESTING_ERROR, "nesting of " + depth + " is too deep");
|
541
|
+
}
|
542
|
+
}
|
543
|
+
}
|
@@ -0,0 +1,114 @@
|
|
1
|
+
/*
|
2
|
+
* This code is copyrighted work by Daniel Luz <dev at mernen dot com>.
|
3
|
+
*
|
4
|
+
* Distributed under the Ruby and GPLv2 licenses; see COPYING and GPL files
|
5
|
+
* for details.
|
6
|
+
*/
|
7
|
+
package json.ext;
|
8
|
+
|
9
|
+
import org.jruby.Ruby;
|
10
|
+
import org.jruby.RubyClass;
|
11
|
+
import org.jruby.RubyHash;
|
12
|
+
import org.jruby.RubyNumeric;
|
13
|
+
import org.jruby.RubyString;
|
14
|
+
import org.jruby.runtime.ThreadContext;
|
15
|
+
import org.jruby.runtime.builtin.IRubyObject;
|
16
|
+
import org.jruby.util.ByteList;
|
17
|
+
|
18
|
+
final class OptionsReader {
|
19
|
+
private final ThreadContext context;
|
20
|
+
private final Ruby runtime;
|
21
|
+
private final RubyHash opts;
|
22
|
+
private RuntimeInfo info;
|
23
|
+
|
24
|
+
OptionsReader(ThreadContext context, IRubyObject vOpts) {
|
25
|
+
this.context = context;
|
26
|
+
this.runtime = context.getRuntime();
|
27
|
+
if (vOpts == null || vOpts.isNil()) {
|
28
|
+
opts = null;
|
29
|
+
} else if (vOpts.respondsTo("to_hash")) {
|
30
|
+
opts = vOpts.convertToHash();
|
31
|
+
} else if (vOpts.respondsTo("to_h")) {
|
32
|
+
opts = vOpts.callMethod(context, "to_h").convertToHash();
|
33
|
+
} else {
|
34
|
+
opts = vOpts.convertToHash(); /* Should just raise the correct TypeError */
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
private RuntimeInfo getRuntimeInfo() {
|
39
|
+
if (info != null) return info;
|
40
|
+
info = RuntimeInfo.forRuntime(runtime);
|
41
|
+
return info;
|
42
|
+
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Efficiently looks up items with a {@link RubySymbol Symbol} key
|
46
|
+
* @param key The Symbol name to look up for
|
47
|
+
* @return The item in the {@link RubyHash Hash}, or <code>null</code>
|
48
|
+
* if not found
|
49
|
+
*/
|
50
|
+
IRubyObject get(String key) {
|
51
|
+
return opts == null ? null : opts.fastARef(runtime.newSymbol(key));
|
52
|
+
}
|
53
|
+
|
54
|
+
boolean getBool(String key, boolean defaultValue) {
|
55
|
+
IRubyObject value = get(key);
|
56
|
+
return value == null ? defaultValue : value.isTrue();
|
57
|
+
}
|
58
|
+
|
59
|
+
int getInt(String key, int defaultValue) {
|
60
|
+
IRubyObject value = get(key);
|
61
|
+
if (value == null) return defaultValue;
|
62
|
+
if (!value.isTrue()) return 0;
|
63
|
+
return RubyNumeric.fix2int(value);
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Reads the setting from the options hash. If no entry is set for this
|
68
|
+
* key or if it evaluates to <code>false</code>, returns null; attempts to
|
69
|
+
* coerce the value to {@link RubyString String} otherwise.
|
70
|
+
* @param key The Symbol name to look up for
|
71
|
+
* @return <code>null</code> if the key is not in the Hash or if
|
72
|
+
* its value evaluates to <code>false</code>
|
73
|
+
* @throws RaiseException <code>TypeError</code> if the value does not
|
74
|
+
* evaluate to <code>false</code> and can't be
|
75
|
+
* converted to string
|
76
|
+
*/
|
77
|
+
ByteList getString(String key) {
|
78
|
+
RubyString str = getString(key, null);
|
79
|
+
return str == null ? null : str.getByteList().dup();
|
80
|
+
}
|
81
|
+
|
82
|
+
RubyString getString(String key, RubyString defaultValue) {
|
83
|
+
IRubyObject value = get(key);
|
84
|
+
if (value == null || !value.isTrue()) return defaultValue;
|
85
|
+
|
86
|
+
RubyString str = value.convertToString();
|
87
|
+
RuntimeInfo info = getRuntimeInfo();
|
88
|
+
if (info.encodingsSupported() && str.encoding(context) != info.utf8.get()) {
|
89
|
+
str = (RubyString)str.encode(context, info.utf8.get());
|
90
|
+
}
|
91
|
+
return str;
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Reads the setting from the options hash. If it is <code>nil</code> or
|
96
|
+
* undefined, returns the default value given.
|
97
|
+
* If not, ensures it is a RubyClass instance and shares the same
|
98
|
+
* allocator as the default value (i.e. for the basic types which have
|
99
|
+
* their specific allocators, this ensures the passed value is
|
100
|
+
* a subclass of them).
|
101
|
+
*/
|
102
|
+
RubyClass getClass(String key, RubyClass defaultValue) {
|
103
|
+
IRubyObject value = get(key);
|
104
|
+
|
105
|
+
if (value == null || value.isNil()) return defaultValue;
|
106
|
+
return (RubyClass)value;
|
107
|
+
}
|
108
|
+
|
109
|
+
public RubyHash getHash(String key) {
|
110
|
+
IRubyObject value = get(key);
|
111
|
+
if (value == null || value.isNil()) return new RubyHash(runtime);
|
112
|
+
return (RubyHash) value;
|
113
|
+
}
|
114
|
+
}
|