putio 0.0.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +27 -0
- data/Rakefile +21 -0
- data/Readme.md +32 -0
- data/development/ruby/1.8/bin/convert_to_should_syntax +19 -0
- data/development/ruby/1.8/bin/edit_json.rb +19 -0
- data/development/ruby/1.8/bin/prettify_json.rb +19 -0
- data/development/ruby/1.8/cache/crack-0.1.8.gem +0 -0
- data/development/ruby/1.8/cache/fakeweb-1.3.0.gem +0 -0
- data/development/ruby/1.8/cache/hashie-0.4.0.gem +0 -0
- data/development/ruby/1.8/cache/json-1.4.6.gem +0 -0
- data/development/ruby/1.8/cache/omg-0.0.6.gem +0 -0
- data/development/ruby/1.8/cache/shoulda-2.11.3.gem +0 -0
- data/development/ruby/1.8/gems/crack-0.1.8/.gitignore +6 -0
- data/development/ruby/1.8/gems/crack-0.1.8/History +25 -0
- data/development/ruby/1.8/gems/crack-0.1.8/LICENSE +20 -0
- data/development/ruby/1.8/gems/crack-0.1.8/README.rdoc +42 -0
- data/development/ruby/1.8/gems/crack-0.1.8/Rakefile +52 -0
- data/development/ruby/1.8/gems/crack-0.1.8/crack.gemspec +63 -0
- data/development/ruby/1.8/gems/crack-0.1.8/lib/crack/core_extensions.rb +128 -0
- data/development/ruby/1.8/gems/crack-0.1.8/lib/crack/json.rb +68 -0
- data/development/ruby/1.8/gems/crack-0.1.8/lib/crack/xml.rb +214 -0
- data/development/ruby/1.8/gems/crack-0.1.8/lib/crack.rb +8 -0
- data/development/ruby/1.8/gems/crack-0.1.8/test/crack_test.rb +4 -0
- data/development/ruby/1.8/gems/crack-0.1.8/test/data/twittersearch-firefox.json +1 -0
- data/development/ruby/1.8/gems/crack-0.1.8/test/data/twittersearch-ie.json +1 -0
- data/development/ruby/1.8/gems/crack-0.1.8/test/hash_test.rb +56 -0
- data/development/ruby/1.8/gems/crack-0.1.8/test/json_test.rb +69 -0
- data/development/ruby/1.8/gems/crack-0.1.8/test/string_test.rb +31 -0
- data/development/ruby/1.8/gems/crack-0.1.8/test/test_helper.rb +12 -0
- data/development/ruby/1.8/gems/crack-0.1.8/test/xml_test.rb +489 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/.autotest +5 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/.gitignore +7 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/CHANGELOG +215 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/LICENSE.txt +19 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/README.rdoc +189 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/Rakefile +67 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/fakeweb.gemspec +126 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/ext/net_http.rb +72 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/registry.rb +127 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/responder.rb +122 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/response.rb +10 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/stub_socket.rb +15 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/utility.rb +87 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web.rb +215 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fakeweb.rb +2 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/fixtures/google_response_from_curl +12 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/fixtures/google_response_with_transfer_encoding +17 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/fixtures/google_response_without_transfer_encoding +11 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/fixtures/test_example.txt +1 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/fixtures/test_txt_file +3 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_allow_net_connect.rb +168 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_deprecations.rb +54 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_fake_authentication.rb +92 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_fake_web.rb +590 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_fake_web_open_uri.rb +58 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_helper.rb +90 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_last_request.rb +29 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_missing_open_uri.rb +25 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_missing_pathname.rb +37 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_other_net_http_libraries.rb +36 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_precedence.rb +79 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_query_string.rb +45 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_regexes.rb +157 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_response_headers.rb +79 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_trailing_slashes.rb +53 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_utility.rb +83 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/History.txt +59 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/Manifest.txt +7 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/README.txt +54 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/Rakefile +103 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/lib/net_fix.rb +160 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/lib/right_http_connection.rb +435 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/setup.rb +1585 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/.document +5 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/.gitignore +5 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/LICENSE +20 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/README.rdoc +70 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/Rakefile +62 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/VERSION +1 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/lib/samuel/net_http.rb +10 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/lib/samuel/request.rb +96 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/lib/samuel.rb +52 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/samuel.gemspec +69 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/test/request_test.rb +193 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/test/samuel_test.rb +42 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/test/test_helper.rb +66 -0
- data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/test/thread_test.rb +32 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/.document +5 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/.gitignore +7 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/Gemfile +12 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/Gemfile.lock +24 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/LICENSE +20 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/README.rdoc +119 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/Rakefile +47 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/VERSION +1 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/hashie.gemspec +71 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/clash.rb +86 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/dash.rb +111 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/hash.rb +24 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/hash_extensions.rb +49 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/mash.rb +178 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/trash.rb +55 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie.rb +9 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/spec/hashie/clash_spec.rb +42 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/spec/hashie/dash_spec.rb +156 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/spec/hashie/hash_spec.rb +22 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/spec/hashie/mash_spec.rb +241 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/spec/hashie/trash_spec.rb +70 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/spec/spec.opts +3 -0
- data/development/ruby/1.8/gems/hashie-0.4.0/spec/spec_helper.rb +13 -0
- data/development/ruby/1.8/gems/json-1.4.6/.require_paths +4 -0
- data/development/ruby/1.8/gems/json-1.4.6/CHANGES +179 -0
- data/development/ruby/1.8/gems/json-1.4.6/COPYING +58 -0
- data/development/ruby/1.8/gems/json-1.4.6/GPL +340 -0
- data/development/ruby/1.8/gems/json-1.4.6/README +356 -0
- data/development/ruby/1.8/gems/json-1.4.6/Rakefile +292 -0
- data/development/ruby/1.8/gems/json-1.4.6/TODO +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/VERSION +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/generator2_benchmark.rb +222 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/generator_benchmark.rb +224 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/ohai.json +1216 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/ohai.ruby +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/parser2_benchmark.rb +251 -0
- data/development/ruby/1.8/gems/json-1.4.6/benchmarks/parser_benchmark.rb +259 -0
- data/development/ruby/1.8/gems/json-1.4.6/bin/edit_json.rb +9 -0
- data/development/ruby/1.8/gems/json-1.4.6/bin/prettify_json.rb +75 -0
- data/development/ruby/1.8/gems/json-1.4.6/data/example.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/data/index.html +38 -0
- data/development/ruby/1.8/gems/json-1.4.6/data/prototype.js +4184 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/Makefile +157 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/extconf.rb +20 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/generator.bundle +0 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/generator.c +1417 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/generator.h +197 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/generator.o +0 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/mkmf.log +10 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/json/ext/generator.bundle +0 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/json/ext/parser.bundle +0 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/Makefile +157 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/extconf.rb +15 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/mkmf.log +10 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/parser.bundle +0 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/parser.c +1935 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/parser.h +71 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/parser.o +0 -0
- data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/parser.rl +792 -0
- data/development/ruby/1.8/gems/json-1.4.6/install.rb +26 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/Array.xpm +21 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/FalseClass.xpm +21 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/Hash.xpm +21 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/Key.xpm +73 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/NilClass.xpm +21 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/Numeric.xpm +28 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/String.xpm +96 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/TrueClass.xpm +21 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/add/core.rb +148 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/add/rails.rb +58 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/common.rb +391 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/editor.rb +1371 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/ext.rb +15 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/json.xpm +1499 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/pure/generator.rb +439 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/pure/parser.rb +309 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/pure.rb +77 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json/version.rb +8 -0
- data/development/ruby/1.8/gems/json-1.4.6/lib/json.rb +10 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail1.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail10.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail11.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail12.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail13.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail14.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail18.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail19.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail2.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail20.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail21.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail22.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail23.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail24.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail25.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail27.json +2 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail28.json +2 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail3.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail4.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail5.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail6.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail7.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail8.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail9.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass1.json +56 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass15.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass16.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass17.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass2.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass26.json +1 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass3.json +6 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/test_json.rb +394 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_addition.rb +162 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_encoding.rb +68 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_fixtures.rb +34 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_generate.rb +181 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_rails.rb +144 -0
- data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_unicode.rb +76 -0
- data/development/ruby/1.8/gems/json-1.4.6/tools/fuzz.rb +139 -0
- data/development/ruby/1.8/gems/json-1.4.6/tools/server.rb +61 -0
- data/development/ruby/1.8/gems/omg-0.0.6/.document +5 -0
- data/development/ruby/1.8/gems/omg-0.0.6/.gitignore +21 -0
- data/development/ruby/1.8/gems/omg-0.0.6/LICENSE +20 -0
- data/development/ruby/1.8/gems/omg-0.0.6/README.rdoc +35 -0
- data/development/ruby/1.8/gems/omg-0.0.6/Rakefile +52 -0
- data/development/ruby/1.8/gems/omg-0.0.6/TODO +1 -0
- data/development/ruby/1.8/gems/omg-0.0.6/VERSION +1 -0
- data/development/ruby/1.8/gems/omg-0.0.6/lib/omg.rb +43 -0
- data/development/ruby/1.8/gems/omg-0.0.6/omg.gemspec +53 -0
- data/development/ruby/1.8/gems/omg-0.0.6/test/helper.rb +10 -0
- data/development/ruby/1.8/gems/omg-0.0.6/test/test_omg.rb +7 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/CONTRIBUTION_GUIDELINES.rdoc +10 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/MIT-LICENSE +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/README.rdoc +154 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/Rakefile +70 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/bin/convert_to_should_syntax +42 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/macros.rb +221 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/assign_to_matcher.rb +112 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/filter_param_matcher.rb +74 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/redirect_to_matcher.rb +62 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/render_template_matcher.rb +54 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/render_with_layout_matcher.rb +99 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/respond_with_content_type_matcher.rb +74 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/respond_with_matcher.rb +85 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/route_matcher.rb +93 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/set_session_matcher.rb +98 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb +100 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers.rb +39 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller.rb +34 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_mailer/assertions.rb +42 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_mailer/matchers/have_sent_email.rb +110 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_mailer/matchers.rb +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_mailer.rb +13 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/assertions.rb +69 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/helpers.rb +32 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/macros.rb +457 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/allow_mass_assignment_of_matcher.rb +83 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/allow_value_matcher.rb +110 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/association_matcher.rb +226 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/ensure_inclusion_of_matcher.rb +87 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/ensure_length_of_matcher.rb +141 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/have_db_column_matcher.rb +169 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/have_db_index_matcher.rb +112 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/have_readonly_attribute_matcher.rb +59 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validate_acceptance_of_matcher.rb +41 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validate_format_of_matcher.rb +65 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validate_numericality_of_matcher.rb +39 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validate_presence_of_matcher.rb +60 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validate_uniqueness_of_matcher.rb +148 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validation_matcher.rb +56 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers.rb +42 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record.rb +16 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/assertions.rb +79 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/autoload_macros.rb +46 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/context.rb +433 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/helpers.rb +8 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/integrations/rspec.rb +13 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/integrations/rspec2.rb +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/integrations/test_unit.rb +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/macros.rb +161 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/private_helpers.rb +13 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb +14 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/rails.rb +8 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/tasks/list_tests.rake +29 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/tasks/yaml_to_shoulda.rake +28 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/tasks.rb +3 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/version.rb +4 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda.rb +9 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/rails/init.rb +8 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/README +36 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/fail_macros.rb +55 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/addresses.yml +3 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/friendships.yml +0 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/posts.yml +5 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/products.yml +0 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/taggings.yml +0 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/tags.yml +9 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/users.yml +6 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/functional/posts_controller_test.rb +121 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/functional/users_controller_test.rb +19 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/action_mailer/have_sent_email_test.rb +70 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/allow_mass_assignment_of_matcher_test.rb +74 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/allow_value_matcher_test.rb +64 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/association_matcher_test.rb +263 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/ensure_inclusion_of_matcher_test.rb +81 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/ensure_length_of_matcher_test.rb +158 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/have_db_column_matcher_test.rb +169 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/have_db_index_matcher_test.rb +91 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/have_readonly_attributes_matcher_test.rb +29 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/validate_acceptance_of_matcher_test.rb +44 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/validate_format_of_matcher_test.rb +39 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/validate_numericality_of_matcher_test.rb +52 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/validate_presence_of_matcher_test.rb +86 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/validate_uniqueness_of_matcher_test.rb +147 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/assign_to_matcher_test.rb +45 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/filter_param_matcher_test.rb +40 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/redirect_to_matcher_test.rb +37 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb +37 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/render_with_layout_matcher_test.rb +47 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/respond_with_content_type_matcher_test.rb +32 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/respond_with_matcher_test.rb +96 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/route_matcher_test.rb +75 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/set_session_matcher_test.rb +48 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/set_the_flash_matcher.rb +95 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/autoload_macro_test.rb +18 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/context_test.rb +372 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/convert_to_should_syntax_test.rb +63 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/helpers_test.rb +317 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/private_helpers_test.rb +32 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/should_test.rb +271 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_model_builder.rb +130 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/controllers/application_controller.rb +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/controllers/posts_controller.rb +87 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/controllers/users_controller.rb +84 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/helpers/application_helper.rb +3 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/helpers/posts_helper.rb +2 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/helpers/users_helper.rb +2 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/address.rb +7 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/flea.rb +11 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/friendship.rb +4 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/notifier.rb +8 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/pets/cat.rb +7 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/pets/dog.rb +10 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/post.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/product.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/profile.rb +2 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/registration.rb +2 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/tag.rb +8 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/tagging.rb +4 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/treat.rb +3 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/user.rb +32 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/layouts/posts.rhtml +19 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/layouts/users.rhtml +17 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/layouts/wide.html.erb +1 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/notifier/the_email.html.erb +1 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/posts/edit.rhtml +27 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/posts/index.rhtml +25 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/posts/new.rhtml +26 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/posts/show.rhtml +18 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/users/edit.rhtml +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/users/index.rhtml +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/users/new.rhtml +21 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/users/show.rhtml +13 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/boot.rb +110 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/database.yml +4 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/environment.rb +17 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/environments/test.rb +23 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/initializers/new_rails_defaults.rb +15 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/initializers/shoulda.rb +8 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/routes.rb +6 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/001_create_users.rb +19 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/002_create_posts.rb +13 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/003_create_taggings.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/004_create_tags.rb +11 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/005_create_dogs.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/006_create_addresses.rb +14 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/007_create_fleas.rb +11 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/008_create_dogs_fleas.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/009_create_products.rb +17 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/010_create_friendships.rb +14 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/011_create_treats.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/20090506203502_create_profiles.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/20090506203536_create_registrations.rb +14 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/20090513104502_create_cats.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/schema.rb +0 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/log/test.log +50381 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/public/404.html +30 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/public/422.html +30 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/public/500.html +30 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/script/console +3 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/script/generate +3 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/test/shoulda_macros/custom_macro.rb +6 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/vendor/gems/gem_with_macro-0.0.1/shoulda_macros/gem_macro.rb +6 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/vendor/plugins/plugin_with_macro/shoulda_macros/plugin_macro.rb +6 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_test_helper.rb +6 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_model_builder.rb +118 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/Gemfile +28 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/README +244 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/Rakefile +10 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/controllers/application_controller.rb +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/controllers/posts_controller.rb +87 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/controllers/users_controller.rb +82 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/helpers/application_helper.rb +2 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/address.rb +7 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/flea.rb +11 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/friendship.rb +4 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/notifier.rb +8 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/pets/cat.rb +7 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/pets/dog.rb +10 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/post.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/product.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/profile.rb +2 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/registration.rb +2 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/tag.rb +8 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/tagging.rb +4 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/treat.rb +3 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/user.rb +32 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/layouts/application.html.erb +14 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/layouts/posts.rhtml +19 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/layouts/users.rhtml +17 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/layouts/wide.html.erb +1 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/notifier/the_email.html.erb +1 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/posts/edit.rhtml +27 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/posts/index.rhtml +25 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/posts/new.rhtml +24 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/posts/show.rhtml +18 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/users/edit.rhtml +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/users/index.rhtml +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/users/new.rhtml +21 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/users/show.rhtml +13 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/application.rb +46 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/boot.rb +6 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/database.yml +22 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/environment.rb +5 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/environments/development.rb +19 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/environments/production.rb +42 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/environments/test.rb +32 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/initializers/backtrace_silencers.rb +7 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/initializers/inflections.rb +10 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/initializers/mime_types.rb +5 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/initializers/secret_token.rb +7 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/initializers/session_store.rb +8 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/locales/en.yml +5 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/routes.rb +4 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config.ru +4 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/001_create_users.rb +19 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/002_create_posts.rb +13 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/003_create_taggings.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/004_create_tags.rb +11 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/005_create_dogs.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/006_create_addresses.rb +14 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/007_create_fleas.rb +11 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/008_create_dogs_fleas.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/009_create_products.rb +17 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/010_create_friendships.rb +14 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/011_create_treats.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/20090506203502_create_profiles.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/20090506203536_create_registrations.rb +14 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/20090513104502_create_cats.rb +12 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/seeds.rb +7 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/test.sqlite3 +0 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/log/test.log +10834 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/404.html +26 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/422.html +26 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/500.html +26 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/favicon.ico +0 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/images/rails.png +0 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/index.html +279 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/application.js +2 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/controls.js +965 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/dragdrop.js +974 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/effects.js +1123 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/prototype.js +4874 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/rails.js +118 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/robots.txt +5 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/script/rails +9 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/test/performance/browsing_test.rb +9 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/test/test_helper.rb +13 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_test_helper.rb +6 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/rspec_test.rb +207 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/test_helper.rb +36 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/address_test.rb +10 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/cat_test.rb +7 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/dog_test.rb +9 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/flea_test.rb +14 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/friendship_test.rb +6 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/post_test.rb +15 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/product_test.rb +23 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/tag_test.rb +11 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/tagging_test.rb +6 -0
- data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/user_test.rb +46 -0
- data/development/ruby/1.8/specifications/crack-0.1.8.gemspec +30 -0
- data/development/ruby/1.8/specifications/fakeweb-1.3.0.gemspec +34 -0
- data/development/ruby/1.8/specifications/hashie-0.4.0.gemspec +33 -0
- data/development/ruby/1.8/specifications/json-1.4.6.gemspec +34 -0
- data/development/ruby/1.8/specifications/omg-0.0.6.gemspec +30 -0
- data/development/ruby/1.8/specifications/shoulda-2.11.3.gemspec +32 -0
- data/lib/putio/client.rb +74 -0
- data/lib/putio/putio.rb +5 -0
- data/lib/putio.rb +4 -0
- data/putio.gemspec +25 -0
- data/test/fixtures/user_friends.json +1 -0
- data/test/fixtures/user_info.json +1 -0
- data/test/test_helper.rb +19 -0
- data/test/units/client_test.rb +11 -0
- data/test/units/putio_test.rb +11 -0
- data/test/units/user_test.rb +39 -0
- metadata +675 -0
@@ -0,0 +1,181 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
require 'test/unit'
|
5
|
+
case ENV['JSON']
|
6
|
+
when 'pure' then require 'json/pure'
|
7
|
+
when 'ext' then require 'json/ext'
|
8
|
+
else require 'json'
|
9
|
+
end
|
10
|
+
|
11
|
+
class TC_JSONGenerate < Test::Unit::TestCase
|
12
|
+
include JSON
|
13
|
+
|
14
|
+
def setup
|
15
|
+
@hash = {
|
16
|
+
'a' => 2,
|
17
|
+
'b' => 3.141,
|
18
|
+
'c' => 'c',
|
19
|
+
'd' => [ 1, "b", 3.14 ],
|
20
|
+
'e' => { 'foo' => 'bar' },
|
21
|
+
'g' => "\"\0\037",
|
22
|
+
'h' => 1000.0,
|
23
|
+
'i' => 0.001
|
24
|
+
}
|
25
|
+
@json2 = '{"a":2,"b":3.141,"c":"c","d":[1,"b",3.14],"e":{"foo":"bar"},' +
|
26
|
+
'"g":"\\"\\u0000\\u001f","h":1000.0,"i":0.001}'
|
27
|
+
@json3 = <<'EOT'.chomp
|
28
|
+
{
|
29
|
+
"a": 2,
|
30
|
+
"b": 3.141,
|
31
|
+
"c": "c",
|
32
|
+
"d": [
|
33
|
+
1,
|
34
|
+
"b",
|
35
|
+
3.14
|
36
|
+
],
|
37
|
+
"e": {
|
38
|
+
"foo": "bar"
|
39
|
+
},
|
40
|
+
"g": "\"\u0000\u001f",
|
41
|
+
"h": 1000.0,
|
42
|
+
"i": 0.001
|
43
|
+
}
|
44
|
+
EOT
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_generate
|
48
|
+
json = generate(@hash)
|
49
|
+
assert_equal(JSON.parse(@json2), JSON.parse(json))
|
50
|
+
parsed_json = parse(json)
|
51
|
+
assert_equal(@hash, parsed_json)
|
52
|
+
json = generate({1=>2})
|
53
|
+
assert_equal('{"1":2}', json)
|
54
|
+
parsed_json = parse(json)
|
55
|
+
assert_equal({"1"=>2}, parsed_json)
|
56
|
+
assert_raise(GeneratorError) { generate(666) }
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_generate_pretty
|
60
|
+
json = pretty_generate(@hash)
|
61
|
+
assert_equal(JSON.parse(@json3), JSON.parse(json))
|
62
|
+
parsed_json = parse(json)
|
63
|
+
assert_equal(@hash, parsed_json)
|
64
|
+
json = pretty_generate({1=>2})
|
65
|
+
assert_equal(<<'EOT'.chomp, json)
|
66
|
+
{
|
67
|
+
"1": 2
|
68
|
+
}
|
69
|
+
EOT
|
70
|
+
parsed_json = parse(json)
|
71
|
+
assert_equal({"1"=>2}, parsed_json)
|
72
|
+
assert_raise(GeneratorError) { pretty_generate(666) }
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_fast_generate
|
76
|
+
json = fast_generate(@hash)
|
77
|
+
assert_equal(JSON.parse(@json2), JSON.parse(json))
|
78
|
+
parsed_json = parse(json)
|
79
|
+
assert_equal(@hash, parsed_json)
|
80
|
+
json = fast_generate({1=>2})
|
81
|
+
assert_equal('{"1":2}', json)
|
82
|
+
parsed_json = parse(json)
|
83
|
+
assert_equal({"1"=>2}, parsed_json)
|
84
|
+
assert_raise(GeneratorError) { fast_generate(666) }
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_states
|
88
|
+
json = generate({1=>2}, nil)
|
89
|
+
assert_equal('{"1":2}', json)
|
90
|
+
s = JSON.state.new
|
91
|
+
assert s.check_circular?
|
92
|
+
assert s[:check_circular?]
|
93
|
+
h = { 1=>2 }
|
94
|
+
h[3] = h
|
95
|
+
assert_raises(JSON::NestingError) { generate(h) }
|
96
|
+
assert_raises(JSON::NestingError) { generate(h, s) }
|
97
|
+
s = JSON.state.new
|
98
|
+
a = [ 1, 2 ]
|
99
|
+
a << a
|
100
|
+
assert_raises(JSON::NestingError) { generate(a, s) }
|
101
|
+
assert s.check_circular?
|
102
|
+
assert s[:check_circular?]
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_pretty_state
|
106
|
+
state = PRETTY_STATE_PROTOTYPE.dup
|
107
|
+
assert_equal({
|
108
|
+
:allow_nan => false,
|
109
|
+
:array_nl => "\n",
|
110
|
+
:ascii_only => false,
|
111
|
+
:depth => 0,
|
112
|
+
:indent => " ",
|
113
|
+
:max_nesting => 19,
|
114
|
+
:object_nl => "\n",
|
115
|
+
:space => " ",
|
116
|
+
:space_before => "",
|
117
|
+
}.sort_by { |n,| n.to_s }, state.to_h.sort_by { |n,| n.to_s })
|
118
|
+
end
|
119
|
+
|
120
|
+
def test_safe_state
|
121
|
+
state = SAFE_STATE_PROTOTYPE.dup
|
122
|
+
assert_equal({
|
123
|
+
:allow_nan => false,
|
124
|
+
:array_nl => "",
|
125
|
+
:ascii_only => false,
|
126
|
+
:depth => 0,
|
127
|
+
:indent => "",
|
128
|
+
:max_nesting => 19,
|
129
|
+
:object_nl => "",
|
130
|
+
:space => "",
|
131
|
+
:space_before => "",
|
132
|
+
}.sort_by { |n,| n.to_s }, state.to_h.sort_by { |n,| n.to_s })
|
133
|
+
end
|
134
|
+
|
135
|
+
def test_fast_state
|
136
|
+
state = FAST_STATE_PROTOTYPE.dup
|
137
|
+
assert_equal({
|
138
|
+
:allow_nan => false,
|
139
|
+
:array_nl => "",
|
140
|
+
:ascii_only => false,
|
141
|
+
:depth => 0,
|
142
|
+
:indent => "",
|
143
|
+
:max_nesting => 0,
|
144
|
+
:object_nl => "",
|
145
|
+
:space => "",
|
146
|
+
:space_before => "",
|
147
|
+
}.sort_by { |n,| n.to_s }, state.to_h.sort_by { |n,| n.to_s })
|
148
|
+
end
|
149
|
+
|
150
|
+
def test_allow_nan
|
151
|
+
assert_raises(GeneratorError) { generate([JSON::NaN]) }
|
152
|
+
assert_equal '[NaN]', generate([JSON::NaN], :allow_nan => true)
|
153
|
+
assert_raises(GeneratorError) { fast_generate([JSON::NaN]) }
|
154
|
+
assert_raises(GeneratorError) { pretty_generate([JSON::NaN]) }
|
155
|
+
assert_equal "[\n NaN\n]", pretty_generate([JSON::NaN], :allow_nan => true)
|
156
|
+
assert_raises(GeneratorError) { generate([JSON::Infinity]) }
|
157
|
+
assert_equal '[Infinity]', generate([JSON::Infinity], :allow_nan => true)
|
158
|
+
assert_raises(GeneratorError) { fast_generate([JSON::Infinity]) }
|
159
|
+
assert_raises(GeneratorError) { pretty_generate([JSON::Infinity]) }
|
160
|
+
assert_equal "[\n Infinity\n]", pretty_generate([JSON::Infinity], :allow_nan => true)
|
161
|
+
assert_raises(GeneratorError) { generate([JSON::MinusInfinity]) }
|
162
|
+
assert_equal '[-Infinity]', generate([JSON::MinusInfinity], :allow_nan => true)
|
163
|
+
assert_raises(GeneratorError) { fast_generate([JSON::MinusInfinity]) }
|
164
|
+
assert_raises(GeneratorError) { pretty_generate([JSON::MinusInfinity]) }
|
165
|
+
assert_equal "[\n -Infinity\n]", pretty_generate([JSON::MinusInfinity], :allow_nan => true)
|
166
|
+
end
|
167
|
+
|
168
|
+
def test_depth
|
169
|
+
ary = []; ary << ary
|
170
|
+
assert_equal 0, JSON::SAFE_STATE_PROTOTYPE.depth
|
171
|
+
assert_raises(JSON::NestingError) { JSON.generate(ary) }
|
172
|
+
assert_equal 0, JSON::SAFE_STATE_PROTOTYPE.depth
|
173
|
+
assert_equal 0, JSON::PRETTY_STATE_PROTOTYPE.depth
|
174
|
+
assert_raises(JSON::NestingError) { JSON.pretty_generate(ary) }
|
175
|
+
assert_equal 0, JSON::PRETTY_STATE_PROTOTYPE.depth
|
176
|
+
s = JSON.state.new
|
177
|
+
assert_equal 0, s.depth
|
178
|
+
assert_raises(JSON::NestingError) { ary.to_json(s) }
|
179
|
+
assert_equal 19, s.depth
|
180
|
+
end
|
181
|
+
end
|
@@ -0,0 +1,144 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
require 'test/unit'
|
5
|
+
case ENV['JSON']
|
6
|
+
when 'pure' then require 'json/pure'
|
7
|
+
when 'ext' then require 'json/ext'
|
8
|
+
else require 'json'
|
9
|
+
end
|
10
|
+
require 'json/add/rails'
|
11
|
+
require 'date'
|
12
|
+
|
13
|
+
class TC_JSONRails < Test::Unit::TestCase
|
14
|
+
include JSON
|
15
|
+
|
16
|
+
class A
|
17
|
+
def initialize(a)
|
18
|
+
@a = a
|
19
|
+
end
|
20
|
+
|
21
|
+
attr_reader :a
|
22
|
+
|
23
|
+
def ==(other)
|
24
|
+
a == other.a
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.json_create(object)
|
28
|
+
new(*object['args'])
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_json(*args)
|
32
|
+
{
|
33
|
+
'json_class' => self.class.name,
|
34
|
+
'args' => [ @a ],
|
35
|
+
}.to_json(*args)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class B
|
40
|
+
def self.json_creatable?
|
41
|
+
false
|
42
|
+
end
|
43
|
+
|
44
|
+
def to_json(*args)
|
45
|
+
{
|
46
|
+
'json_class' => self.class.name,
|
47
|
+
}.to_json(*args)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class C
|
52
|
+
def to_json(*args)
|
53
|
+
{
|
54
|
+
'json_class' => 'TC_JSONRails::Nix',
|
55
|
+
}.to_json(*args)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class D
|
60
|
+
def initialize
|
61
|
+
@foo = 666
|
62
|
+
end
|
63
|
+
|
64
|
+
attr_reader :foo
|
65
|
+
|
66
|
+
def ==(other)
|
67
|
+
foo == other.foo
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_extended_json
|
72
|
+
a = A.new(666)
|
73
|
+
assert A.json_creatable?
|
74
|
+
assert_equal 666, a.a
|
75
|
+
json = generate(a)
|
76
|
+
a_again = JSON.parse(json)
|
77
|
+
assert_kind_of a.class, a_again
|
78
|
+
assert_equal a, a_again
|
79
|
+
assert_equal 666, a_again.a
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_extended_json_generic_object
|
83
|
+
d = D.new
|
84
|
+
assert D.json_creatable?
|
85
|
+
assert_equal 666, d.foo
|
86
|
+
json = generate(d)
|
87
|
+
d_again = JSON.parse(json)
|
88
|
+
assert_kind_of d.class, d_again
|
89
|
+
assert_equal d, d_again
|
90
|
+
assert_equal 666, d_again.foo
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_extended_json_disabled
|
94
|
+
a = A.new(666)
|
95
|
+
assert A.json_creatable?
|
96
|
+
json = generate(a)
|
97
|
+
a_again = JSON.parse(json, :create_additions => true)
|
98
|
+
assert_kind_of a.class, a_again
|
99
|
+
assert_equal a, a_again
|
100
|
+
a_hash = JSON.parse(json, :create_additions => false)
|
101
|
+
assert_kind_of Hash, a_hash
|
102
|
+
assert_equal(
|
103
|
+
{"args"=>[666], "json_class"=>"TC_JSONRails::A"}.sort_by { |k,| k },
|
104
|
+
a_hash.sort_by { |k,| k }
|
105
|
+
)
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_extended_json_fail1
|
109
|
+
b = B.new
|
110
|
+
assert !B.json_creatable?
|
111
|
+
json = generate(b)
|
112
|
+
assert_equal({ 'json_class' => B.name }, JSON.parse(json))
|
113
|
+
end
|
114
|
+
|
115
|
+
def test_extended_json_fail2
|
116
|
+
c = C.new # with rails addition all objects are theoretically creatable
|
117
|
+
assert C.json_creatable?
|
118
|
+
json = generate(c)
|
119
|
+
assert_raises(ArgumentError, NameError) { JSON.parse(json) }
|
120
|
+
end
|
121
|
+
|
122
|
+
def test_raw_strings
|
123
|
+
raw = ''
|
124
|
+
raw.respond_to?(:encode!) and raw.encode!(Encoding::ASCII_8BIT)
|
125
|
+
raw_array = []
|
126
|
+
for i in 0..255
|
127
|
+
raw << i
|
128
|
+
raw_array << i
|
129
|
+
end
|
130
|
+
json = raw.to_json_raw
|
131
|
+
json_raw_object = raw.to_json_raw_object
|
132
|
+
hash = { 'json_class' => 'String', 'raw'=> raw_array }
|
133
|
+
assert_equal hash, json_raw_object
|
134
|
+
assert_match /\A\{.*\}\Z/, json
|
135
|
+
assert_match /"json_class":"String"/, json
|
136
|
+
assert_match /"raw":\[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255\]/, json
|
137
|
+
raw_again = JSON.parse(json)
|
138
|
+
assert_equal raw, raw_again
|
139
|
+
end
|
140
|
+
|
141
|
+
def test_symbol
|
142
|
+
assert_equal '"foo"', :foo.to_json # we don't want an object here
|
143
|
+
end
|
144
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
require 'test/unit'
|
5
|
+
case ENV['JSON']
|
6
|
+
when 'pure' then require 'json/pure'
|
7
|
+
when 'ext' then require 'json/ext'
|
8
|
+
else require 'json'
|
9
|
+
end
|
10
|
+
|
11
|
+
class TC_JSONUnicode < Test::Unit::TestCase
|
12
|
+
include JSON
|
13
|
+
|
14
|
+
def test_unicode
|
15
|
+
assert_equal '""', ''.to_json
|
16
|
+
assert_equal '"\\b"', "\b".to_json
|
17
|
+
assert_equal '"\u0001"', 0x1.chr.to_json
|
18
|
+
assert_equal '"\u001f"', 0x1f.chr.to_json
|
19
|
+
assert_equal '" "', ' '.to_json
|
20
|
+
assert_equal "\"#{0x7f.chr}\"", 0x7f.chr.to_json
|
21
|
+
utf8 = [ "© ≠ €! \01" ]
|
22
|
+
json = '["© ≠ €! \u0001"]'
|
23
|
+
assert_equal json, utf8.to_json(:ascii_only => false)
|
24
|
+
assert_equal utf8, parse(json)
|
25
|
+
json = '["\u00a9 \u2260 \u20ac! \u0001"]'
|
26
|
+
assert_equal json, utf8.to_json(:ascii_only => true)
|
27
|
+
assert_equal utf8, parse(json)
|
28
|
+
utf8 = ["\343\201\202\343\201\204\343\201\206\343\201\210\343\201\212"]
|
29
|
+
json = "[\"\343\201\202\343\201\204\343\201\206\343\201\210\343\201\212\"]"
|
30
|
+
assert_equal utf8, parse(json)
|
31
|
+
assert_equal json, utf8.to_json(:ascii_only => false)
|
32
|
+
utf8 = ["\343\201\202\343\201\204\343\201\206\343\201\210\343\201\212"]
|
33
|
+
assert_equal utf8, parse(json)
|
34
|
+
json = "[\"\\u3042\\u3044\\u3046\\u3048\\u304a\"]"
|
35
|
+
assert_equal json, utf8.to_json(:ascii_only => true)
|
36
|
+
assert_equal utf8, parse(json)
|
37
|
+
utf8 = ['საქართველო']
|
38
|
+
json = '["საქართველო"]'
|
39
|
+
assert_equal json, utf8.to_json(:ascii_only => false)
|
40
|
+
json = "[\"\\u10e1\\u10d0\\u10e5\\u10d0\\u10e0\\u10d7\\u10d5\\u10d4\\u10da\\u10dd\"]"
|
41
|
+
assert_equal json, utf8.to_json(:ascii_only => true)
|
42
|
+
assert_equal utf8, parse(json)
|
43
|
+
assert_equal '["Ã"]', JSON.generate(["Ã"], :ascii_only => false)
|
44
|
+
assert_equal '["\\u00c3"]', JSON.generate(["Ã"], :ascii_only => true)
|
45
|
+
assert_equal ["€"], JSON.parse('["\u20ac"]')
|
46
|
+
utf8 = ["\xf0\xa0\x80\x81"]
|
47
|
+
json = "[\"\xf0\xa0\x80\x81\"]"
|
48
|
+
assert_equal json, JSON.generate(utf8, :ascii_only => false)
|
49
|
+
assert_equal utf8, JSON.parse(json)
|
50
|
+
json = '["\ud840\udc01"]'
|
51
|
+
assert_equal json, JSON.generate(utf8, :ascii_only => true)
|
52
|
+
assert_equal utf8, JSON.parse(json)
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_chars
|
56
|
+
(0..0x7f).each do |i|
|
57
|
+
json = '["\u%04x"]' % i
|
58
|
+
if RUBY_VERSION >= "1.9."
|
59
|
+
i = i.chr
|
60
|
+
end
|
61
|
+
assert_equal i, JSON.parse(json).first[0]
|
62
|
+
if i == ?\b
|
63
|
+
generated = JSON.generate(["" << i])
|
64
|
+
assert '["\b"]' == generated || '["\10"]' == generated
|
65
|
+
elsif [?\n, ?\r, ?\t, ?\f].include?(i)
|
66
|
+
assert_equal '[' << ('' << i).dump << ']', JSON.generate(["" << i])
|
67
|
+
elsif i.chr < 0x20.chr
|
68
|
+
assert_equal json, JSON.generate(["" << i])
|
69
|
+
end
|
70
|
+
end
|
71
|
+
assert_raise(JSON::GeneratorError) do
|
72
|
+
JSON.generate(["\x80"], :ascii_only => true)
|
73
|
+
end
|
74
|
+
assert_equal "\302\200", JSON.parse('["\u0080"]').first
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
require 'iconv'
|
4
|
+
ISO_8859_1_TO_UTF8 = Iconv.new('utf-8', 'iso-8859-15')
|
5
|
+
class ::String
|
6
|
+
def to_utf8
|
7
|
+
ISO_8859_1_TO_UTF8.iconv self
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class Fuzzer
|
12
|
+
def initialize(n, freqs = {})
|
13
|
+
sum = freqs.inject(0.0) { |s, x| s + x.last }
|
14
|
+
freqs.each_key { |x| freqs[x] /= sum }
|
15
|
+
s = 0.0
|
16
|
+
freqs.each_key do |x|
|
17
|
+
freqs[x] = s .. (s + t = freqs[x])
|
18
|
+
s += t
|
19
|
+
end
|
20
|
+
@freqs = freqs
|
21
|
+
@n = n
|
22
|
+
@alpha = (0..0xff).to_a
|
23
|
+
end
|
24
|
+
|
25
|
+
def random_string
|
26
|
+
s = ''
|
27
|
+
30.times { s << @alpha[rand(@alpha.size)] }
|
28
|
+
s.to_utf8
|
29
|
+
end
|
30
|
+
|
31
|
+
def pick
|
32
|
+
r = rand
|
33
|
+
found = @freqs.find { |k, f| f.include? rand }
|
34
|
+
found && found.first
|
35
|
+
end
|
36
|
+
|
37
|
+
def make_pick
|
38
|
+
k = pick
|
39
|
+
case
|
40
|
+
when k == Hash, k == Array
|
41
|
+
k.new
|
42
|
+
when k == true, k == false, k == nil
|
43
|
+
k
|
44
|
+
when k == String
|
45
|
+
random_string
|
46
|
+
when k == Fixnum
|
47
|
+
rand(2 ** 30) - 2 ** 29
|
48
|
+
when k == Bignum
|
49
|
+
rand(2 ** 70) - 2 ** 69
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def fuzz(current = nil)
|
54
|
+
if @n > 0
|
55
|
+
case current
|
56
|
+
when nil
|
57
|
+
@n -= 1
|
58
|
+
current = fuzz [ Hash, Array ][rand(2)].new
|
59
|
+
when Array
|
60
|
+
while @n > 0
|
61
|
+
@n -= 1
|
62
|
+
current << case p = make_pick
|
63
|
+
when Array, Hash
|
64
|
+
fuzz(p)
|
65
|
+
else
|
66
|
+
p
|
67
|
+
end
|
68
|
+
end
|
69
|
+
when Hash
|
70
|
+
while @n > 0
|
71
|
+
@n -= 1
|
72
|
+
current[random_string] = case p = make_pick
|
73
|
+
when Array, Hash
|
74
|
+
fuzz(p)
|
75
|
+
else
|
76
|
+
p
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
current
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
class MyState < JSON.state
|
86
|
+
WS = " \r\t\n"
|
87
|
+
|
88
|
+
def initialize
|
89
|
+
super(
|
90
|
+
:indent => make_spaces,
|
91
|
+
:space => make_spaces,
|
92
|
+
:space_before => make_spaces,
|
93
|
+
:object_nl => make_spaces,
|
94
|
+
:array_nl => make_spaces,
|
95
|
+
:max_nesting => false
|
96
|
+
)
|
97
|
+
end
|
98
|
+
|
99
|
+
def make_spaces
|
100
|
+
s = ''
|
101
|
+
rand(1).times { s << WS[rand(WS.size)] }
|
102
|
+
s
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
n = (ARGV.shift || 500).to_i
|
107
|
+
loop do
|
108
|
+
fuzzer = Fuzzer.new(n,
|
109
|
+
Hash => 25,
|
110
|
+
Array => 25,
|
111
|
+
String => 10,
|
112
|
+
Fixnum => 10,
|
113
|
+
Bignum => 10,
|
114
|
+
nil => 5,
|
115
|
+
true => 5,
|
116
|
+
false => 5
|
117
|
+
)
|
118
|
+
o1 = fuzzer.fuzz
|
119
|
+
json = JSON.generate o1, MyState.new
|
120
|
+
if $DEBUG
|
121
|
+
puts "-" * 80
|
122
|
+
puts json, json.size
|
123
|
+
else
|
124
|
+
puts json.size
|
125
|
+
end
|
126
|
+
begin
|
127
|
+
o2 = JSON.parse(json, :max_nesting => false)
|
128
|
+
rescue JSON::ParserError => e
|
129
|
+
puts "Caught #{e.class}: #{e.message}\n#{e.backtrace * "\n"}"
|
130
|
+
puts "o1 = #{o1.inspect}", "json = #{json}", "json_str = #{json.inspect}"
|
131
|
+
puts "locals = #{local_variables.inspect}"
|
132
|
+
exit
|
133
|
+
end
|
134
|
+
if o1 != o2
|
135
|
+
puts "mismatch", "o1 = #{o1.inspect}", "o2 = #{o2.inspect}",
|
136
|
+
"json = #{json}", "json_str = #{json.inspect}"
|
137
|
+
puts "locals = #{local_variables.inspect}"
|
138
|
+
end
|
139
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'webrick'
|
4
|
+
include WEBrick
|
5
|
+
$:.unshift 'ext'
|
6
|
+
$:.unshift 'lib'
|
7
|
+
require 'json'
|
8
|
+
|
9
|
+
class JSONServlet < HTTPServlet::AbstractServlet
|
10
|
+
@@count = 1
|
11
|
+
|
12
|
+
def do_GET(req, res)
|
13
|
+
obj = {
|
14
|
+
"TIME" => Time.now.strftime("%FT%T"),
|
15
|
+
"foo" => "Bär",
|
16
|
+
"bar" => "© ≠ €!",
|
17
|
+
'a' => 2,
|
18
|
+
'b' => 3.141,
|
19
|
+
'COUNT' => @@count += 1,
|
20
|
+
'c' => 'c',
|
21
|
+
'd' => [ 1, "b", 3.14 ],
|
22
|
+
'e' => { 'foo' => 'bar' },
|
23
|
+
'g' => "松本行弘",
|
24
|
+
'h' => 1000.0,
|
25
|
+
'i' => 0.001,
|
26
|
+
'j' => "\xf0\xa0\x80\x81",
|
27
|
+
}
|
28
|
+
res.body = JSON.generate obj
|
29
|
+
res['Content-Type'] = "application/json"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def create_server(err, dir, port)
|
34
|
+
dir = File.expand_path(dir)
|
35
|
+
err.puts "Surf to:", "http://#{Socket.gethostname}:#{port}"
|
36
|
+
|
37
|
+
s = HTTPServer.new(
|
38
|
+
:Port => port,
|
39
|
+
:DocumentRoot => dir,
|
40
|
+
:Logger => WEBrick::Log.new(err),
|
41
|
+
:AccessLog => [
|
42
|
+
[ err, WEBrick::AccessLog::COMMON_LOG_FORMAT ],
|
43
|
+
[ err, WEBrick::AccessLog::REFERER_LOG_FORMAT ],
|
44
|
+
[ err, WEBrick::AccessLog::AGENT_LOG_FORMAT ]
|
45
|
+
]
|
46
|
+
)
|
47
|
+
s.mount("/json", JSONServlet)
|
48
|
+
s
|
49
|
+
end
|
50
|
+
|
51
|
+
default_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'data'))
|
52
|
+
dir = ARGV.shift || default_dir
|
53
|
+
port = (ARGV.shift || 6666).to_i
|
54
|
+
s = create_server(STDERR, dir, 6666)
|
55
|
+
t = Thread.new { s.start }
|
56
|
+
trap(:INT) do
|
57
|
+
s.shutdown
|
58
|
+
t.join
|
59
|
+
exit
|
60
|
+
end
|
61
|
+
sleep
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 philnash
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
= omg
|
2
|
+
|
3
|
+
Quick and dirty debugging in Rails.
|
4
|
+
|
5
|
+
Sometimes you just want to see whether a method was called. Those times you don't want to write out some rubbish just to see that. Why not just write
|
6
|
+
|
7
|
+
def some_method
|
8
|
+
omg!
|
9
|
+
# do stuff
|
10
|
+
end
|
11
|
+
|
12
|
+
When the method is called, in the log you will find
|
13
|
+
|
14
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
15
|
+
OMG!
|
16
|
+
some_method called!
|
17
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
18
|
+
|
19
|
+
Or, pass an object to omg! and it will print out the result of the object's inspect method
|
20
|
+
|
21
|
+
Easy.
|
22
|
+
|
23
|
+
== Note on Patches/Pull Requests
|
24
|
+
|
25
|
+
* Fork the project.
|
26
|
+
* Make your feature addition or bug fix.
|
27
|
+
* Add tests for it. This is important so I don't break it in a
|
28
|
+
future version unintentionally.
|
29
|
+
* Commit, do not mess with rakefile, version, or history.
|
30
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
31
|
+
* Send me a pull request. Bonus points for topic branches.
|
32
|
+
|
33
|
+
== Copyright
|
34
|
+
|
35
|
+
Copyright (c) 2010 philnash. See LICENSE for details.
|