nutshell-crm 0.0.5 → 0.0.6.alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. data/.rbenv-version +1 -0
  2. data/.travis.yml +8 -0
  3. data/CHANGELOG.md +5 -0
  4. data/README.md +37 -0
  5. data/Rakefile +14 -3
  6. data/lib/nutshell-crm.rb +92 -5
  7. data/lib/nutshell-crm/version.rb +1 -1
  8. data/nutshell-crm.gemspec +1 -0
  9. data/spec/nutshell-crm_spec.rb +17 -8
  10. data/vendor/bundle/bin/rake +19 -0
  11. data/vendor/bundle/gems/json-1.6.4/.gitignore +8 -0
  12. data/vendor/bundle/gems/json-1.6.4/.travis.yml +15 -0
  13. data/vendor/bundle/gems/json-1.6.4/CHANGES +227 -0
  14. data/vendor/bundle/gems/json-1.6.4/COPYING +58 -0
  15. data/vendor/bundle/gems/json-1.6.4/COPYING-json-jruby +57 -0
  16. data/vendor/bundle/gems/json-1.6.4/GPL +340 -0
  17. data/vendor/bundle/gems/json-1.6.4/Gemfile +11 -0
  18. data/vendor/bundle/gems/json-1.6.4/README-json-jruby.markdown +33 -0
  19. data/vendor/bundle/gems/json-1.6.4/README.rdoc +358 -0
  20. data/vendor/bundle/gems/json-1.6.4/Rakefile +408 -0
  21. data/vendor/bundle/gems/json-1.6.4/TODO +1 -0
  22. data/vendor/bundle/gems/json-1.6.4/VERSION +1 -0
  23. data/{README → vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/.keep} +0 -0
  24. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
  25. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
  26. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
  27. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
  28. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
  29. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
  30. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
  31. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
  32. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
  33. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
  34. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
  35. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
  36. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
  37. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
  38. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
  39. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
  40. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
  41. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
  42. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
  43. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
  44. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
  45. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
  46. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
  47. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
  48. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
  49. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
  50. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
  51. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
  52. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
  53. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
  54. data/vendor/bundle/gems/json-1.6.4/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
  55. data/vendor/bundle/gems/json-1.6.4/benchmarks/data/.keep +0 -0
  56. data/vendor/bundle/gems/json-1.6.4/benchmarks/generator2_benchmark.rb +222 -0
  57. data/vendor/bundle/gems/json-1.6.4/benchmarks/generator_benchmark.rb +224 -0
  58. data/vendor/bundle/gems/json-1.6.4/benchmarks/ohai.json +1216 -0
  59. data/vendor/bundle/gems/json-1.6.4/benchmarks/ohai.ruby +1 -0
  60. data/vendor/bundle/gems/json-1.6.4/benchmarks/parser2_benchmark.rb +251 -0
  61. data/vendor/bundle/gems/json-1.6.4/benchmarks/parser_benchmark.rb +259 -0
  62. data/vendor/bundle/gems/json-1.6.4/data/example.json +1 -0
  63. data/vendor/bundle/gems/json-1.6.4/data/index.html +38 -0
  64. data/vendor/bundle/gems/json-1.6.4/data/prototype.js +4184 -0
  65. data/vendor/bundle/gems/json-1.6.4/diagrams/.keep +0 -0
  66. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/fbuffer/fbuffer.h +156 -0
  67. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/generator/Makefile +187 -0
  68. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/generator/extconf.rb +13 -0
  69. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/generator/generator.bundle +0 -0
  70. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/generator/generator.c +1384 -0
  71. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/generator/generator.h +161 -0
  72. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/generator/generator.o +0 -0
  73. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/json/ext/generator.bundle +0 -0
  74. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/json/ext/parser.bundle +0 -0
  75. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/parser/Makefile +187 -0
  76. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/parser/extconf.rb +13 -0
  77. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/parser/parser.bundle +0 -0
  78. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/parser/parser.c +2203 -0
  79. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/parser/parser.h +77 -0
  80. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/parser/parser.o +0 -0
  81. data/vendor/bundle/gems/json-1.6.4/ext/json/ext/parser/parser.rl +926 -0
  82. data/vendor/bundle/gems/json-1.6.4/install.rb +19 -0
  83. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/ByteListTranscoder.java +167 -0
  84. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/Generator.java +437 -0
  85. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/GeneratorMethods.java +232 -0
  86. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/GeneratorService.java +43 -0
  87. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/GeneratorState.java +522 -0
  88. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/OptionsReader.java +113 -0
  89. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/Parser.java +2640 -0
  90. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/Parser.rl +964 -0
  91. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/ParserService.java +35 -0
  92. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/RuntimeInfo.java +121 -0
  93. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/StringDecoder.java +166 -0
  94. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/StringEncoder.java +106 -0
  95. data/vendor/bundle/gems/json-1.6.4/java/src/json/ext/Utils.java +89 -0
  96. data/vendor/bundle/gems/json-1.6.4/json-java.gemspec +22 -0
  97. data/vendor/bundle/gems/json-1.6.4/json.gemspec +40 -0
  98. data/vendor/bundle/gems/json-1.6.4/json_pure.gemspec +42 -0
  99. data/vendor/bundle/gems/json-1.6.4/lib/json.rb +62 -0
  100. data/vendor/bundle/gems/json-1.6.4/lib/json/add/bigdecimal.rb +21 -0
  101. data/vendor/bundle/gems/json-1.6.4/lib/json/add/complex.rb +22 -0
  102. data/vendor/bundle/gems/json-1.6.4/lib/json/add/core.rb +11 -0
  103. data/vendor/bundle/gems/json-1.6.4/lib/json/add/date.rb +34 -0
  104. data/vendor/bundle/gems/json-1.6.4/lib/json/add/date_time.rb +50 -0
  105. data/vendor/bundle/gems/json-1.6.4/lib/json/add/exception.rb +31 -0
  106. data/vendor/bundle/gems/json-1.6.4/lib/json/add/ostruct.rb +31 -0
  107. data/vendor/bundle/gems/json-1.6.4/lib/json/add/range.rb +29 -0
  108. data/vendor/bundle/gems/json-1.6.4/lib/json/add/rational.rb +22 -0
  109. data/vendor/bundle/gems/json-1.6.4/lib/json/add/regexp.rb +30 -0
  110. data/vendor/bundle/gems/json-1.6.4/lib/json/add/struct.rb +30 -0
  111. data/vendor/bundle/gems/json-1.6.4/lib/json/add/symbol.rb +25 -0
  112. data/vendor/bundle/gems/json-1.6.4/lib/json/add/time.rb +35 -0
  113. data/vendor/bundle/gems/json-1.6.4/lib/json/common.rb +470 -0
  114. data/vendor/bundle/gems/json-1.6.4/lib/json/ext.rb +21 -0
  115. data/vendor/bundle/gems/json-1.6.4/lib/json/ext/.keep +0 -0
  116. data/vendor/bundle/gems/json-1.6.4/lib/json/pure.rb +21 -0
  117. data/vendor/bundle/gems/json-1.6.4/lib/json/pure/generator.rb +468 -0
  118. data/vendor/bundle/gems/json-1.6.4/lib/json/pure/parser.rb +359 -0
  119. data/vendor/bundle/gems/json-1.6.4/lib/json/version.rb +8 -0
  120. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail1.json +1 -0
  121. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail10.json +1 -0
  122. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail11.json +1 -0
  123. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail12.json +1 -0
  124. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail13.json +1 -0
  125. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail14.json +1 -0
  126. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail18.json +1 -0
  127. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail19.json +1 -0
  128. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail2.json +1 -0
  129. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail20.json +1 -0
  130. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail21.json +1 -0
  131. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail22.json +1 -0
  132. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail23.json +1 -0
  133. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail24.json +1 -0
  134. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail25.json +1 -0
  135. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail27.json +2 -0
  136. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail28.json +2 -0
  137. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail3.json +1 -0
  138. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail4.json +1 -0
  139. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail5.json +1 -0
  140. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail6.json +1 -0
  141. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail7.json +1 -0
  142. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail8.json +1 -0
  143. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/fail9.json +1 -0
  144. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/pass1.json +56 -0
  145. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/pass15.json +1 -0
  146. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/pass16.json +1 -0
  147. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/pass17.json +1 -0
  148. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/pass2.json +1 -0
  149. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/pass26.json +1 -0
  150. data/vendor/bundle/gems/json-1.6.4/tests/fixtures/pass3.json +6 -0
  151. data/vendor/bundle/gems/json-1.6.4/tests/setup_variant.rb +11 -0
  152. data/vendor/bundle/gems/json-1.6.4/tests/test_json.rb +527 -0
  153. data/vendor/bundle/gems/json-1.6.4/tests/test_json_addition.rb +188 -0
  154. data/vendor/bundle/gems/json-1.6.4/tests/test_json_encoding.rb +65 -0
  155. data/vendor/bundle/gems/json-1.6.4/tests/test_json_fixtures.rb +35 -0
  156. data/vendor/bundle/gems/json-1.6.4/tests/test_json_generate.rb +249 -0
  157. data/vendor/bundle/gems/json-1.6.4/tests/test_json_string_matching.rb +40 -0
  158. data/vendor/bundle/gems/json-1.6.4/tests/test_json_unicode.rb +72 -0
  159. data/vendor/bundle/gems/json-1.6.4/tools/fuzz.rb +139 -0
  160. data/vendor/bundle/gems/json-1.6.4/tools/server.rb +62 -0
  161. data/vendor/bundle/gems/rake-0.9.2.2/.gemtest +0 -0
  162. data/vendor/bundle/gems/rake-0.9.2.2/CHANGES +522 -0
  163. data/vendor/bundle/gems/rake-0.9.2.2/MIT-LICENSE +21 -0
  164. data/vendor/bundle/gems/rake-0.9.2.2/README.rdoc +197 -0
  165. data/vendor/bundle/gems/rake-0.9.2.2/Rakefile +369 -0
  166. data/vendor/bundle/gems/rake-0.9.2.2/TODO +20 -0
  167. data/vendor/bundle/gems/rake-0.9.2.2/bin/rake +33 -0
  168. data/vendor/bundle/gems/rake-0.9.2.2/install.rb +90 -0
  169. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake.rb +69 -0
  170. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/alt_system.rb +109 -0
  171. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/application.rb +595 -0
  172. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/classic_namespace.rb +11 -0
  173. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/clean.rb +32 -0
  174. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/cloneable.rb +25 -0
  175. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/contrib/compositepublisher.rb +21 -0
  176. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/contrib/ftptools.rb +150 -0
  177. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/contrib/publisher.rb +73 -0
  178. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/contrib/rubyforgepublisher.rb +16 -0
  179. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/contrib/sshpublisher.rb +50 -0
  180. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/contrib/sys.rb +191 -0
  181. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/default_loader.rb +10 -0
  182. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/dsl_definition.rb +176 -0
  183. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/early_time.rb +18 -0
  184. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/ext/core.rb +27 -0
  185. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/ext/module.rb +39 -0
  186. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/ext/string.rb +167 -0
  187. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/ext/time.rb +14 -0
  188. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/file_creation_task.rb +24 -0
  189. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/file_list.rb +403 -0
  190. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/file_task.rb +47 -0
  191. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/file_utils.rb +114 -0
  192. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb +145 -0
  193. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/gempackagetask.rb +15 -0
  194. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/invocation_chain.rb +51 -0
  195. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/invocation_exception_mixin.rb +16 -0
  196. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/loaders/makefile.rb +40 -0
  197. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/multi_task.rb +16 -0
  198. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/name_space.rb +25 -0
  199. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/packagetask.rb +185 -0
  200. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/pathmap.rb +1 -0
  201. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/pseudo_status.rb +24 -0
  202. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/rake_module.rb +29 -0
  203. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb +22 -0
  204. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/rdoctask.rb +234 -0
  205. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/ruby182_test_unit_fix.rb +25 -0
  206. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/rule_recursion_overflow_error.rb +20 -0
  207. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/runtest.rb +21 -0
  208. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/task.rb +327 -0
  209. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/task_argument_error.rb +7 -0
  210. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/task_arguments.rb +78 -0
  211. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/task_manager.rb +307 -0
  212. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/tasklib.rb +22 -0
  213. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/testtask.rb +191 -0
  214. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/version.rb +8 -0
  215. data/vendor/bundle/gems/rake-0.9.2.2/lib/rake/win32.rb +55 -0
  216. data/vendor/bundle/gems/rake-0.9.2.2/test/file_creation.rb +34 -0
  217. data/vendor/bundle/gems/rake-0.9.2.2/test/helper.rb +492 -0
  218. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake.rb +40 -0
  219. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_application.rb +489 -0
  220. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_application_options.rb +335 -0
  221. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_clean.rb +14 -0
  222. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_definitions.rb +80 -0
  223. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_directory_task.rb +46 -0
  224. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_dsl.rb +77 -0
  225. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_early_time.rb +31 -0
  226. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_extension.rb +59 -0
  227. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_file_creation_task.rb +56 -0
  228. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_file_list.rb +628 -0
  229. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_file_list_path_map.rb +8 -0
  230. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_file_task.rb +102 -0
  231. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_file_utils.rb +305 -0
  232. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_ftp_file.rb +59 -0
  233. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_functional.rb +450 -0
  234. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_invocation_chain.rb +52 -0
  235. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_makefile_loader.rb +44 -0
  236. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_multi_task.rb +51 -0
  237. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_name_space.rb +43 -0
  238. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_package_task.rb +79 -0
  239. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_path_map.rb +157 -0
  240. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_path_map_explode.rb +34 -0
  241. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_path_map_partial.rb +18 -0
  242. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_pseudo_status.rb +21 -0
  243. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_rake_test_loader.rb +21 -0
  244. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_rdoc_task.rb +83 -0
  245. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_require.rb +40 -0
  246. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_rules.rb +327 -0
  247. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_task.rb +267 -0
  248. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_task_argument_parsing.rb +103 -0
  249. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_task_arguments.rb +88 -0
  250. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_task_lib.rb +9 -0
  251. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_task_manager.rb +157 -0
  252. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_task_manager_argument_resolution.rb +36 -0
  253. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_task_with_arguments.rb +173 -0
  254. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_test_task.rb +120 -0
  255. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_top_level_functions.rb +111 -0
  256. data/vendor/bundle/gems/rake-0.9.2.2/test/test_rake_win32.rb +72 -0
  257. data/vendor/bundle/gems/rake-0.9.2.2/test/test_sys.rb +20 -0
  258. data/vendor/bundle/specifications/json-1.6.4.gemspec +39 -0
  259. data/vendor/bundle/specifications/rake-0.9.2.2.gemspec +34 -0
  260. metadata +285 -18
@@ -0,0 +1,30 @@
1
+ unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
2
+ require 'json'
3
+ end
4
+
5
+ # Struct serialization/deserialization
6
+ class Struct
7
+
8
+ # Deserializes JSON string by constructing new Struct object with values
9
+ # <tt>v</tt> serialized by <tt>to_json</tt>.
10
+ def self.json_create(object)
11
+ new(*object['v'])
12
+ end
13
+
14
+ # Returns a hash, that will be turned into a JSON object and represent this
15
+ # object.
16
+ def as_json(*)
17
+ klass = self.class.name
18
+ klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
19
+ {
20
+ JSON.create_id => klass,
21
+ 'v' => values,
22
+ }
23
+ end
24
+
25
+ # Stores class name (Struct) with Struct values <tt>v</tt> as a JSON string.
26
+ # Only named structs are supported.
27
+ def to_json(*args)
28
+ as_json.to_json(*args)
29
+ end
30
+ end
@@ -0,0 +1,25 @@
1
+ unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
2
+ require 'json'
3
+ end
4
+
5
+ # Symbol serialization/deserialization
6
+ class Symbol
7
+ # Returns a hash, that will be turned into a JSON object and represent this
8
+ # object.
9
+ def as_json(*)
10
+ {
11
+ JSON.create_id => self.class.name,
12
+ 's' => to_s,
13
+ }
14
+ end
15
+
16
+ # Stores class name (Symbol) with String representation of Symbol as a JSON string.
17
+ def to_json(*a)
18
+ as_json.to_json(*a)
19
+ end
20
+
21
+ # Deserializes JSON string by converting the <tt>string</tt> value stored in the object to a Symbol
22
+ def self.json_create(o)
23
+ o['s'].to_sym
24
+ end
25
+ end
@@ -0,0 +1,35 @@
1
+ unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
2
+ require 'json'
3
+ end
4
+
5
+ # Time serialization/deserialization
6
+ class Time
7
+
8
+ # Deserializes JSON string by converting time since epoch to Time
9
+ def self.json_create(object)
10
+ if usec = object.delete('u') # used to be tv_usec -> tv_nsec
11
+ object['n'] = usec * 1000
12
+ end
13
+ if instance_methods.include?(:tv_nsec)
14
+ at(object['s'], Rational(object['n'], 1000))
15
+ else
16
+ at(object['s'], object['n'] / 1000)
17
+ end
18
+ end
19
+
20
+ # Returns a hash, that will be turned into a JSON object and represent this
21
+ # object.
22
+ def as_json(*)
23
+ {
24
+ JSON.create_id => self.class.name,
25
+ 's' => tv_sec,
26
+ 'n' => respond_to?(:tv_nsec) ? tv_nsec : tv_usec * 1000
27
+ }
28
+ end
29
+
30
+ # Stores class name (Time) with number of seconds since epoch and number of
31
+ # microseconds for Time as JSON string
32
+ def to_json(*args)
33
+ as_json.to_json(*args)
34
+ end
35
+ end
@@ -0,0 +1,470 @@
1
+ require 'json/version'
2
+
3
+ module JSON
4
+ class << self
5
+ # If _object_ is string-like, parse the string and return the parsed result
6
+ # as a Ruby data structure. Otherwise generate a JSON text from the Ruby
7
+ # data structure object and return it.
8
+ #
9
+ # The _opts_ argument is passed through to generate/parse respectively. See
10
+ # generate and parse for their documentation.
11
+ def [](object, opts = {})
12
+ if object.respond_to? :to_str
13
+ JSON.parse(object.to_str, opts)
14
+ else
15
+ JSON.generate(object, opts)
16
+ end
17
+ end
18
+
19
+ # Returns the JSON parser class that is used by JSON. This is either
20
+ # JSON::Ext::Parser or JSON::Pure::Parser.
21
+ attr_reader :parser
22
+
23
+ # Set the JSON parser class _parser_ to be used by JSON.
24
+ def parser=(parser) # :nodoc:
25
+ @parser = parser
26
+ remove_const :Parser if JSON.const_defined_in?(self, :Parser)
27
+ const_set :Parser, parser
28
+ end
29
+
30
+ # Return the constant located at _path_. The format of _path_ has to be
31
+ # either ::A::B::C or A::B::C. In any case, A has to be located at the top
32
+ # level (absolute namespace path?). If there doesn't exist a constant at
33
+ # the given path, an ArgumentError is raised.
34
+ def deep_const_get(path) # :nodoc:
35
+ path.to_s.split(/::/).inject(Object) do |p, c|
36
+ case
37
+ when c.empty? then p
38
+ when JSON.const_defined_in?(p, c) then p.const_get(c)
39
+ else
40
+ begin
41
+ p.const_missing(c)
42
+ rescue NameError => e
43
+ raise ArgumentError, "can't get const #{path}: #{e}"
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ # Set the module _generator_ to be used by JSON.
50
+ def generator=(generator) # :nodoc:
51
+ old, $VERBOSE = $VERBOSE, nil
52
+ @generator = generator
53
+ generator_methods = generator::GeneratorMethods
54
+ for const in generator_methods.constants
55
+ klass = deep_const_get(const)
56
+ modul = generator_methods.const_get(const)
57
+ klass.class_eval do
58
+ instance_methods(false).each do |m|
59
+ m.to_s == 'to_json' and remove_method m
60
+ end
61
+ include modul
62
+ end
63
+ end
64
+ self.state = generator::State
65
+ const_set :State, self.state
66
+ const_set :SAFE_STATE_PROTOTYPE, State.new
67
+ const_set :FAST_STATE_PROTOTYPE, State.new(
68
+ :indent => '',
69
+ :space => '',
70
+ :object_nl => "",
71
+ :array_nl => "",
72
+ :max_nesting => false
73
+ )
74
+ const_set :PRETTY_STATE_PROTOTYPE, State.new(
75
+ :indent => ' ',
76
+ :space => ' ',
77
+ :object_nl => "\n",
78
+ :array_nl => "\n"
79
+ )
80
+ ensure
81
+ $VERBOSE = old
82
+ end
83
+
84
+ # Returns the JSON generator module that is used by JSON. This is
85
+ # either JSON::Ext::Generator or JSON::Pure::Generator.
86
+ attr_reader :generator
87
+
88
+ # Returns the JSON generator state class that is used by JSON. This is
89
+ # either JSON::Ext::Generator::State or JSON::Pure::Generator::State.
90
+ attr_accessor :state
91
+
92
+ # This is create identifier, which is used to decide if the _json_create_
93
+ # hook of a class should be called. It defaults to 'json_class'.
94
+ attr_accessor :create_id
95
+ end
96
+ self.create_id = 'json_class'
97
+
98
+ NaN = 0.0/0
99
+
100
+ Infinity = 1.0/0
101
+
102
+ MinusInfinity = -Infinity
103
+
104
+ # The base exception for JSON errors.
105
+ class JSONError < StandardError; end
106
+
107
+ # This exception is raised if a parser error occurs.
108
+ class ParserError < JSONError; end
109
+
110
+ # This exception is raised if the nesting of parsed data structures is too
111
+ # deep.
112
+ class NestingError < ParserError; end
113
+
114
+ # :stopdoc:
115
+ class CircularDatastructure < NestingError; end
116
+ # :startdoc:
117
+
118
+ # This exception is raised if a generator or unparser error occurs.
119
+ class GeneratorError < JSONError; end
120
+ # For backwards compatibility
121
+ UnparserError = GeneratorError
122
+
123
+ # This exception is raised if the required unicode support is missing on the
124
+ # system. Usually this means that the iconv library is not installed.
125
+ class MissingUnicodeSupport < JSONError; end
126
+
127
+ module_function
128
+
129
+ # Parse the JSON document _source_ into a Ruby data structure and return it.
130
+ #
131
+ # _opts_ can have the following
132
+ # keys:
133
+ # * *max_nesting*: The maximum depth of nesting allowed in the parsed data
134
+ # structures. Disable depth checking with :max_nesting => false. It defaults
135
+ # to 19.
136
+ # * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
137
+ # defiance of RFC 4627 to be parsed by the Parser. This option defaults
138
+ # to false.
139
+ # * *symbolize_names*: If set to true, returns symbols for the names
140
+ # (keys) in a JSON object. Otherwise strings are returned. Strings are
141
+ # the default.
142
+ # * *create_additions*: If set to false, the Parser doesn't create
143
+ # additions even if a matching class and create_id was found. This option
144
+ # defaults to true.
145
+ # * *object_class*: Defaults to Hash
146
+ # * *array_class*: Defaults to Array
147
+ def parse(source, opts = {})
148
+ Parser.new(source, opts).parse
149
+ end
150
+
151
+ # Parse the JSON document _source_ into a Ruby data structure and return it.
152
+ # The bang version of the parse method defaults to the more dangerous values
153
+ # for the _opts_ hash, so be sure only to parse trusted _source_ documents.
154
+ #
155
+ # _opts_ can have the following keys:
156
+ # * *max_nesting*: The maximum depth of nesting allowed in the parsed data
157
+ # structures. Enable depth checking with :max_nesting => anInteger. The parse!
158
+ # methods defaults to not doing max depth checking: This can be dangerous
159
+ # if someone wants to fill up your stack.
160
+ # * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in
161
+ # defiance of RFC 4627 to be parsed by the Parser. This option defaults
162
+ # to true.
163
+ # * *create_additions*: If set to false, the Parser doesn't create
164
+ # additions even if a matching class and create_id was found. This option
165
+ # defaults to true.
166
+ def parse!(source, opts = {})
167
+ opts = {
168
+ :max_nesting => false,
169
+ :allow_nan => true
170
+ }.update(opts)
171
+ Parser.new(source, opts).parse
172
+ end
173
+
174
+ # Generate a JSON document from the Ruby data structure _obj_ and return
175
+ # it. _state_ is * a JSON::State object,
176
+ # * or a Hash like object (responding to to_hash),
177
+ # * an object convertible into a hash by a to_h method,
178
+ # that is used as or to configure a State object.
179
+ #
180
+ # It defaults to a state object, that creates the shortest possible JSON text
181
+ # in one line, checks for circular data structures and doesn't allow NaN,
182
+ # Infinity, and -Infinity.
183
+ #
184
+ # A _state_ hash can have the following keys:
185
+ # * *indent*: a string used to indent levels (default: ''),
186
+ # * *space*: a string that is put after, a : or , delimiter (default: ''),
187
+ # * *space_before*: a string that is put before a : pair delimiter (default: ''),
188
+ # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
189
+ # * *array_nl*: a string that is put at the end of a JSON array (default: ''),
190
+ # * *allow_nan*: true if NaN, Infinity, and -Infinity should be
191
+ # generated, otherwise an exception is thrown if these values are
192
+ # encountered. This options defaults to false.
193
+ # * *max_nesting*: The maximum depth of nesting allowed in the data
194
+ # structures from which JSON is to be generated. Disable depth checking
195
+ # with :max_nesting => false, it defaults to 19.
196
+ #
197
+ # See also the fast_generate for the fastest creation method with the least
198
+ # amount of sanity checks, and the pretty_generate method for some
199
+ # defaults for pretty output.
200
+ def generate(obj, opts = nil)
201
+ if State === opts
202
+ state, opts = opts, nil
203
+ else
204
+ state = SAFE_STATE_PROTOTYPE.dup
205
+ end
206
+ if opts
207
+ if opts.respond_to? :to_hash
208
+ opts = opts.to_hash
209
+ elsif opts.respond_to? :to_h
210
+ opts = opts.to_h
211
+ else
212
+ raise TypeError, "can't convert #{opts.class} into Hash"
213
+ end
214
+ state = state.configure(opts)
215
+ end
216
+ state.generate(obj)
217
+ end
218
+
219
+ # :stopdoc:
220
+ # I want to deprecate these later, so I'll first be silent about them, and
221
+ # later delete them.
222
+ alias unparse generate
223
+ module_function :unparse
224
+ # :startdoc:
225
+
226
+ # Generate a JSON document from the Ruby data structure _obj_ and return it.
227
+ # This method disables the checks for circles in Ruby objects.
228
+ #
229
+ # *WARNING*: Be careful not to pass any Ruby data structures with circles as
230
+ # _obj_ argument because this will cause JSON to go into an infinite loop.
231
+ def fast_generate(obj, opts = nil)
232
+ if State === opts
233
+ state, opts = opts, nil
234
+ else
235
+ state = FAST_STATE_PROTOTYPE.dup
236
+ end
237
+ if opts
238
+ if opts.respond_to? :to_hash
239
+ opts = opts.to_hash
240
+ elsif opts.respond_to? :to_h
241
+ opts = opts.to_h
242
+ else
243
+ raise TypeError, "can't convert #{opts.class} into Hash"
244
+ end
245
+ state.configure(opts)
246
+ end
247
+ state.generate(obj)
248
+ end
249
+
250
+ # :stopdoc:
251
+ # I want to deprecate these later, so I'll first be silent about them, and later delete them.
252
+ alias fast_unparse fast_generate
253
+ module_function :fast_unparse
254
+ # :startdoc:
255
+
256
+ # Generate a JSON document from the Ruby data structure _obj_ and return it.
257
+ # The returned document is a prettier form of the document returned by
258
+ # #unparse.
259
+ #
260
+ # The _opts_ argument can be used to configure the generator. See the
261
+ # generate method for a more detailed explanation.
262
+ def pretty_generate(obj, opts = nil)
263
+ if State === opts
264
+ state, opts = opts, nil
265
+ else
266
+ state = PRETTY_STATE_PROTOTYPE.dup
267
+ end
268
+ if opts
269
+ if opts.respond_to? :to_hash
270
+ opts = opts.to_hash
271
+ elsif opts.respond_to? :to_h
272
+ opts = opts.to_h
273
+ else
274
+ raise TypeError, "can't convert #{opts.class} into Hash"
275
+ end
276
+ state.configure(opts)
277
+ end
278
+ state.generate(obj)
279
+ end
280
+
281
+ # :stopdoc:
282
+ # I want to deprecate these later, so I'll first be silent about them, and later delete them.
283
+ alias pretty_unparse pretty_generate
284
+ module_function :pretty_unparse
285
+ # :startdoc:
286
+
287
+ class << self
288
+ # The global default options for the JSON.load method:
289
+ # :max_nesting: false
290
+ # :allow_nan: true
291
+ # :quirks_mode: true
292
+ attr_accessor :load_default_options
293
+ end
294
+ self.load_default_options = {
295
+ :max_nesting => false,
296
+ :allow_nan => true,
297
+ :quirks_mode => true,
298
+ }
299
+
300
+ # Load a ruby data structure from a JSON _source_ and return it. A source can
301
+ # either be a string-like object, an IO-like object, or an object responding
302
+ # to the read method. If _proc_ was given, it will be called with any nested
303
+ # Ruby object as an argument recursively in depth first order. The default
304
+ # options for the parser can be changed via the load_default_options method.
305
+ #
306
+ # This method is part of the implementation of the load/dump interface of
307
+ # Marshal and YAML.
308
+ def load(source, proc = nil)
309
+ opts = load_default_options
310
+ if source.respond_to? :to_str
311
+ source = source.to_str
312
+ elsif source.respond_to? :to_io
313
+ source = source.to_io.read
314
+ elsif source.respond_to?(:read)
315
+ source = source.read
316
+ end
317
+ if opts[:quirks_mode] && (source.nil? || source.empty?)
318
+ source = 'null'
319
+ end
320
+ result = parse(source, opts)
321
+ recurse_proc(result, &proc) if proc
322
+ result
323
+ end
324
+
325
+ # Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_
326
+ def recurse_proc(result, &proc)
327
+ case result
328
+ when Array
329
+ result.each { |x| recurse_proc x, &proc }
330
+ proc.call result
331
+ when Hash
332
+ result.each { |x, y| recurse_proc x, &proc; recurse_proc y, &proc }
333
+ proc.call result
334
+ else
335
+ proc.call result
336
+ end
337
+ end
338
+
339
+ alias restore load
340
+ module_function :restore
341
+
342
+ class << self
343
+ # The global default options for the JSON.dump method:
344
+ # :max_nesting: false
345
+ # :allow_nan: true
346
+ # :quirks_mode: true
347
+ attr_accessor :dump_default_options
348
+ end
349
+ self.dump_default_options = {
350
+ :max_nesting => false,
351
+ :allow_nan => true,
352
+ :quirks_mode => true,
353
+ }
354
+
355
+ # Dumps _obj_ as a JSON string, i.e. calls generate on the object and returns
356
+ # the result.
357
+ #
358
+ # If anIO (an IO-like object or an object that responds to the write method)
359
+ # was given, the resulting JSON is written to it.
360
+ #
361
+ # If the number of nested arrays or objects exceeds _limit_, an ArgumentError
362
+ # exception is raised. This argument is similar (but not exactly the
363
+ # same!) to the _limit_ argument in Marshal.dump.
364
+ #
365
+ # The default options for the generator can be changed via the
366
+ # dump_default_options method.
367
+ #
368
+ # This method is part of the implementation of the load/dump interface of
369
+ # Marshal and YAML.
370
+ def dump(obj, anIO = nil, limit = nil)
371
+ if anIO and limit.nil?
372
+ anIO = anIO.to_io if anIO.respond_to?(:to_io)
373
+ unless anIO.respond_to?(:write)
374
+ limit = anIO
375
+ anIO = nil
376
+ end
377
+ end
378
+ opts = JSON.dump_default_options
379
+ limit and opts.update(:max_nesting => limit)
380
+ result = generate(obj, opts)
381
+ if anIO
382
+ anIO.write result
383
+ anIO
384
+ else
385
+ result
386
+ end
387
+ rescue JSON::NestingError
388
+ raise ArgumentError, "exceed depth limit"
389
+ end
390
+
391
+ # Swap consecutive bytes of _string_ in place.
392
+ def self.swap!(string) # :nodoc:
393
+ 0.upto(string.size / 2) do |i|
394
+ break unless string[2 * i + 1]
395
+ string[2 * i], string[2 * i + 1] = string[2 * i + 1], string[2 * i]
396
+ end
397
+ string
398
+ end
399
+
400
+ # Shortuct for iconv.
401
+ if ::String.method_defined?(:encode)
402
+ # Encodes string using Ruby's _String.encode_
403
+ def self.iconv(to, from, string)
404
+ string.encode(to, from)
405
+ end
406
+ else
407
+ require 'iconv'
408
+ # Encodes string using _iconv_ library
409
+ def self.iconv(to, from, string)
410
+ Iconv.conv(to, from, string)
411
+ end
412
+ end
413
+
414
+ if ::Object.method(:const_defined?).arity == 1
415
+ def self.const_defined_in?(modul, constant)
416
+ modul.const_defined?(constant)
417
+ end
418
+ else
419
+ def self.const_defined_in?(modul, constant)
420
+ modul.const_defined?(constant, false)
421
+ end
422
+ end
423
+ end
424
+
425
+ module ::Kernel
426
+ private
427
+
428
+ # Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in
429
+ # one line.
430
+ def j(*objs)
431
+ objs.each do |obj|
432
+ puts JSON::generate(obj, :allow_nan => true, :max_nesting => false)
433
+ end
434
+ nil
435
+ end
436
+
437
+ # Ouputs _objs_ to STDOUT as JSON strings in a pretty format, with
438
+ # indentation and over many lines.
439
+ def jj(*objs)
440
+ objs.each do |obj|
441
+ puts JSON::pretty_generate(obj, :allow_nan => true, :max_nesting => false)
442
+ end
443
+ nil
444
+ end
445
+
446
+ # If _object_ is string-like, parse the string and return the parsed result as
447
+ # a Ruby data structure. Otherwise, generate a JSON text from the Ruby data
448
+ # structure object and return it.
449
+ #
450
+ # The _opts_ argument is passed through to generate/parse respectively. See
451
+ # generate and parse for their documentation.
452
+ def JSON(object, *args)
453
+ if object.respond_to? :to_str
454
+ JSON.parse(object.to_str, args.first)
455
+ else
456
+ JSON.generate(object, args.first)
457
+ end
458
+ end
459
+ end
460
+
461
+ # Extends any Class to include _json_creatable?_ method.
462
+ class ::Class
463
+ # Returns true if this class can be used to create an instance
464
+ # from a serialised JSON string. The class has to implement a class
465
+ # method _json_create_ that expects a hash as first parameter. The hash
466
+ # should include the required data.
467
+ def json_creatable?
468
+ respond_to?(:json_create)
469
+ end
470
+ end