putio 0.0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (527) hide show
  1. data/.gitignore +2 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +27 -0
  4. data/Rakefile +21 -0
  5. data/Readme.md +32 -0
  6. data/development/ruby/1.8/bin/convert_to_should_syntax +19 -0
  7. data/development/ruby/1.8/bin/edit_json.rb +19 -0
  8. data/development/ruby/1.8/bin/prettify_json.rb +19 -0
  9. data/development/ruby/1.8/cache/crack-0.1.8.gem +0 -0
  10. data/development/ruby/1.8/cache/fakeweb-1.3.0.gem +0 -0
  11. data/development/ruby/1.8/cache/hashie-0.4.0.gem +0 -0
  12. data/development/ruby/1.8/cache/json-1.4.6.gem +0 -0
  13. data/development/ruby/1.8/cache/omg-0.0.6.gem +0 -0
  14. data/development/ruby/1.8/cache/shoulda-2.11.3.gem +0 -0
  15. data/development/ruby/1.8/gems/crack-0.1.8/.gitignore +6 -0
  16. data/development/ruby/1.8/gems/crack-0.1.8/History +25 -0
  17. data/development/ruby/1.8/gems/crack-0.1.8/LICENSE +20 -0
  18. data/development/ruby/1.8/gems/crack-0.1.8/README.rdoc +42 -0
  19. data/development/ruby/1.8/gems/crack-0.1.8/Rakefile +52 -0
  20. data/development/ruby/1.8/gems/crack-0.1.8/crack.gemspec +63 -0
  21. data/development/ruby/1.8/gems/crack-0.1.8/lib/crack/core_extensions.rb +128 -0
  22. data/development/ruby/1.8/gems/crack-0.1.8/lib/crack/json.rb +68 -0
  23. data/development/ruby/1.8/gems/crack-0.1.8/lib/crack/xml.rb +214 -0
  24. data/development/ruby/1.8/gems/crack-0.1.8/lib/crack.rb +8 -0
  25. data/development/ruby/1.8/gems/crack-0.1.8/test/crack_test.rb +4 -0
  26. data/development/ruby/1.8/gems/crack-0.1.8/test/data/twittersearch-firefox.json +1 -0
  27. data/development/ruby/1.8/gems/crack-0.1.8/test/data/twittersearch-ie.json +1 -0
  28. data/development/ruby/1.8/gems/crack-0.1.8/test/hash_test.rb +56 -0
  29. data/development/ruby/1.8/gems/crack-0.1.8/test/json_test.rb +69 -0
  30. data/development/ruby/1.8/gems/crack-0.1.8/test/string_test.rb +31 -0
  31. data/development/ruby/1.8/gems/crack-0.1.8/test/test_helper.rb +12 -0
  32. data/development/ruby/1.8/gems/crack-0.1.8/test/xml_test.rb +489 -0
  33. data/development/ruby/1.8/gems/fakeweb-1.3.0/.autotest +5 -0
  34. data/development/ruby/1.8/gems/fakeweb-1.3.0/.gitignore +7 -0
  35. data/development/ruby/1.8/gems/fakeweb-1.3.0/CHANGELOG +215 -0
  36. data/development/ruby/1.8/gems/fakeweb-1.3.0/LICENSE.txt +19 -0
  37. data/development/ruby/1.8/gems/fakeweb-1.3.0/README.rdoc +189 -0
  38. data/development/ruby/1.8/gems/fakeweb-1.3.0/Rakefile +67 -0
  39. data/development/ruby/1.8/gems/fakeweb-1.3.0/fakeweb.gemspec +126 -0
  40. data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/ext/net_http.rb +72 -0
  41. data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/registry.rb +127 -0
  42. data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/responder.rb +122 -0
  43. data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/response.rb +10 -0
  44. data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/stub_socket.rb +15 -0
  45. data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web/utility.rb +87 -0
  46. data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fake_web.rb +215 -0
  47. data/development/ruby/1.8/gems/fakeweb-1.3.0/lib/fakeweb.rb +2 -0
  48. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/fixtures/google_response_from_curl +12 -0
  49. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/fixtures/google_response_with_transfer_encoding +17 -0
  50. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/fixtures/google_response_without_transfer_encoding +11 -0
  51. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/fixtures/test_example.txt +1 -0
  52. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/fixtures/test_txt_file +3 -0
  53. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_allow_net_connect.rb +168 -0
  54. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_deprecations.rb +54 -0
  55. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_fake_authentication.rb +92 -0
  56. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_fake_web.rb +590 -0
  57. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_fake_web_open_uri.rb +58 -0
  58. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_helper.rb +90 -0
  59. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_last_request.rb +29 -0
  60. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_missing_open_uri.rb +25 -0
  61. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_missing_pathname.rb +37 -0
  62. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_other_net_http_libraries.rb +36 -0
  63. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_precedence.rb +79 -0
  64. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_query_string.rb +45 -0
  65. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_regexes.rb +157 -0
  66. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_response_headers.rb +79 -0
  67. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_trailing_slashes.rb +53 -0
  68. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/test_utility.rb +83 -0
  69. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/History.txt +59 -0
  70. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/Manifest.txt +7 -0
  71. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/README.txt +54 -0
  72. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/Rakefile +103 -0
  73. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/lib/net_fix.rb +160 -0
  74. 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
  75. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/right_http_connection-1.2.4/setup.rb +1585 -0
  76. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/.document +5 -0
  77. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/.gitignore +5 -0
  78. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/LICENSE +20 -0
  79. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/README.rdoc +70 -0
  80. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/Rakefile +62 -0
  81. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/VERSION +1 -0
  82. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/lib/samuel/net_http.rb +10 -0
  83. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/lib/samuel/request.rb +96 -0
  84. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/lib/samuel.rb +52 -0
  85. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/samuel.gemspec +69 -0
  86. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/test/request_test.rb +193 -0
  87. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/test/samuel_test.rb +42 -0
  88. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/test/test_helper.rb +66 -0
  89. data/development/ruby/1.8/gems/fakeweb-1.3.0/test/vendor/samuel-0.2.1/test/thread_test.rb +32 -0
  90. data/development/ruby/1.8/gems/hashie-0.4.0/.document +5 -0
  91. data/development/ruby/1.8/gems/hashie-0.4.0/.gitignore +7 -0
  92. data/development/ruby/1.8/gems/hashie-0.4.0/Gemfile +12 -0
  93. data/development/ruby/1.8/gems/hashie-0.4.0/Gemfile.lock +24 -0
  94. data/development/ruby/1.8/gems/hashie-0.4.0/LICENSE +20 -0
  95. data/development/ruby/1.8/gems/hashie-0.4.0/README.rdoc +119 -0
  96. data/development/ruby/1.8/gems/hashie-0.4.0/Rakefile +47 -0
  97. data/development/ruby/1.8/gems/hashie-0.4.0/VERSION +1 -0
  98. data/development/ruby/1.8/gems/hashie-0.4.0/hashie.gemspec +71 -0
  99. data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/clash.rb +86 -0
  100. data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/dash.rb +111 -0
  101. data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/hash.rb +24 -0
  102. data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/hash_extensions.rb +49 -0
  103. data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/mash.rb +178 -0
  104. data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie/trash.rb +55 -0
  105. data/development/ruby/1.8/gems/hashie-0.4.0/lib/hashie.rb +9 -0
  106. data/development/ruby/1.8/gems/hashie-0.4.0/spec/hashie/clash_spec.rb +42 -0
  107. data/development/ruby/1.8/gems/hashie-0.4.0/spec/hashie/dash_spec.rb +156 -0
  108. data/development/ruby/1.8/gems/hashie-0.4.0/spec/hashie/hash_spec.rb +22 -0
  109. data/development/ruby/1.8/gems/hashie-0.4.0/spec/hashie/mash_spec.rb +241 -0
  110. data/development/ruby/1.8/gems/hashie-0.4.0/spec/hashie/trash_spec.rb +70 -0
  111. data/development/ruby/1.8/gems/hashie-0.4.0/spec/spec.opts +3 -0
  112. data/development/ruby/1.8/gems/hashie-0.4.0/spec/spec_helper.rb +13 -0
  113. data/development/ruby/1.8/gems/json-1.4.6/.require_paths +4 -0
  114. data/development/ruby/1.8/gems/json-1.4.6/CHANGES +179 -0
  115. data/development/ruby/1.8/gems/json-1.4.6/COPYING +58 -0
  116. data/development/ruby/1.8/gems/json-1.4.6/GPL +340 -0
  117. data/development/ruby/1.8/gems/json-1.4.6/README +356 -0
  118. data/development/ruby/1.8/gems/json-1.4.6/Rakefile +292 -0
  119. data/development/ruby/1.8/gems/json-1.4.6/TODO +1 -0
  120. data/development/ruby/1.8/gems/json-1.4.6/VERSION +1 -0
  121. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
  122. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
  123. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
  124. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
  125. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
  126. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
  127. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
  128. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
  129. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
  130. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
  131. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
  132. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
  133. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
  134. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
  135. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
  136. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
  137. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
  138. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
  139. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
  140. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
  141. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
  142. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
  143. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
  144. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
  145. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
  146. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
  147. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
  148. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
  149. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
  150. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
  151. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
  152. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/generator2_benchmark.rb +222 -0
  153. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/generator_benchmark.rb +224 -0
  154. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/ohai.json +1216 -0
  155. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/ohai.ruby +1 -0
  156. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/parser2_benchmark.rb +251 -0
  157. data/development/ruby/1.8/gems/json-1.4.6/benchmarks/parser_benchmark.rb +259 -0
  158. data/development/ruby/1.8/gems/json-1.4.6/bin/edit_json.rb +9 -0
  159. data/development/ruby/1.8/gems/json-1.4.6/bin/prettify_json.rb +75 -0
  160. data/development/ruby/1.8/gems/json-1.4.6/data/example.json +1 -0
  161. data/development/ruby/1.8/gems/json-1.4.6/data/index.html +38 -0
  162. data/development/ruby/1.8/gems/json-1.4.6/data/prototype.js +4184 -0
  163. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/Makefile +157 -0
  164. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/extconf.rb +20 -0
  165. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/generator.bundle +0 -0
  166. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/generator.c +1417 -0
  167. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/generator.h +197 -0
  168. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/generator.o +0 -0
  169. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/mkmf.log +10 -0
  170. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/json/ext/generator.bundle +0 -0
  171. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/json/ext/parser.bundle +0 -0
  172. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/Makefile +157 -0
  173. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/extconf.rb +15 -0
  174. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/mkmf.log +10 -0
  175. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/parser.bundle +0 -0
  176. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/parser.c +1935 -0
  177. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/parser.h +71 -0
  178. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/parser.o +0 -0
  179. data/development/ruby/1.8/gems/json-1.4.6/ext/json/ext/parser/parser.rl +792 -0
  180. data/development/ruby/1.8/gems/json-1.4.6/install.rb +26 -0
  181. data/development/ruby/1.8/gems/json-1.4.6/lib/json/Array.xpm +21 -0
  182. data/development/ruby/1.8/gems/json-1.4.6/lib/json/FalseClass.xpm +21 -0
  183. data/development/ruby/1.8/gems/json-1.4.6/lib/json/Hash.xpm +21 -0
  184. data/development/ruby/1.8/gems/json-1.4.6/lib/json/Key.xpm +73 -0
  185. data/development/ruby/1.8/gems/json-1.4.6/lib/json/NilClass.xpm +21 -0
  186. data/development/ruby/1.8/gems/json-1.4.6/lib/json/Numeric.xpm +28 -0
  187. data/development/ruby/1.8/gems/json-1.4.6/lib/json/String.xpm +96 -0
  188. data/development/ruby/1.8/gems/json-1.4.6/lib/json/TrueClass.xpm +21 -0
  189. data/development/ruby/1.8/gems/json-1.4.6/lib/json/add/core.rb +148 -0
  190. data/development/ruby/1.8/gems/json-1.4.6/lib/json/add/rails.rb +58 -0
  191. data/development/ruby/1.8/gems/json-1.4.6/lib/json/common.rb +391 -0
  192. data/development/ruby/1.8/gems/json-1.4.6/lib/json/editor.rb +1371 -0
  193. data/development/ruby/1.8/gems/json-1.4.6/lib/json/ext.rb +15 -0
  194. data/development/ruby/1.8/gems/json-1.4.6/lib/json/json.xpm +1499 -0
  195. data/development/ruby/1.8/gems/json-1.4.6/lib/json/pure/generator.rb +439 -0
  196. data/development/ruby/1.8/gems/json-1.4.6/lib/json/pure/parser.rb +309 -0
  197. data/development/ruby/1.8/gems/json-1.4.6/lib/json/pure.rb +77 -0
  198. data/development/ruby/1.8/gems/json-1.4.6/lib/json/version.rb +8 -0
  199. data/development/ruby/1.8/gems/json-1.4.6/lib/json.rb +10 -0
  200. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail1.json +1 -0
  201. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail10.json +1 -0
  202. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail11.json +1 -0
  203. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail12.json +1 -0
  204. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail13.json +1 -0
  205. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail14.json +1 -0
  206. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail18.json +1 -0
  207. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail19.json +1 -0
  208. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail2.json +1 -0
  209. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail20.json +1 -0
  210. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail21.json +1 -0
  211. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail22.json +1 -0
  212. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail23.json +1 -0
  213. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail24.json +1 -0
  214. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail25.json +1 -0
  215. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail27.json +2 -0
  216. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail28.json +2 -0
  217. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail3.json +1 -0
  218. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail4.json +1 -0
  219. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail5.json +1 -0
  220. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail6.json +1 -0
  221. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail7.json +1 -0
  222. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail8.json +1 -0
  223. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/fail9.json +1 -0
  224. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass1.json +56 -0
  225. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass15.json +1 -0
  226. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass16.json +1 -0
  227. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass17.json +1 -0
  228. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass2.json +1 -0
  229. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass26.json +1 -0
  230. data/development/ruby/1.8/gems/json-1.4.6/tests/fixtures/pass3.json +6 -0
  231. data/development/ruby/1.8/gems/json-1.4.6/tests/test_json.rb +394 -0
  232. data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_addition.rb +162 -0
  233. data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_encoding.rb +68 -0
  234. data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_fixtures.rb +34 -0
  235. data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_generate.rb +181 -0
  236. data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_rails.rb +144 -0
  237. data/development/ruby/1.8/gems/json-1.4.6/tests/test_json_unicode.rb +76 -0
  238. data/development/ruby/1.8/gems/json-1.4.6/tools/fuzz.rb +139 -0
  239. data/development/ruby/1.8/gems/json-1.4.6/tools/server.rb +61 -0
  240. data/development/ruby/1.8/gems/omg-0.0.6/.document +5 -0
  241. data/development/ruby/1.8/gems/omg-0.0.6/.gitignore +21 -0
  242. data/development/ruby/1.8/gems/omg-0.0.6/LICENSE +20 -0
  243. data/development/ruby/1.8/gems/omg-0.0.6/README.rdoc +35 -0
  244. data/development/ruby/1.8/gems/omg-0.0.6/Rakefile +52 -0
  245. data/development/ruby/1.8/gems/omg-0.0.6/TODO +1 -0
  246. data/development/ruby/1.8/gems/omg-0.0.6/VERSION +1 -0
  247. data/development/ruby/1.8/gems/omg-0.0.6/lib/omg.rb +43 -0
  248. data/development/ruby/1.8/gems/omg-0.0.6/omg.gemspec +53 -0
  249. data/development/ruby/1.8/gems/omg-0.0.6/test/helper.rb +10 -0
  250. data/development/ruby/1.8/gems/omg-0.0.6/test/test_omg.rb +7 -0
  251. data/development/ruby/1.8/gems/shoulda-2.11.3/CONTRIBUTION_GUIDELINES.rdoc +10 -0
  252. data/development/ruby/1.8/gems/shoulda-2.11.3/MIT-LICENSE +22 -0
  253. data/development/ruby/1.8/gems/shoulda-2.11.3/README.rdoc +154 -0
  254. data/development/ruby/1.8/gems/shoulda-2.11.3/Rakefile +70 -0
  255. data/development/ruby/1.8/gems/shoulda-2.11.3/bin/convert_to_should_syntax +42 -0
  256. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/macros.rb +221 -0
  257. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/assign_to_matcher.rb +112 -0
  258. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/filter_param_matcher.rb +74 -0
  259. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/redirect_to_matcher.rb +62 -0
  260. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/render_template_matcher.rb +54 -0
  261. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/render_with_layout_matcher.rb +99 -0
  262. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/respond_with_content_type_matcher.rb +74 -0
  263. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/respond_with_matcher.rb +85 -0
  264. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/route_matcher.rb +93 -0
  265. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/set_session_matcher.rb +98 -0
  266. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb +100 -0
  267. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller/matchers.rb +39 -0
  268. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_controller.rb +34 -0
  269. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_mailer/assertions.rb +42 -0
  270. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_mailer/matchers/have_sent_email.rb +110 -0
  271. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_mailer/matchers.rb +22 -0
  272. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/action_mailer.rb +13 -0
  273. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/assertions.rb +69 -0
  274. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/helpers.rb +32 -0
  275. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/macros.rb +457 -0
  276. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/allow_mass_assignment_of_matcher.rb +83 -0
  277. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/allow_value_matcher.rb +110 -0
  278. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/association_matcher.rb +226 -0
  279. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/ensure_inclusion_of_matcher.rb +87 -0
  280. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/ensure_length_of_matcher.rb +141 -0
  281. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/have_db_column_matcher.rb +169 -0
  282. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/have_db_index_matcher.rb +112 -0
  283. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/have_readonly_attribute_matcher.rb +59 -0
  284. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validate_acceptance_of_matcher.rb +41 -0
  285. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validate_format_of_matcher.rb +65 -0
  286. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validate_numericality_of_matcher.rb +39 -0
  287. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validate_presence_of_matcher.rb +60 -0
  288. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validate_uniqueness_of_matcher.rb +148 -0
  289. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers/validation_matcher.rb +56 -0
  290. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record/matchers.rb +42 -0
  291. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/active_record.rb +16 -0
  292. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/assertions.rb +79 -0
  293. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/autoload_macros.rb +46 -0
  294. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/context.rb +433 -0
  295. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/helpers.rb +8 -0
  296. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/integrations/rspec.rb +13 -0
  297. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/integrations/rspec2.rb +22 -0
  298. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/integrations/test_unit.rb +22 -0
  299. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/macros.rb +161 -0
  300. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/private_helpers.rb +13 -0
  301. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb +14 -0
  302. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/rails.rb +8 -0
  303. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/tasks/list_tests.rake +29 -0
  304. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/tasks/yaml_to_shoulda.rake +28 -0
  305. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/tasks.rb +3 -0
  306. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/version.rb +4 -0
  307. data/development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda.rb +9 -0
  308. data/development/ruby/1.8/gems/shoulda-2.11.3/rails/init.rb +8 -0
  309. data/development/ruby/1.8/gems/shoulda-2.11.3/test/README +36 -0
  310. data/development/ruby/1.8/gems/shoulda-2.11.3/test/fail_macros.rb +55 -0
  311. data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/addresses.yml +3 -0
  312. data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/friendships.yml +0 -0
  313. data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/posts.yml +5 -0
  314. data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/products.yml +0 -0
  315. data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/taggings.yml +0 -0
  316. data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/tags.yml +9 -0
  317. data/development/ruby/1.8/gems/shoulda-2.11.3/test/fixtures/users.yml +6 -0
  318. data/development/ruby/1.8/gems/shoulda-2.11.3/test/functional/posts_controller_test.rb +121 -0
  319. data/development/ruby/1.8/gems/shoulda-2.11.3/test/functional/users_controller_test.rb +19 -0
  320. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/action_mailer/have_sent_email_test.rb +70 -0
  321. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/allow_mass_assignment_of_matcher_test.rb +74 -0
  322. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/allow_value_matcher_test.rb +64 -0
  323. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/association_matcher_test.rb +263 -0
  324. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/ensure_inclusion_of_matcher_test.rb +81 -0
  325. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/ensure_length_of_matcher_test.rb +158 -0
  326. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/have_db_column_matcher_test.rb +169 -0
  327. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/have_db_index_matcher_test.rb +91 -0
  328. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/have_readonly_attributes_matcher_test.rb +29 -0
  329. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/validate_acceptance_of_matcher_test.rb +44 -0
  330. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/validate_format_of_matcher_test.rb +39 -0
  331. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/validate_numericality_of_matcher_test.rb +52 -0
  332. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/validate_presence_of_matcher_test.rb +86 -0
  333. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/active_record/validate_uniqueness_of_matcher_test.rb +147 -0
  334. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/assign_to_matcher_test.rb +45 -0
  335. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/filter_param_matcher_test.rb +40 -0
  336. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/redirect_to_matcher_test.rb +37 -0
  337. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb +37 -0
  338. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/render_with_layout_matcher_test.rb +47 -0
  339. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/respond_with_content_type_matcher_test.rb +32 -0
  340. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/respond_with_matcher_test.rb +96 -0
  341. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/route_matcher_test.rb +75 -0
  342. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/set_session_matcher_test.rb +48 -0
  343. data/development/ruby/1.8/gems/shoulda-2.11.3/test/matchers/controller/set_the_flash_matcher.rb +95 -0
  344. data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/autoload_macro_test.rb +18 -0
  345. data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/context_test.rb +372 -0
  346. data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/convert_to_should_syntax_test.rb +63 -0
  347. data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/helpers_test.rb +317 -0
  348. data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/private_helpers_test.rb +32 -0
  349. data/development/ruby/1.8/gems/shoulda-2.11.3/test/other/should_test.rb +271 -0
  350. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_model_builder.rb +130 -0
  351. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/controllers/application_controller.rb +22 -0
  352. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/controllers/posts_controller.rb +87 -0
  353. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/controllers/users_controller.rb +84 -0
  354. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/helpers/application_helper.rb +3 -0
  355. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/helpers/posts_helper.rb +2 -0
  356. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/helpers/users_helper.rb +2 -0
  357. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/address.rb +7 -0
  358. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/flea.rb +11 -0
  359. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/friendship.rb +4 -0
  360. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/notifier.rb +8 -0
  361. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/pets/cat.rb +7 -0
  362. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/pets/dog.rb +10 -0
  363. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/post.rb +12 -0
  364. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/product.rb +12 -0
  365. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/profile.rb +2 -0
  366. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/registration.rb +2 -0
  367. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/tag.rb +8 -0
  368. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/tagging.rb +4 -0
  369. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/treat.rb +3 -0
  370. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/models/user.rb +32 -0
  371. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/layouts/posts.rhtml +19 -0
  372. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/layouts/users.rhtml +17 -0
  373. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/layouts/wide.html.erb +1 -0
  374. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/notifier/the_email.html.erb +1 -0
  375. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/posts/edit.rhtml +27 -0
  376. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/posts/index.rhtml +25 -0
  377. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/posts/new.rhtml +26 -0
  378. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/posts/show.rhtml +18 -0
  379. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/users/edit.rhtml +22 -0
  380. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/users/index.rhtml +22 -0
  381. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/users/new.rhtml +21 -0
  382. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/app/views/users/show.rhtml +13 -0
  383. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/boot.rb +110 -0
  384. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/database.yml +4 -0
  385. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/environment.rb +17 -0
  386. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/environments/test.rb +23 -0
  387. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/initializers/new_rails_defaults.rb +15 -0
  388. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/initializers/shoulda.rb +8 -0
  389. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/config/routes.rb +6 -0
  390. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/001_create_users.rb +19 -0
  391. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/002_create_posts.rb +13 -0
  392. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/003_create_taggings.rb +12 -0
  393. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/004_create_tags.rb +11 -0
  394. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/005_create_dogs.rb +12 -0
  395. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/006_create_addresses.rb +14 -0
  396. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/007_create_fleas.rb +11 -0
  397. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/008_create_dogs_fleas.rb +12 -0
  398. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/009_create_products.rb +17 -0
  399. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/010_create_friendships.rb +14 -0
  400. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/011_create_treats.rb +12 -0
  401. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/20090506203502_create_profiles.rb +12 -0
  402. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/20090506203536_create_registrations.rb +14 -0
  403. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/migrate/20090513104502_create_cats.rb +12 -0
  404. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/db/schema.rb +0 -0
  405. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/log/test.log +50381 -0
  406. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/public/404.html +30 -0
  407. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/public/422.html +30 -0
  408. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/public/500.html +30 -0
  409. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/script/console +3 -0
  410. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/script/generate +3 -0
  411. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_root/test/shoulda_macros/custom_macro.rb +6 -0
  412. 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
  413. 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
  414. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails2_test_helper.rb +6 -0
  415. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_model_builder.rb +118 -0
  416. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/Gemfile +28 -0
  417. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/README +244 -0
  418. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/Rakefile +10 -0
  419. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/controllers/application_controller.rb +22 -0
  420. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/controllers/posts_controller.rb +87 -0
  421. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/controllers/users_controller.rb +82 -0
  422. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/helpers/application_helper.rb +2 -0
  423. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/address.rb +7 -0
  424. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/flea.rb +11 -0
  425. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/friendship.rb +4 -0
  426. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/notifier.rb +8 -0
  427. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/pets/cat.rb +7 -0
  428. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/pets/dog.rb +10 -0
  429. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/post.rb +12 -0
  430. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/product.rb +12 -0
  431. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/profile.rb +2 -0
  432. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/registration.rb +2 -0
  433. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/tag.rb +8 -0
  434. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/tagging.rb +4 -0
  435. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/treat.rb +3 -0
  436. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/models/user.rb +32 -0
  437. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/layouts/application.html.erb +14 -0
  438. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/layouts/posts.rhtml +19 -0
  439. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/layouts/users.rhtml +17 -0
  440. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/layouts/wide.html.erb +1 -0
  441. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/notifier/the_email.html.erb +1 -0
  442. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/posts/edit.rhtml +27 -0
  443. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/posts/index.rhtml +25 -0
  444. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/posts/new.rhtml +24 -0
  445. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/posts/show.rhtml +18 -0
  446. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/users/edit.rhtml +22 -0
  447. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/users/index.rhtml +22 -0
  448. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/users/new.rhtml +21 -0
  449. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/app/views/users/show.rhtml +13 -0
  450. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/application.rb +46 -0
  451. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/boot.rb +6 -0
  452. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/database.yml +22 -0
  453. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/environment.rb +5 -0
  454. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/environments/development.rb +19 -0
  455. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/environments/production.rb +42 -0
  456. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/environments/test.rb +32 -0
  457. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/initializers/backtrace_silencers.rb +7 -0
  458. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/initializers/inflections.rb +10 -0
  459. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/initializers/mime_types.rb +5 -0
  460. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/initializers/secret_token.rb +7 -0
  461. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/initializers/session_store.rb +8 -0
  462. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/locales/en.yml +5 -0
  463. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config/routes.rb +4 -0
  464. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/config.ru +4 -0
  465. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/001_create_users.rb +19 -0
  466. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/002_create_posts.rb +13 -0
  467. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/003_create_taggings.rb +12 -0
  468. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/004_create_tags.rb +11 -0
  469. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/005_create_dogs.rb +12 -0
  470. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/006_create_addresses.rb +14 -0
  471. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/007_create_fleas.rb +11 -0
  472. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/008_create_dogs_fleas.rb +12 -0
  473. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/009_create_products.rb +17 -0
  474. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/010_create_friendships.rb +14 -0
  475. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/011_create_treats.rb +12 -0
  476. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/20090506203502_create_profiles.rb +12 -0
  477. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/20090506203536_create_registrations.rb +14 -0
  478. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/migrate/20090513104502_create_cats.rb +12 -0
  479. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/seeds.rb +7 -0
  480. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/db/test.sqlite3 +0 -0
  481. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/log/test.log +10834 -0
  482. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/404.html +26 -0
  483. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/422.html +26 -0
  484. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/500.html +26 -0
  485. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/favicon.ico +0 -0
  486. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/images/rails.png +0 -0
  487. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/index.html +279 -0
  488. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/application.js +2 -0
  489. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/controls.js +965 -0
  490. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/dragdrop.js +974 -0
  491. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/effects.js +1123 -0
  492. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/prototype.js +4874 -0
  493. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/javascripts/rails.js +118 -0
  494. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/public/robots.txt +5 -0
  495. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/script/rails +9 -0
  496. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/test/performance/browsing_test.rb +9 -0
  497. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_root/test/test_helper.rb +13 -0
  498. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rails3_test_helper.rb +6 -0
  499. data/development/ruby/1.8/gems/shoulda-2.11.3/test/rspec_test.rb +207 -0
  500. data/development/ruby/1.8/gems/shoulda-2.11.3/test/test_helper.rb +36 -0
  501. data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/address_test.rb +10 -0
  502. data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/cat_test.rb +7 -0
  503. data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/dog_test.rb +9 -0
  504. data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/flea_test.rb +14 -0
  505. data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/friendship_test.rb +6 -0
  506. data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/post_test.rb +15 -0
  507. data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/product_test.rb +23 -0
  508. data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/tag_test.rb +11 -0
  509. data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/tagging_test.rb +6 -0
  510. data/development/ruby/1.8/gems/shoulda-2.11.3/test/unit/user_test.rb +46 -0
  511. data/development/ruby/1.8/specifications/crack-0.1.8.gemspec +30 -0
  512. data/development/ruby/1.8/specifications/fakeweb-1.3.0.gemspec +34 -0
  513. data/development/ruby/1.8/specifications/hashie-0.4.0.gemspec +33 -0
  514. data/development/ruby/1.8/specifications/json-1.4.6.gemspec +34 -0
  515. data/development/ruby/1.8/specifications/omg-0.0.6.gemspec +30 -0
  516. data/development/ruby/1.8/specifications/shoulda-2.11.3.gemspec +32 -0
  517. data/lib/putio/client.rb +74 -0
  518. data/lib/putio/putio.rb +5 -0
  519. data/lib/putio.rb +4 -0
  520. data/putio.gemspec +25 -0
  521. data/test/fixtures/user_friends.json +1 -0
  522. data/test/fixtures/user_info.json +1 -0
  523. data/test/test_helper.rb +19 -0
  524. data/test/units/client_test.rb +11 -0
  525. data/test/units/putio_test.rb +11 -0
  526. data/test/units/user_test.rb +39 -0
  527. metadata +675 -0
@@ -0,0 +1,169 @@
1
+ module Shoulda # :nodoc:
2
+ module ActiveRecord # :nodoc:
3
+ module Matchers
4
+
5
+ # Ensures the database column exists.
6
+ #
7
+ # Options:
8
+ # * <tt>of_type</tt> - db column type (:integer, :string, etc.)
9
+ # * <tt>with_options</tt> - same options available in migrations
10
+ # (:default, :null, :limit, :precision, :scale)
11
+ #
12
+ # Examples:
13
+ # it { should_not have_db_column(:admin).of_type(:boolean) }
14
+ # it { should have_db_column(:salary).
15
+ # of_type(:decimal).
16
+ # with_options(:precision => 10, :scale => 2) }
17
+ #
18
+ def have_db_column(column)
19
+ HaveDbColumnMatcher.new(:have_db_column, column)
20
+ end
21
+
22
+ class HaveDbColumnMatcher # :nodoc:
23
+ def initialize(macro, column)
24
+ @macro = macro
25
+ @column = column
26
+ end
27
+
28
+ def of_type(column_type)
29
+ @column_type = column_type
30
+ self
31
+ end
32
+
33
+ def with_options(opts = {})
34
+ @precision = opts[:precision]
35
+ @limit = opts[:limit]
36
+ @default = opts[:default]
37
+ @null = opts[:null]
38
+ @scale = opts[:scale]
39
+ self
40
+ end
41
+
42
+ def matches?(subject)
43
+ @subject = subject
44
+ column_exists? &&
45
+ correct_column_type? &&
46
+ correct_precision? &&
47
+ correct_limit? &&
48
+ correct_default? &&
49
+ correct_null? &&
50
+ correct_scale?
51
+ end
52
+
53
+ def failure_message
54
+ "Expected #{expectation} (#{@missing})"
55
+ end
56
+
57
+ def negative_failure_message
58
+ "Did not expect #{expectation}"
59
+ end
60
+
61
+ def description
62
+ desc = "have db column named #{@column}"
63
+ desc << " of type #{@column_type}" unless @column_type.nil?
64
+ desc << " of precision #{@precision}" unless @precision.nil?
65
+ desc << " of limit #{@limit}" unless @limit.nil?
66
+ desc << " of default #{@default}" unless @default.nil?
67
+ desc << " of null #{@null}" unless @null.nil?
68
+ desc << " of primary #{@primary}" unless @primary.nil?
69
+ desc << " of scale #{@scale}" unless @scale.nil?
70
+ desc
71
+ end
72
+
73
+ protected
74
+
75
+ def column_exists?
76
+ if model_class.column_names.include?(@column.to_s)
77
+ true
78
+ else
79
+ @missing = "#{model_class} does not have a db column named #{@column}."
80
+ false
81
+ end
82
+ end
83
+
84
+ def correct_column_type?
85
+ return true if @column_type.nil?
86
+ if matched_column.type.to_s == @column_type.to_s
87
+ true
88
+ else
89
+ @missing = "#{model_class} has a db column named #{@column} " <<
90
+ "of type #{matched_column.type}, not #{@column_type}."
91
+ false
92
+ end
93
+ end
94
+
95
+ def correct_precision?
96
+ return true if @precision.nil?
97
+ if matched_column.precision.to_s == @precision.to_s
98
+ true
99
+ else
100
+ @missing = "#{model_class} has a db column named #{@column} " <<
101
+ "of precision #{matched_column.precision}, " <<
102
+ "not #{@precision}."
103
+ false
104
+ end
105
+ end
106
+
107
+ def correct_limit?
108
+ return true if @limit.nil?
109
+ if matched_column.limit.to_s == @limit.to_s
110
+ true
111
+ else
112
+ @missing = "#{model_class} has a db column named #{@column} " <<
113
+ "of limit #{matched_column.limit}, " <<
114
+ "not #{@limit}."
115
+ false
116
+ end
117
+ end
118
+
119
+ def correct_default?
120
+ return true if @default.nil?
121
+ if matched_column.default.to_s == @default.to_s
122
+ true
123
+ else
124
+ @missing = "#{model_class} has a db column named #{@column} " <<
125
+ "of default #{matched_column.default}, " <<
126
+ "not #{@default}."
127
+ false
128
+ end
129
+ end
130
+
131
+ def correct_null?
132
+ return true if @null.nil?
133
+ if matched_column.null.to_s == @null.to_s
134
+ true
135
+ else
136
+ @missing = "#{model_class} has a db column named #{@column} " <<
137
+ "of null #{matched_column.null}, " <<
138
+ "not #{@null}."
139
+ false
140
+ end
141
+ end
142
+
143
+ def correct_scale?
144
+ return true if @scale.nil?
145
+ if matched_column.scale.to_s == @scale.to_s
146
+ true
147
+ else
148
+ @missing = "#{model_class} has a db column named #{@column} " <<
149
+ "of scale #{matched_column.scale}, not #{@scale}."
150
+ false
151
+ end
152
+ end
153
+
154
+ def matched_column
155
+ model_class.columns.detect { |each| each.name == @column.to_s }
156
+ end
157
+
158
+ def model_class
159
+ @subject.class
160
+ end
161
+
162
+ def expectation
163
+ expected = "#{model_class.name} to #{description}"
164
+ end
165
+ end
166
+
167
+ end
168
+ end
169
+ end
@@ -0,0 +1,112 @@
1
+ module Shoulda # :nodoc:
2
+ module ActiveRecord # :nodoc:
3
+ module Matchers
4
+
5
+ # Ensures that there are DB indices on the given columns or tuples of
6
+ # columns.
7
+ #
8
+ # Options:
9
+ # * <tt>unique</tt> - whether or not the index has a unique
10
+ # constraint. Use <tt>true</tt> to explicitly test for a unique
11
+ # constraint. Use <tt>false</tt> to explicitly test for a non-unique
12
+ # constraint. Use <tt>nil</tt> if you don't care whether the index is
13
+ # unique or not. Default = <tt>nil</tt>
14
+ #
15
+ # Examples:
16
+ #
17
+ # it { should have_db_index(:age) }
18
+ # it { should have_db_index([:commentable_type, :commentable_id]) }
19
+ # it { should have_db_index(:ssn).unique(true) }
20
+ #
21
+ def have_db_index(columns)
22
+ HaveDbIndexMatcher.new(:have_index, columns)
23
+ end
24
+
25
+ class HaveDbIndexMatcher # :nodoc:
26
+ def initialize(macro, columns)
27
+ @macro = macro
28
+ @columns = normalize_columns_to_array(columns)
29
+ end
30
+
31
+ def unique(unique)
32
+ @unique = unique
33
+ self
34
+ end
35
+
36
+ def matches?(subject)
37
+ @subject = subject
38
+ index_exists? && correct_unique?
39
+ end
40
+
41
+ def failure_message
42
+ "Expected #{expectation} (#{@missing})"
43
+ end
44
+
45
+ def negative_failure_message
46
+ "Did not expect #{expectation}"
47
+ end
48
+
49
+ def description
50
+ "have a #{index_type} index on columns #{@columns.join(' and ')}"
51
+ end
52
+
53
+ protected
54
+
55
+ def index_exists?
56
+ ! matched_index.nil?
57
+ end
58
+
59
+ def correct_unique?
60
+ return true if @unique.nil?
61
+ if matched_index.unique == @unique
62
+ true
63
+ else
64
+ @missing = "#{table_name} has an index named #{matched_index.name} " <<
65
+ "of unique #{matched_index.unique}, not #{@unique}."
66
+ false
67
+ end
68
+ end
69
+
70
+ def matched_index
71
+ indexes.detect { |each| each.columns == @columns }
72
+ end
73
+
74
+ def model_class
75
+ @subject.class
76
+ end
77
+
78
+ def table_name
79
+ model_class.table_name
80
+ end
81
+
82
+ def indexes
83
+ ::ActiveRecord::Base.connection.indexes(table_name)
84
+ end
85
+
86
+ def expectation
87
+ expected = "#{model_class.name} to #{description}"
88
+ end
89
+
90
+ def index_type
91
+ case @unique
92
+ when nil
93
+ ''
94
+ when false
95
+ 'non-unique'
96
+ else
97
+ 'unique'
98
+ end
99
+ end
100
+
101
+ def normalize_columns_to_array(columns)
102
+ if columns.class == Array
103
+ columns.collect { |each| each.to_s }
104
+ else
105
+ [columns.to_s]
106
+ end
107
+ end
108
+ end
109
+
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,59 @@
1
+ module Shoulda # :nodoc:
2
+ module ActiveRecord # :nodoc:
3
+ module Matchers
4
+
5
+ # Ensures that the attribute cannot be changed once the record has been
6
+ # created.
7
+ #
8
+ # it { should have_readonly_attributes(:password) }
9
+ #
10
+ def have_readonly_attribute(value)
11
+ HaveReadonlyAttributeMatcher.new(value)
12
+ end
13
+
14
+ class HaveReadonlyAttributeMatcher # :nodoc:
15
+
16
+ def initialize(attribute)
17
+ @attribute = attribute.to_s
18
+ end
19
+
20
+ def matches?(subject)
21
+ @subject = subject
22
+ if readonly_attributes.include?(@attribute)
23
+ @negative_failure_message =
24
+ "Did not expect #{@attribute} to be read-only"
25
+ true
26
+ else
27
+ if readonly_attributes.empty?
28
+ @failure_message = "#{class_name} attribute #{@attribute} " <<
29
+ "is not read-only"
30
+ else
31
+ @failure_message = "#{class_name} is making " <<
32
+ "#{readonly_attributes.to_sentence} " <<
33
+ "read-only, but not #{@attribute}."
34
+ end
35
+ false
36
+ end
37
+ end
38
+
39
+ attr_reader :failure_message, :negative_failure_message
40
+
41
+ def description
42
+ "make #{@attribute} read-only"
43
+ end
44
+
45
+ private
46
+
47
+ def readonly_attributes
48
+ @readonly_attributes ||= (@subject.class.readonly_attributes || [])
49
+ end
50
+
51
+ def class_name
52
+ @subject.class.name
53
+ end
54
+
55
+ end
56
+
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,41 @@
1
+ module Shoulda # :nodoc:
2
+ module ActiveRecord # :nodoc:
3
+ module Matchers
4
+
5
+ # Ensures that the model cannot be saved the given attribute is not
6
+ # accepted.
7
+ #
8
+ # Options:
9
+ # * <tt>with_message</tt> - value the test expects to find in
10
+ # <tt>errors.on(:attribute)</tt>. Regexp or string. Defaults to the
11
+ # translation for <tt>:accepted</tt>.
12
+ #
13
+ # Example:
14
+ # it { should validate_acceptance_of(:eula) }
15
+ #
16
+ def validate_acceptance_of(attr)
17
+ ValidateAcceptanceOfMatcher.new(attr)
18
+ end
19
+
20
+ class ValidateAcceptanceOfMatcher < ValidationMatcher # :nodoc:
21
+
22
+ def with_message(message)
23
+ @expected_message = message if message
24
+ self
25
+ end
26
+
27
+ def matches?(subject)
28
+ super(subject)
29
+ @expected_message ||= :accepted
30
+ disallows_value_of(false, @expected_message)
31
+ end
32
+
33
+ def description
34
+ "require #{@attribute} to be accepted"
35
+ end
36
+
37
+ end
38
+
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,65 @@
1
+ module Shoulda # :nodoc:
2
+ module ActiveRecord # :nodoc:
3
+ module Matchers
4
+
5
+ # Ensures that the model is not valid if the given attribute is not
6
+ # formatted correctly.
7
+ #
8
+ # Options:
9
+ # * <tt>with_message</tt> - value the test expects to find in
10
+ # <tt>errors.on(:attribute)</tt>. <tt>Regexp</tt> or <tt>String</tt>.
11
+ # Defaults to the translation for <tt>:blank</tt>.
12
+ # * <tt>with(string to test against)</tt>
13
+ # * <tt>not_with(string to test against)</tt>
14
+ #
15
+ # Examples:
16
+ # it { should validate_format_of(:name).
17
+ # with('12345').
18
+ # with_message(/is not optional/) }
19
+ # it { should validate_format_of(:name).
20
+ # not_with('12D45').
21
+ # with_message(/is not optional/) }
22
+ #
23
+ def validate_format_of(attr)
24
+ ValidateFormatOfMatcher.new(attr)
25
+ end
26
+
27
+ class ValidateFormatOfMatcher < ValidationMatcher # :nodoc:
28
+
29
+ def initialize(attribute)
30
+ super
31
+ end
32
+
33
+ def with_message(message)
34
+ @expected_message = message if message
35
+ self
36
+ end
37
+
38
+ def with(value)
39
+ raise "You may not call both with and not_with" if @value_to_fail
40
+ @value_to_pass = value
41
+ self
42
+ end
43
+
44
+ def not_with(value)
45
+ raise "You may not call both with and not_with" if @value_to_pass
46
+ @value_to_fail = value
47
+ self
48
+ end
49
+
50
+ def matches?(subject)
51
+ super(subject)
52
+ @expected_message ||= :blank
53
+ return disallows_value_of(@value_to_fail, @expected_message) if @value_to_fail
54
+ allows_value_of(@value_to_pass, @expected_message) if @value_to_pass
55
+ end
56
+
57
+ def description
58
+ "#{@attribute} have a valid format"
59
+ end
60
+
61
+ end
62
+
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,39 @@
1
+ module Shoulda # :nodoc:
2
+ module ActiveRecord # :nodoc:
3
+ module Matchers
4
+
5
+ # Ensure that the attribute is numeric
6
+ #
7
+ # Options:
8
+ # * <tt>with_message</tt> - value the test expects to find in
9
+ # <tt>errors.on(:attribute)</tt>. Regexp or string. Defaults to the
10
+ # translation for <tt>:not_a_number</tt>.
11
+ #
12
+ # Example:
13
+ # it { should validate_numericality_of(:age) }
14
+ #
15
+ def validate_numericality_of(attr)
16
+ ValidateNumericalityOfMatcher.new(attr)
17
+ end
18
+
19
+ class ValidateNumericalityOfMatcher < ValidationMatcher # :nodoc:
20
+
21
+ def with_message(message)
22
+ @expected_message = message if message
23
+ self
24
+ end
25
+
26
+ def matches?(subject)
27
+ super(subject)
28
+ @expected_message ||= :not_a_number
29
+ disallows_value_of('abcd', @expected_message)
30
+ end
31
+
32
+ def description
33
+ "only allow numeric values for #{@attribute}"
34
+ end
35
+ end
36
+
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,60 @@
1
+ module Shoulda # :nodoc:
2
+ module ActiveRecord # :nodoc:
3
+ module Matchers
4
+
5
+ # Ensures that the model is not valid if the given attribute is not
6
+ # present.
7
+ #
8
+ # Options:
9
+ # * <tt>with_message</tt> - value the test expects to find in
10
+ # <tt>errors.on(:attribute)</tt>. <tt>Regexp</tt> or <tt>String</tt>.
11
+ # Defaults to the translation for <tt>:blank</tt>.
12
+ #
13
+ # Examples:
14
+ # it { should validate_presence_of(:name) }
15
+ # it { should validate_presence_of(:name).
16
+ # with_message(/is not optional/) }
17
+ #
18
+ def validate_presence_of(attr)
19
+ ValidatePresenceOfMatcher.new(attr)
20
+ end
21
+
22
+ class ValidatePresenceOfMatcher < ValidationMatcher # :nodoc:
23
+
24
+ def with_message(message)
25
+ @expected_message = message if message
26
+ self
27
+ end
28
+
29
+ def matches?(subject)
30
+ super(subject)
31
+ @expected_message ||= :blank
32
+ disallows_value_of(blank_value, @expected_message)
33
+ end
34
+
35
+ def description
36
+ "require #{@attribute} to be set"
37
+ end
38
+
39
+ private
40
+
41
+ def blank_value
42
+ if collection?
43
+ []
44
+ else
45
+ nil
46
+ end
47
+ end
48
+
49
+ def collection?
50
+ if reflection = @subject.class.reflect_on_association(@attribute)
51
+ [:has_many, :has_and_belongs_to_many].include?(reflection.macro)
52
+ else
53
+ false
54
+ end
55
+ end
56
+ end
57
+
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,148 @@
1
+ module Shoulda # :nodoc:
2
+ module ActiveRecord # :nodoc:
3
+ module Matchers
4
+
5
+ # Ensures that the model is invalid if the given attribute is not unique.
6
+ #
7
+ # Internally, this uses values from existing records to test validations,
8
+ # so this will always fail if you have not saved at least one record for
9
+ # the model being tested, like so:
10
+ #
11
+ # describe User do
12
+ # before(:each) { User.create!(:email => 'address@example.com') }
13
+ # it { should validate_uniqueness_of(:email) }
14
+ # end
15
+ #
16
+ # Options:
17
+ #
18
+ # * <tt>with_message</tt> - value the test expects to find in
19
+ # <tt>errors.on(:attribute)</tt>. <tt>Regexp</tt> or <tt>String</tt>.
20
+ # Defaults to the translation for <tt>:taken</tt>.
21
+ # * <tt>scoped_to</tt> - field(s) to scope the uniqueness to.
22
+ # * <tt>case_insensitive</tt> - ensures that the validation does not
23
+ # check case. Off by default. Ignored by non-text attributes.
24
+ #
25
+ # Examples:
26
+ # it { should validate_uniqueness_of(:keyword) }
27
+ # it { should validate_uniqueness_of(:keyword).with_message(/dup/) }
28
+ # it { should validate_uniqueness_of(:email).scoped_to(:name) }
29
+ # it { should validate_uniqueness_of(:email).
30
+ # scoped_to(:first_name, :last_name) }
31
+ # it { should validate_uniqueness_of(:keyword).case_insensitive }
32
+ #
33
+ def validate_uniqueness_of(attr)
34
+ ValidateUniquenessOfMatcher.new(attr)
35
+ end
36
+
37
+ class ValidateUniquenessOfMatcher < ValidationMatcher # :nodoc:
38
+ include Helpers
39
+
40
+ def initialize(attribute)
41
+ @attribute = attribute
42
+ end
43
+
44
+ def scoped_to(*scopes)
45
+ @scopes = [*scopes].flatten
46
+ self
47
+ end
48
+
49
+ def with_message(message)
50
+ @expected_message = message
51
+ self
52
+ end
53
+
54
+ def case_insensitive
55
+ @case_insensitive = true
56
+ self
57
+ end
58
+
59
+ def description
60
+ result = "require "
61
+ result << "case sensitive " unless @case_insensitive
62
+ result << "unique value for #{@attribute}"
63
+ result << " scoped to #{@scopes.join(', ')}" unless @scopes.blank?
64
+ result
65
+ end
66
+
67
+ def matches?(subject)
68
+ @subject = subject.class.new
69
+ @expected_message ||= :taken
70
+ find_existing &&
71
+ set_scoped_attributes &&
72
+ validate_attribute &&
73
+ validate_after_scope_change
74
+ end
75
+
76
+ private
77
+
78
+ def find_existing
79
+ if @existing = @subject.class.find(:first)
80
+ true
81
+ else
82
+ @failure_message = "Can't find first #{class_name}"
83
+ false
84
+ end
85
+ end
86
+
87
+ def set_scoped_attributes
88
+ unless @scopes.blank?
89
+ @scopes.each do |scope|
90
+ setter = :"#{scope}="
91
+ unless @subject.respond_to?(setter)
92
+ @failure_message =
93
+ "#{class_name} doesn't seem to have a #{scope} attribute."
94
+ return false
95
+ end
96
+ @subject.send("#{scope}=", @existing.send(scope))
97
+ end
98
+ end
99
+ true
100
+ end
101
+
102
+ def validate_attribute
103
+ disallows_value_of(existing_value, @expected_message)
104
+ end
105
+
106
+ # TODO: There is a chance that we could change the scoped field
107
+ # to a value that's already taken. An alternative implementation
108
+ # could actually find all values for scope and create a unique
109
+ def validate_after_scope_change
110
+ if @scopes.blank?
111
+ true
112
+ else
113
+ @scopes.all? do |scope|
114
+ previous_value = @existing.send(scope)
115
+
116
+ # Assume the scope is a foreign key if the field is nil
117
+ previous_value ||= 0
118
+
119
+ next_value = previous_value.next
120
+
121
+ @subject.send("#{scope}=", next_value)
122
+
123
+ if allows_value_of(existing_value, @expected_message)
124
+ @negative_failure_message <<
125
+ " (with different value of #{scope})"
126
+ true
127
+ else
128
+ @failure_message << " (with different value of #{scope})"
129
+ false
130
+ end
131
+ end
132
+ end
133
+ end
134
+
135
+ def class_name
136
+ @subject.class.name
137
+ end
138
+
139
+ def existing_value
140
+ value = @existing.send(@attribute)
141
+ value.swapcase! if @case_insensitive && value.respond_to?(:swapcase!)
142
+ value
143
+ end
144
+ end
145
+
146
+ end
147
+ end
148
+ end