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,178 @@
|
|
1
|
+
require 'hashie/hash'
|
2
|
+
|
3
|
+
module Hashie
|
4
|
+
# Mash allows you to create pseudo-objects that have method-like
|
5
|
+
# accessors for hash keys. This is useful for such implementations
|
6
|
+
# as an API-accessing library that wants to fake robust objects
|
7
|
+
# without the overhead of actually doing so. Think of it as OpenStruct
|
8
|
+
# with some additional goodies.
|
9
|
+
#
|
10
|
+
# A Mash will look at the methods you pass it and perform operations
|
11
|
+
# based on the following rules:
|
12
|
+
#
|
13
|
+
# * No punctuation: Returns the value of the hash for that key, or nil if none exists.
|
14
|
+
# * Assignment (<tt>=</tt>): Sets the attribute of the given method name.
|
15
|
+
# * Existence (<tt>?</tt>): Returns true or false depending on whether that key has been set.
|
16
|
+
# * Bang (<tt>!</tt>): Forces the existence of this key, used for deep Mashes. Think of it as "touch" for mashes.
|
17
|
+
#
|
18
|
+
# == Basic Example
|
19
|
+
#
|
20
|
+
# mash = Mash.new
|
21
|
+
# mash.name? # => false
|
22
|
+
# mash.name = "Bob"
|
23
|
+
# mash.name # => "Bob"
|
24
|
+
# mash.name? # => true
|
25
|
+
#
|
26
|
+
# == Hash Conversion Example
|
27
|
+
#
|
28
|
+
# hash = {:a => {:b => 23, :d => {:e => "abc"}}, :f => [{:g => 44, :h => 29}, 12]}
|
29
|
+
# mash = Mash.new(hash)
|
30
|
+
# mash.a.b # => 23
|
31
|
+
# mash.a.d.e # => "abc"
|
32
|
+
# mash.f.first.g # => 44
|
33
|
+
# mash.f.last # => 12
|
34
|
+
#
|
35
|
+
# == Bang Example
|
36
|
+
#
|
37
|
+
# mash = Mash.new
|
38
|
+
# mash.author # => nil
|
39
|
+
# mash.author! # => <Mash>
|
40
|
+
#
|
41
|
+
# mash = Mash.new
|
42
|
+
# mash.author!.name = "Michael Bleigh"
|
43
|
+
# mash.author # => <Mash name="Michael Bleigh">
|
44
|
+
#
|
45
|
+
class Mash < Hashie::Hash
|
46
|
+
include Hashie::PrettyInspect
|
47
|
+
alias_method :to_s, :inspect
|
48
|
+
|
49
|
+
# If you pass in an existing hash, it will
|
50
|
+
# convert it to a Mash including recursively
|
51
|
+
# descending into arrays and hashes, converting
|
52
|
+
# them as well.
|
53
|
+
def initialize(source_hash = nil, default = nil, &blk)
|
54
|
+
deep_update(source_hash) if source_hash
|
55
|
+
default ? super(default) : super(&blk)
|
56
|
+
end
|
57
|
+
|
58
|
+
class << self; alias [] new; end
|
59
|
+
|
60
|
+
def id #:nodoc:
|
61
|
+
key?("id") ? self["id"] : super
|
62
|
+
end
|
63
|
+
|
64
|
+
alias_method :regular_reader, :[]
|
65
|
+
alias_method :regular_writer, :[]=
|
66
|
+
|
67
|
+
# Retrieves an attribute set in the Mash. Will convert
|
68
|
+
# any key passed in to a string before retrieving.
|
69
|
+
def [](key)
|
70
|
+
regular_reader(convert_key(key))
|
71
|
+
end
|
72
|
+
|
73
|
+
# Sets an attribute in the Mash. Key will be converted to
|
74
|
+
# a string before it is set, and Hashes will be converted
|
75
|
+
# into Mashes for nesting purposes.
|
76
|
+
def []=(key,value) #:nodoc:
|
77
|
+
regular_writer(convert_key(key), convert_value(value))
|
78
|
+
end
|
79
|
+
|
80
|
+
# This is the bang method reader, it will return a new Mash
|
81
|
+
# if there isn't a value already assigned to the key requested.
|
82
|
+
def initializing_reader(key)
|
83
|
+
ck = convert_key(key)
|
84
|
+
regular_writer(ck, self.class.new) unless key?(ck)
|
85
|
+
regular_reader(ck)
|
86
|
+
end
|
87
|
+
|
88
|
+
alias_method :regular_dup, :dup
|
89
|
+
# Duplicates the current mash as a new mash.
|
90
|
+
def dup
|
91
|
+
self.class.new(self, self.default)
|
92
|
+
end
|
93
|
+
|
94
|
+
def key?(key)
|
95
|
+
super(convert_key(key))
|
96
|
+
end
|
97
|
+
|
98
|
+
# Performs a deep_update on a duplicate of the
|
99
|
+
# current mash.
|
100
|
+
def deep_merge(other_hash)
|
101
|
+
dup.deep_update(other_hash)
|
102
|
+
end
|
103
|
+
alias_method :merge, :deep_merge
|
104
|
+
|
105
|
+
# Recursively merges this mash with the passed
|
106
|
+
# in hash, merging each hash in the hierarchy.
|
107
|
+
def deep_update(other_hash)
|
108
|
+
other_hash.each_pair do |k,v|
|
109
|
+
key = convert_key(k)
|
110
|
+
if regular_reader(key).is_a?(Mash) and v.is_a?(::Hash)
|
111
|
+
regular_reader(key).deep_update(v)
|
112
|
+
else
|
113
|
+
regular_writer(key, convert_value(v, true))
|
114
|
+
end
|
115
|
+
end
|
116
|
+
self
|
117
|
+
end
|
118
|
+
alias_method :deep_merge!, :deep_update
|
119
|
+
alias_method :update, :deep_update
|
120
|
+
alias_method :merge!, :update
|
121
|
+
|
122
|
+
# Performs a shallow_update on a duplicate of the current mash
|
123
|
+
def shallow_merge(other_hash)
|
124
|
+
dup.shallow_update(other_hash)
|
125
|
+
end
|
126
|
+
|
127
|
+
# Merges (non-recursively) the hash from the argument,
|
128
|
+
# changing the receiving hash
|
129
|
+
def shallow_update(other_hash)
|
130
|
+
other_hash.each_pair do |k,v|
|
131
|
+
regular_writer(convert_key(k), convert_value(v, true))
|
132
|
+
end
|
133
|
+
self
|
134
|
+
end
|
135
|
+
|
136
|
+
# Will return true if the Mash has had a key
|
137
|
+
# set in addition to normal respond_to? functionality.
|
138
|
+
def respond_to?(method_name)
|
139
|
+
return true if key?(method_name)
|
140
|
+
super
|
141
|
+
end
|
142
|
+
|
143
|
+
def method_missing(method_name, *args, &blk)
|
144
|
+
return self[method_name] if key?(method_name)
|
145
|
+
match = method_name.to_s.match(/(.*?)([?=!]?)$/)
|
146
|
+
case match[2]
|
147
|
+
when "="
|
148
|
+
self[match[1]] = args.first
|
149
|
+
when "?"
|
150
|
+
!!self[match[1]]
|
151
|
+
when "!"
|
152
|
+
initializing_reader(match[1])
|
153
|
+
else
|
154
|
+
default(method_name, *args, &blk)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
protected
|
159
|
+
|
160
|
+
def convert_key(key) #:nodoc:
|
161
|
+
key.to_s
|
162
|
+
end
|
163
|
+
|
164
|
+
def convert_value(val, duping=false) #:nodoc:
|
165
|
+
case val
|
166
|
+
when self.class
|
167
|
+
val.dup
|
168
|
+
when ::Hash
|
169
|
+
val = val.dup if duping
|
170
|
+
self.class.new(val)
|
171
|
+
when Array
|
172
|
+
val.collect{ |e| convert_value(e) }
|
173
|
+
else
|
174
|
+
val
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'hashie/dash'
|
2
|
+
|
3
|
+
module Hashie
|
4
|
+
# A Trash is a 'translated' Dash where the keys can be remapped from a source
|
5
|
+
# hash.
|
6
|
+
#
|
7
|
+
# Trashes are useful when you need to read data from another application,
|
8
|
+
# such as a Java api, where the keys are named differently from how we would
|
9
|
+
# in Ruby.
|
10
|
+
class Trash < Hashie::Dash
|
11
|
+
|
12
|
+
# Defines a property on the Trash. Options are as follows:
|
13
|
+
#
|
14
|
+
# * <tt>:default</tt> - Specify a default value for this property, to be
|
15
|
+
# returned before a value is set on the property in a new Dash.
|
16
|
+
# * <tt>:from</tt> - Specify the original key name that will be write only.
|
17
|
+
def self.property(property_name, options = {})
|
18
|
+
super
|
19
|
+
|
20
|
+
if options[:from]
|
21
|
+
translations << options[:from].to_sym
|
22
|
+
class_eval <<-RUBY
|
23
|
+
def #{options[:from]}=(val)
|
24
|
+
self[:#{property_name}] = val
|
25
|
+
end
|
26
|
+
RUBY
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Set a value on the Dash in a Hash-like way. Only works
|
31
|
+
# on pre-existing properties.
|
32
|
+
def []=(property, value)
|
33
|
+
if self.class.translations.include? property.to_sym
|
34
|
+
send("#{property}=", value)
|
35
|
+
elsif property_exists? property
|
36
|
+
super
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def self.translations
|
43
|
+
@translations ||= []
|
44
|
+
end
|
45
|
+
|
46
|
+
# Raises an NoMethodError if the property doesn't exist
|
47
|
+
#
|
48
|
+
def property_exists?(property)
|
49
|
+
unless self.class.property?(property.to_sym)
|
50
|
+
raise NoMethodError, "The property '#{property}' is not defined for this Trash."
|
51
|
+
end
|
52
|
+
true
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Hashie
|
2
|
+
autoload :HashExtensions, 'hashie/hash_extensions'
|
3
|
+
autoload :PrettyInspect, 'hashie/hash_extensions'
|
4
|
+
autoload :Hash, 'hashie/hash'
|
5
|
+
autoload :Trash, 'hashie/trash'
|
6
|
+
autoload :Mash, 'hashie/mash'
|
7
|
+
autoload :Dash, 'hashie/dash'
|
8
|
+
autoload :Clash, 'hashie/clash'
|
9
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hashie::Clash do
|
4
|
+
before do
|
5
|
+
@c = Hashie::Clash.new
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'should be able to set an attribute via method_missing' do
|
9
|
+
@c.foo('bar')
|
10
|
+
@c[:foo].should == 'bar'
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should be able to set multiple attributes' do
|
14
|
+
@c.foo('bar').baz('wok')
|
15
|
+
@c.should == {:foo => 'bar', :baz => 'wok'}
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should convert multiple arguments into an array' do
|
19
|
+
@c.foo(1, 2, 3)
|
20
|
+
@c[:foo].should == [1,2,3]
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should be able to use bang notation to create a new Clash on a key' do
|
24
|
+
@c.foo!
|
25
|
+
@c[:foo].should be_kind_of(Hashie::Clash)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should be able to chain onto the new Clash when using bang notation' do
|
29
|
+
@c.foo!.bar('abc').baz(123)
|
30
|
+
@c.should == {:foo => {:bar => 'abc', :baz => 123}}
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should be able to jump back up to the parent in the chain with #_end!' do
|
34
|
+
@c.foo!.bar('abc')._end!.baz(123)
|
35
|
+
@c.should == {:foo => {:bar => 'abc'}, :baz => 123}
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should merge rather than replace existing keys' do
|
39
|
+
@c.where(:abc => 'def').where(:hgi => 123)
|
40
|
+
@c.should == {:where => {:abc => 'def', :hgi => 123}}
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,156 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
Hashie::Hash.class_eval do
|
4
|
+
def self.inherited(klass)
|
5
|
+
klass.instance_variable_set('@inheritance_test', true)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class DashTest < Hashie::Dash
|
10
|
+
property :first_name
|
11
|
+
property :email
|
12
|
+
property :count, :default => 0
|
13
|
+
end
|
14
|
+
|
15
|
+
class Subclassed < DashTest
|
16
|
+
property :last_name
|
17
|
+
end
|
18
|
+
|
19
|
+
describe DashTest do
|
20
|
+
|
21
|
+
it('subclasses Hashie::Hash') { should respond_to(:to_mash) }
|
22
|
+
|
23
|
+
its(:to_s) { should == '<#DashTest count=0>' }
|
24
|
+
|
25
|
+
it 'lists all set properties in inspect' do
|
26
|
+
subject.first_name = 'Bob'
|
27
|
+
subject.email = 'bob@example.com'
|
28
|
+
subject.inspect.should == '<#DashTest count=0 email="bob@example.com" first_name="Bob">'
|
29
|
+
end
|
30
|
+
|
31
|
+
its(:count) { should be_zero }
|
32
|
+
|
33
|
+
it { should respond_to(:first_name) }
|
34
|
+
it { should respond_to(:first_name=) }
|
35
|
+
it { should_not respond_to(:nonexistent) }
|
36
|
+
|
37
|
+
it 'errors out for a non-existent property' do
|
38
|
+
lambda { subject['nonexistent'] }.should raise_error(NoMethodError)
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'writing to properties' do
|
42
|
+
it 'fails writing to a non-existent property using []=' do
|
43
|
+
lambda { subject['nonexistent'] = 123 }.should raise_error(NoMethodError)
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'works for an existing property using []=' do
|
47
|
+
subject['first_name'] = 'Bob'
|
48
|
+
subject['first_name'].should == 'Bob'
|
49
|
+
subject[:first_name].should == 'Bob'
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'works for an existing property using a method call' do
|
53
|
+
subject.first_name = 'Franklin'
|
54
|
+
subject.first_name.should == 'Franklin'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '.new' do
|
59
|
+
it 'fails with non-existent properties' do
|
60
|
+
lambda { described_class.new(:bork => '') }.should raise_error(NoMethodError)
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'should set properties that it is able to' do
|
64
|
+
obj = described_class.new :first_name => 'Michael'
|
65
|
+
obj.first_name.should == 'Michael'
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'accepts nil' do
|
69
|
+
lambda { described_class.new(nil) }.should_not raise_error
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'accepts block to define a global default' do
|
73
|
+
obj = described_class.new { |hash, key| key.to_s.upcase }
|
74
|
+
obj.first_name.should == 'FIRST_NAME'
|
75
|
+
obj.count.should be_zero
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe 'properties' do
|
80
|
+
it 'lists defined properties' do
|
81
|
+
described_class.properties.should == Set.new([:first_name, :email, :count])
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'checks if a property exists' do
|
85
|
+
described_class.property?('first_name').should be_true
|
86
|
+
described_class.property?(:first_name).should be_true
|
87
|
+
end
|
88
|
+
|
89
|
+
it 'doesnt include property from subclass' do
|
90
|
+
described_class.property?(:last_name).should be_false
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'lists declared defaults' do
|
94
|
+
described_class.defaults.should == { :count => 0 }
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
describe Hashie::Dash, 'inheritance' do
|
100
|
+
before do
|
101
|
+
@top = Class.new(Hashie::Dash)
|
102
|
+
@middle = Class.new(@top)
|
103
|
+
@bottom = Class.new(@middle)
|
104
|
+
end
|
105
|
+
|
106
|
+
it 'reports empty properties when nothing defined' do
|
107
|
+
@top.properties.should be_empty
|
108
|
+
@top.defaults.should be_empty
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'inherits properties downwards' do
|
112
|
+
@top.property :echo
|
113
|
+
@middle.properties.should include(:echo)
|
114
|
+
@bottom.properties.should include(:echo)
|
115
|
+
end
|
116
|
+
|
117
|
+
it 'doesnt inherit properties upwards' do
|
118
|
+
@middle.property :echo
|
119
|
+
@top.properties.should_not include(:echo)
|
120
|
+
@bottom.properties.should include(:echo)
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'allows overriding a default on an existing property' do
|
124
|
+
@top.property :echo
|
125
|
+
@middle.property :echo, :default => 123
|
126
|
+
@bottom.properties.to_a.should == [:echo]
|
127
|
+
@bottom.new.echo.should == 123
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'allows clearing an existing default' do
|
131
|
+
@top.property :echo
|
132
|
+
@middle.property :echo, :default => 123
|
133
|
+
@bottom.property :echo
|
134
|
+
@bottom.properties.to_a.should == [:echo]
|
135
|
+
@bottom.new.echo.should be_nil
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
describe Subclassed do
|
140
|
+
|
141
|
+
its(:count) { should be_zero }
|
142
|
+
|
143
|
+
it { should respond_to(:first_name) }
|
144
|
+
it { should respond_to(:first_name=) }
|
145
|
+
it { should respond_to(:last_name) }
|
146
|
+
it { should respond_to(:last_name=) }
|
147
|
+
|
148
|
+
it 'has one additional property' do
|
149
|
+
described_class.property?(:last_name).should be_true
|
150
|
+
end
|
151
|
+
|
152
|
+
it "didn't override superclass inheritance logic" do
|
153
|
+
described_class.instance_variable_get('@inheritance_test').should be_true
|
154
|
+
end
|
155
|
+
|
156
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hash do
|
4
|
+
it "should be convertible to a Hashie::Mash" do
|
5
|
+
mash = Hashie::Hash[:some => "hash"].to_mash
|
6
|
+
mash.is_a?(Hashie::Mash).should be_true
|
7
|
+
mash.some.should == "hash"
|
8
|
+
end
|
9
|
+
|
10
|
+
it "#stringify_keys! should turn all keys into strings" do
|
11
|
+
hash = Hashie::Hash[:a => "hey", 123 => "bob"]
|
12
|
+
hash.stringify_keys!
|
13
|
+
hash.should == Hashie::Hash["a" => "hey", "123" => "bob"]
|
14
|
+
end
|
15
|
+
|
16
|
+
it "#stringify_keys should return a hash with stringified keys" do
|
17
|
+
hash = Hashie::Hash[:a => "hey", 123 => "bob"]
|
18
|
+
stringified_hash = hash.stringify_keys
|
19
|
+
hash.should == Hashie::Hash[:a => "hey", 123 => "bob"]
|
20
|
+
stringified_hash.should == Hashie::Hash["a" => "hey", "123" => "bob"]
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,241 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hashie::Mash do
|
4
|
+
before(:each) do
|
5
|
+
@mash = Hashie::Mash.new
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should inherit from hash" do
|
9
|
+
@mash.is_a?(Hash).should be_true
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should be able to set hash values through method= calls" do
|
13
|
+
@mash.test = "abc"
|
14
|
+
@mash["test"].should == "abc"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should be able to retrieve set values through method calls" do
|
18
|
+
@mash["test"] = "abc"
|
19
|
+
@mash.test.should == "abc"
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should test for already set values when passed a ? method" do
|
23
|
+
@mash.test?.should be_false
|
24
|
+
@mash.test = "abc"
|
25
|
+
@mash.test?.should be_true
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should return false on a ? method if a value has been set to nil or false" do
|
29
|
+
@mash.test = nil
|
30
|
+
@mash.should_not be_test
|
31
|
+
@mash.test = false
|
32
|
+
@mash.should_not be_test
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should make all [] and []= into strings for consistency" do
|
36
|
+
@mash["abc"] = 123
|
37
|
+
@mash.key?('abc').should be_true
|
38
|
+
@mash["abc"].should == 123
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should have a to_s that is identical to its inspect" do
|
42
|
+
@mash.abc = 123
|
43
|
+
@mash.to_s.should == @mash.inspect
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should return nil instead of raising an error for attribute-esque method calls" do
|
47
|
+
@mash.abc.should be_nil
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should return a Hashie::Mash when passed a bang method to a non-existenct key" do
|
51
|
+
@mash.abc!.is_a?(Hashie::Mash).should be_true
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should return the existing value when passed a bang method for an existing key" do
|
55
|
+
@mash.name = "Bob"
|
56
|
+
@mash.name!.should == "Bob"
|
57
|
+
end
|
58
|
+
|
59
|
+
it "#initializing_reader should return a Hashie::Mash when passed a non-existent key" do
|
60
|
+
@mash.initializing_reader(:abc).is_a?(Hashie::Mash).should be_true
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should allow for multi-level assignment through bang methods" do
|
64
|
+
@mash.author!.name = "Michael Bleigh"
|
65
|
+
@mash.author.should == Hashie::Mash.new(:name => "Michael Bleigh")
|
66
|
+
@mash.author!.website!.url = "http://www.mbleigh.com/"
|
67
|
+
@mash.author.website.should == Hashie::Mash.new(:url => "http://www.mbleigh.com/")
|
68
|
+
end
|
69
|
+
|
70
|
+
context "updating" do
|
71
|
+
subject {
|
72
|
+
described_class.new :first_name => "Michael", :last_name => "Bleigh",
|
73
|
+
:details => {:email => "michael@asf.com", :address => "Nowhere road"}
|
74
|
+
}
|
75
|
+
|
76
|
+
describe "#deep_update" do
|
77
|
+
it "should recursively Hashie::Mash Hashie::Mashes and hashes together" do
|
78
|
+
subject.deep_update(:details => {:email => "michael@intridea.com", :city => "Imagineton"})
|
79
|
+
subject.first_name.should == "Michael"
|
80
|
+
subject.details.email.should == "michael@intridea.com"
|
81
|
+
subject.details.address.should == "Nowhere road"
|
82
|
+
subject.details.city.should == "Imagineton"
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should make #update deep by default" do
|
86
|
+
subject.update(:details => {:address => "Fake street"}).should eql(subject)
|
87
|
+
subject.details.address.should == "Fake street"
|
88
|
+
subject.details.email.should == "michael@asf.com"
|
89
|
+
end
|
90
|
+
|
91
|
+
it "should clone before a #deep_merge" do
|
92
|
+
duped = subject.deep_merge(:details => {:address => "Fake street"})
|
93
|
+
duped.should_not eql(subject)
|
94
|
+
duped.details.address.should == "Fake street"
|
95
|
+
subject.details.address.should == "Nowhere road"
|
96
|
+
duped.details.email.should == "michael@asf.com"
|
97
|
+
end
|
98
|
+
|
99
|
+
it "regular #merge should be deep" do
|
100
|
+
duped = subject.merge(:details => {:email => "michael@intridea.com"})
|
101
|
+
duped.should_not eql(subject)
|
102
|
+
duped.details.email.should == "michael@intridea.com"
|
103
|
+
duped.details.address.should == "Nowhere road"
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
describe "shallow update" do
|
108
|
+
it "should shallowly Hashie::Mash Hashie::Mashes and hashes together" do
|
109
|
+
subject.shallow_update(:details => {
|
110
|
+
:email => "michael@intridea.com", :city => "Imagineton"
|
111
|
+
}).should eql(subject)
|
112
|
+
|
113
|
+
subject.first_name.should == "Michael"
|
114
|
+
subject.details.email.should == "michael@intridea.com"
|
115
|
+
subject.details.address.should be_nil
|
116
|
+
subject.details.city.should == "Imagineton"
|
117
|
+
end
|
118
|
+
|
119
|
+
it "should clone before a #regular_merge" do
|
120
|
+
duped = subject.shallow_merge(:details => {:address => "Fake street"})
|
121
|
+
duped.should_not eql(subject)
|
122
|
+
end
|
123
|
+
|
124
|
+
it "regular merge should be shallow" do
|
125
|
+
duped = subject.shallow_merge(:details => {:address => "Fake street"})
|
126
|
+
duped.details.address.should == "Fake street"
|
127
|
+
subject.details.address.should == "Nowhere road"
|
128
|
+
duped.details.email.should be_nil
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
it "should convert hash assignments into Hashie::Mashes" do
|
134
|
+
@mash.details = {:email => 'randy@asf.com', :address => {:state => 'TX'} }
|
135
|
+
@mash.details.email.should == 'randy@asf.com'
|
136
|
+
@mash.details.address.state.should == 'TX'
|
137
|
+
end
|
138
|
+
|
139
|
+
it "should not convert the type of Hashie::Mashes childs to Hashie::Mash" do
|
140
|
+
class MyMash < Hashie::Mash
|
141
|
+
end
|
142
|
+
|
143
|
+
record = MyMash.new
|
144
|
+
record.son = MyMash.new
|
145
|
+
record.son.class.should == MyMash
|
146
|
+
end
|
147
|
+
|
148
|
+
it "should not change the class of Mashes when converted" do
|
149
|
+
class SubMash < Hashie::Mash
|
150
|
+
end
|
151
|
+
|
152
|
+
record = Hashie::Mash.new
|
153
|
+
son = SubMash.new
|
154
|
+
record['submash'] = son
|
155
|
+
record['submash'].should be_kind_of(SubMash)
|
156
|
+
end
|
157
|
+
|
158
|
+
it "should respect the class when passed a bang method for a non-existent key" do
|
159
|
+
record = Hashie::Mash.new
|
160
|
+
record.non_existent!.should be_kind_of(Hashie::Mash)
|
161
|
+
|
162
|
+
class SubMash < Hashie::Mash
|
163
|
+
end
|
164
|
+
|
165
|
+
son = SubMash.new
|
166
|
+
son.non_existent!.should be_kind_of(SubMash)
|
167
|
+
end
|
168
|
+
|
169
|
+
it "should respect the class when converting the value" do
|
170
|
+
record = Hashie::Mash.new
|
171
|
+
record.details = Hashie::Mash.new({:email => "randy@asf.com"})
|
172
|
+
record.details.should be_kind_of(Hashie::Mash)
|
173
|
+
|
174
|
+
class SubMash < Hashie::Mash
|
175
|
+
end
|
176
|
+
|
177
|
+
son = SubMash.new
|
178
|
+
son.details = Hashie::Mash.new({:email => "randyjr@asf.com"})
|
179
|
+
son.details.should be_kind_of(SubMash)
|
180
|
+
end
|
181
|
+
|
182
|
+
describe '#respond_to?' do
|
183
|
+
it 'should respond to a normal method' do
|
184
|
+
Hashie::Mash.new.should be_respond_to(:key?)
|
185
|
+
end
|
186
|
+
|
187
|
+
it 'should respond to a set key' do
|
188
|
+
Hashie::Mash.new(:abc => 'def').should be_respond_to(:abc)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
context "#initialize" do
|
193
|
+
it "should convert an existing hash to a Hashie::Mash" do
|
194
|
+
converted = Hashie::Mash.new({:abc => 123, :name => "Bob"})
|
195
|
+
converted.abc.should == 123
|
196
|
+
converted.name.should == "Bob"
|
197
|
+
end
|
198
|
+
|
199
|
+
it "should convert hashes recursively into Hashie::Mashes" do
|
200
|
+
converted = Hashie::Mash.new({:a => {:b => 1, :c => {:d => 23}}})
|
201
|
+
converted.a.is_a?(Hashie::Mash).should be_true
|
202
|
+
converted.a.b.should == 1
|
203
|
+
converted.a.c.d.should == 23
|
204
|
+
end
|
205
|
+
|
206
|
+
it "should convert hashes in arrays into Hashie::Mashes" do
|
207
|
+
converted = Hashie::Mash.new({:a => [{:b => 12}, 23]})
|
208
|
+
converted.a.first.b.should == 12
|
209
|
+
converted.a.last.should == 23
|
210
|
+
end
|
211
|
+
|
212
|
+
it "should convert an existing Hashie::Mash into a Hashie::Mash" do
|
213
|
+
initial = Hashie::Mash.new(:name => 'randy', :address => {:state => 'TX'})
|
214
|
+
copy = Hashie::Mash.new(initial)
|
215
|
+
initial.name.should == copy.name
|
216
|
+
initial.object_id.should_not == copy.object_id
|
217
|
+
copy.address.state.should == 'TX'
|
218
|
+
copy.address.state = 'MI'
|
219
|
+
initial.address.state.should == 'TX'
|
220
|
+
copy.address.object_id.should_not == initial.address.object_id
|
221
|
+
end
|
222
|
+
|
223
|
+
it "should accept a default block" do
|
224
|
+
initial = Hashie::Mash.new { |h,i| h[i] = []}
|
225
|
+
initial.default_proc.should_not be_nil
|
226
|
+
initial.default.should be_nil
|
227
|
+
initial.test.should == []
|
228
|
+
initial.test?.should be_true
|
229
|
+
end
|
230
|
+
|
231
|
+
describe "to_json" do
|
232
|
+
|
233
|
+
it "should render to_json" do
|
234
|
+
@mash.foo = :bar
|
235
|
+
@mash.bar = {"homer" => "simpson"}
|
236
|
+
expected = {"foo" => "bar", "bar" => {"homer" => "simpson"}}
|
237
|
+
JSON.parse(@mash.to_json).should == expected
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|