nutshell-crm 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (692) hide show
  1. data/.gitignore +21 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +4 -0
  4. data/README +0 -0
  5. data/Rakefile +2 -0
  6. data/lib/nutshell-crm.rb +78 -0
  7. data/lib/nutshell-crm/version.rb +3 -0
  8. data/nutshell-crm.gemspec +28 -0
  9. data/spec/nutshell-crm_spec.rb +212 -0
  10. data/spec/spec_helper.rb +8 -0
  11. data/vendor/bundle/bin/autospec +19 -0
  12. data/vendor/bundle/bin/htmldiff +21 -0
  13. data/vendor/bundle/bin/httparty +19 -0
  14. data/vendor/bundle/bin/ldiff +21 -0
  15. data/vendor/bundle/bin/rspec +19 -0
  16. data/vendor/bundle/gems/diff-lcs-1.1.3/.gemtest +0 -0
  17. data/vendor/bundle/gems/diff-lcs-1.1.3/History.rdoc +54 -0
  18. data/vendor/bundle/gems/diff-lcs-1.1.3/License.rdoc +38 -0
  19. data/vendor/bundle/gems/diff-lcs-1.1.3/Manifest.txt +27 -0
  20. data/vendor/bundle/gems/diff-lcs-1.1.3/README.rdoc +72 -0
  21. data/vendor/bundle/gems/diff-lcs-1.1.3/Rakefile +26 -0
  22. data/vendor/bundle/gems/diff-lcs-1.1.3/bin/htmldiff +32 -0
  23. data/vendor/bundle/gems/diff-lcs-1.1.3/bin/ldiff +6 -0
  24. data/vendor/bundle/gems/diff-lcs-1.1.3/diff-lcs.gemspec +51 -0
  25. data/vendor/bundle/gems/diff-lcs-1.1.3/docs/COPYING.txt +340 -0
  26. data/vendor/bundle/gems/diff-lcs-1.1.3/docs/artistic.html +289 -0
  27. data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff-lcs.rb +5 -0
  28. data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs.rb +1105 -0
  29. data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/array.rb +21 -0
  30. data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/block.rb +51 -0
  31. data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/callbacks.rb +322 -0
  32. data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/change.rb +169 -0
  33. data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/htmldiff.rb +151 -0
  34. data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/hunk.rb +242 -0
  35. data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/ldiff.rb +210 -0
  36. data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/string.rb +19 -0
  37. data/vendor/bundle/gems/diff-lcs-1.1.3/spec/diff_spec.rb +35 -0
  38. data/vendor/bundle/gems/diff-lcs-1.1.3/spec/lcs_spec.rb +36 -0
  39. data/vendor/bundle/gems/diff-lcs-1.1.3/spec/patch_spec.rb +390 -0
  40. data/vendor/bundle/gems/diff-lcs-1.1.3/spec/sdiff_spec.rb +204 -0
  41. data/vendor/bundle/gems/diff-lcs-1.1.3/spec/spec_helper.rb +284 -0
  42. data/vendor/bundle/gems/diff-lcs-1.1.3/spec/traverse_balanced_spec.rb +286 -0
  43. data/vendor/bundle/gems/diff-lcs-1.1.3/spec/traverse_sequences_spec.rb +83 -0
  44. data/vendor/bundle/gems/httparty-0.8.1/.gitignore +9 -0
  45. data/vendor/bundle/gems/httparty-0.8.1/Gemfile +8 -0
  46. data/vendor/bundle/gems/httparty-0.8.1/History +259 -0
  47. data/vendor/bundle/gems/httparty-0.8.1/MIT-LICENSE +20 -0
  48. data/vendor/bundle/gems/httparty-0.8.1/README.rdoc +54 -0
  49. data/vendor/bundle/gems/httparty-0.8.1/Rakefile +15 -0
  50. data/vendor/bundle/gems/httparty-0.8.1/bin/httparty +108 -0
  51. data/vendor/bundle/gems/httparty-0.8.1/cucumber.yml +1 -0
  52. data/vendor/bundle/gems/httparty-0.8.1/examples/aaws.rb +32 -0
  53. data/vendor/bundle/gems/httparty-0.8.1/examples/basic.rb +32 -0
  54. data/vendor/bundle/gems/httparty-0.8.1/examples/crack.rb +19 -0
  55. data/vendor/bundle/gems/httparty-0.8.1/examples/custom_parsers.rb +67 -0
  56. data/vendor/bundle/gems/httparty-0.8.1/examples/delicious.rb +37 -0
  57. data/vendor/bundle/gems/httparty-0.8.1/examples/google.rb +16 -0
  58. data/vendor/bundle/gems/httparty-0.8.1/examples/rubyurl.rb +14 -0
  59. data/vendor/bundle/gems/httparty-0.8.1/examples/tripit_sign_in.rb +33 -0
  60. data/vendor/bundle/gems/httparty-0.8.1/examples/twitter.rb +31 -0
  61. data/vendor/bundle/gems/httparty-0.8.1/examples/whoismyrep.rb +10 -0
  62. data/vendor/bundle/gems/httparty-0.8.1/features/basic_authentication.feature +20 -0
  63. data/vendor/bundle/gems/httparty-0.8.1/features/command_line.feature +7 -0
  64. data/vendor/bundle/gems/httparty-0.8.1/features/deals_with_http_error_codes.feature +26 -0
  65. data/vendor/bundle/gems/httparty-0.8.1/features/digest_authentication.feature +20 -0
  66. data/vendor/bundle/gems/httparty-0.8.1/features/handles_compressed_responses.feature +19 -0
  67. data/vendor/bundle/gems/httparty-0.8.1/features/handles_multiple_formats.feature +34 -0
  68. data/vendor/bundle/gems/httparty-0.8.1/features/steps/env.rb +22 -0
  69. data/vendor/bundle/gems/httparty-0.8.1/features/steps/httparty_response_steps.rb +26 -0
  70. data/vendor/bundle/gems/httparty-0.8.1/features/steps/httparty_steps.rb +27 -0
  71. data/vendor/bundle/gems/httparty-0.8.1/features/steps/mongrel_helper.rb +94 -0
  72. data/vendor/bundle/gems/httparty-0.8.1/features/steps/remote_service_steps.rb +69 -0
  73. data/vendor/bundle/gems/httparty-0.8.1/features/supports_redirection.feature +22 -0
  74. data/vendor/bundle/gems/httparty-0.8.1/features/supports_timeout_option.feature +13 -0
  75. data/vendor/bundle/gems/httparty-0.8.1/httparty.gemspec +24 -0
  76. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty.rb +452 -0
  77. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/cookie_hash.rb +22 -0
  78. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/core_extensions.rb +9 -0
  79. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/exceptions.rb +26 -0
  80. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/hash_conversions.rb +51 -0
  81. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/module_inheritable_attributes.rb +34 -0
  82. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/net_digest_auth.rb +71 -0
  83. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/parser.rb +141 -0
  84. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/request.rb +257 -0
  85. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/response.rb +85 -0
  86. data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/version.rb +3 -0
  87. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/delicious.xml +23 -0
  88. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/empty.xml +0 -0
  89. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/google.html +3 -0
  90. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generate.sh +29 -0
  91. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/1fe462c2.0 +16 -0
  92. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/bogushost.crt +13 -0
  93. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/ca.crt +16 -0
  94. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/ca.key +15 -0
  95. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/selfsigned.crt +14 -0
  96. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/server.crt +13 -0
  97. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/server.key +15 -0
  98. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/openssl-exts.cnf +9 -0
  99. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/twitter.json +1 -0
  100. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/twitter.xml +403 -0
  101. data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/undefined_method_add_node_for_nil.xml +2 -0
  102. data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/cookie_hash_spec.rb +71 -0
  103. data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/net_digest_auth_spec.rb +93 -0
  104. data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/parser_spec.rb +155 -0
  105. data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/request_spec.rb +544 -0
  106. data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/response_spec.rb +193 -0
  107. data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/ssl_spec.rb +54 -0
  108. data/vendor/bundle/gems/httparty-0.8.1/spec/httparty_spec.rb +621 -0
  109. data/vendor/bundle/gems/httparty-0.8.1/spec/spec.opts +3 -0
  110. data/vendor/bundle/gems/httparty-0.8.1/spec/spec_helper.rb +22 -0
  111. data/vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_helper.rb +25 -0
  112. data/vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_server.rb +69 -0
  113. data/vendor/bundle/gems/httparty-0.8.1/spec/support/stub_response.rb +30 -0
  114. data/vendor/bundle/gems/httparty-0.8.1/website/css/common.css +47 -0
  115. data/vendor/bundle/gems/httparty-0.8.1/website/index.html +73 -0
  116. data/vendor/bundle/gems/json-1.6.3/.gitignore +8 -0
  117. data/vendor/bundle/gems/json-1.6.3/.travis.yml +15 -0
  118. data/vendor/bundle/gems/json-1.6.3/CHANGES +223 -0
  119. data/vendor/bundle/gems/json-1.6.3/COPYING +58 -0
  120. data/vendor/bundle/gems/json-1.6.3/COPYING-json-jruby +57 -0
  121. data/vendor/bundle/gems/json-1.6.3/GPL +340 -0
  122. data/vendor/bundle/gems/json-1.6.3/Gemfile +11 -0
  123. data/vendor/bundle/gems/json-1.6.3/README-json-jruby.markdown +33 -0
  124. data/vendor/bundle/gems/json-1.6.3/README.rdoc +358 -0
  125. data/vendor/bundle/gems/json-1.6.3/Rakefile +408 -0
  126. data/vendor/bundle/gems/json-1.6.3/TODO +1 -0
  127. data/vendor/bundle/gems/json-1.6.3/VERSION +1 -0
  128. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/.keep +0 -0
  129. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
  130. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
  131. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
  132. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
  133. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
  134. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
  135. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
  136. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
  137. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
  138. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
  139. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
  140. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
  141. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
  142. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
  143. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
  144. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
  145. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
  146. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
  147. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
  148. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
  149. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
  150. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
  151. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
  152. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
  153. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
  154. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
  155. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
  156. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
  157. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
  158. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
  159. data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
  160. data/vendor/bundle/gems/json-1.6.3/benchmarks/data/.keep +0 -0
  161. data/vendor/bundle/gems/json-1.6.3/benchmarks/generator2_benchmark.rb +222 -0
  162. data/vendor/bundle/gems/json-1.6.3/benchmarks/generator_benchmark.rb +224 -0
  163. data/vendor/bundle/gems/json-1.6.3/benchmarks/ohai.json +1216 -0
  164. data/vendor/bundle/gems/json-1.6.3/benchmarks/ohai.ruby +1 -0
  165. data/vendor/bundle/gems/json-1.6.3/benchmarks/parser2_benchmark.rb +251 -0
  166. data/vendor/bundle/gems/json-1.6.3/benchmarks/parser_benchmark.rb +259 -0
  167. data/vendor/bundle/gems/json-1.6.3/data/example.json +1 -0
  168. data/vendor/bundle/gems/json-1.6.3/data/index.html +38 -0
  169. data/vendor/bundle/gems/json-1.6.3/data/prototype.js +4184 -0
  170. data/vendor/bundle/gems/json-1.6.3/diagrams/.keep +0 -0
  171. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/fbuffer/fbuffer.h +156 -0
  172. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/Makefile +187 -0
  173. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/extconf.rb +13 -0
  174. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.bundle +0 -0
  175. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.c +1384 -0
  176. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.h +161 -0
  177. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.o +0 -0
  178. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/json/ext/generator.bundle +0 -0
  179. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/json/ext/parser.bundle +0 -0
  180. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/Makefile +187 -0
  181. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/extconf.rb +13 -0
  182. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.bundle +0 -0
  183. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.c +2197 -0
  184. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.h +77 -0
  185. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.o +0 -0
  186. data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.rl +920 -0
  187. data/vendor/bundle/gems/json-1.6.3/install.rb +19 -0
  188. data/vendor/bundle/gems/json-1.6.3/java/lib/bytelist-1.0.6.jar +0 -0
  189. data/vendor/bundle/gems/json-1.6.3/java/lib/jcodings.jar +0 -0
  190. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/ByteListTranscoder.java +167 -0
  191. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Generator.java +437 -0
  192. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/GeneratorMethods.java +232 -0
  193. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/GeneratorService.java +43 -0
  194. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/GeneratorState.java +522 -0
  195. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/OptionsReader.java +119 -0
  196. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Parser.java +2589 -0
  197. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Parser.rl +913 -0
  198. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/ParserService.java +35 -0
  199. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/RuntimeInfo.java +121 -0
  200. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/StringDecoder.java +166 -0
  201. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/StringEncoder.java +106 -0
  202. data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Utils.java +89 -0
  203. data/vendor/bundle/gems/json-1.6.3/json-java.gemspec +22 -0
  204. data/vendor/bundle/gems/json-1.6.3/json.gemspec +40 -0
  205. data/vendor/bundle/gems/json-1.6.3/json_pure.gemspec +42 -0
  206. data/vendor/bundle/gems/json-1.6.3/lib/json.rb +62 -0
  207. data/vendor/bundle/gems/json-1.6.3/lib/json/add/bigdecimal.rb +21 -0
  208. data/vendor/bundle/gems/json-1.6.3/lib/json/add/complex.rb +22 -0
  209. data/vendor/bundle/gems/json-1.6.3/lib/json/add/core.rb +11 -0
  210. data/vendor/bundle/gems/json-1.6.3/lib/json/add/date.rb +34 -0
  211. data/vendor/bundle/gems/json-1.6.3/lib/json/add/date_time.rb +50 -0
  212. data/vendor/bundle/gems/json-1.6.3/lib/json/add/exception.rb +31 -0
  213. data/vendor/bundle/gems/json-1.6.3/lib/json/add/ostruct.rb +31 -0
  214. data/vendor/bundle/gems/json-1.6.3/lib/json/add/range.rb +29 -0
  215. data/vendor/bundle/gems/json-1.6.3/lib/json/add/rational.rb +22 -0
  216. data/vendor/bundle/gems/json-1.6.3/lib/json/add/regexp.rb +30 -0
  217. data/vendor/bundle/gems/json-1.6.3/lib/json/add/struct.rb +30 -0
  218. data/vendor/bundle/gems/json-1.6.3/lib/json/add/symbol.rb +25 -0
  219. data/vendor/bundle/gems/json-1.6.3/lib/json/add/time.rb +35 -0
  220. data/vendor/bundle/gems/json-1.6.3/lib/json/common.rb +470 -0
  221. data/vendor/bundle/gems/json-1.6.3/lib/json/ext.rb +21 -0
  222. data/vendor/bundle/gems/json-1.6.3/lib/json/ext/.keep +0 -0
  223. data/vendor/bundle/gems/json-1.6.3/lib/json/pure.rb +21 -0
  224. data/vendor/bundle/gems/json-1.6.3/lib/json/pure/generator.rb +468 -0
  225. data/vendor/bundle/gems/json-1.6.3/lib/json/pure/parser.rb +359 -0
  226. data/vendor/bundle/gems/json-1.6.3/lib/json/version.rb +8 -0
  227. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail1.json +1 -0
  228. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail10.json +1 -0
  229. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail11.json +1 -0
  230. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail12.json +1 -0
  231. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail13.json +1 -0
  232. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail14.json +1 -0
  233. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail18.json +1 -0
  234. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail19.json +1 -0
  235. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail2.json +1 -0
  236. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail20.json +1 -0
  237. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail21.json +1 -0
  238. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail22.json +1 -0
  239. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail23.json +1 -0
  240. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail24.json +1 -0
  241. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail25.json +1 -0
  242. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail27.json +2 -0
  243. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail28.json +2 -0
  244. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail3.json +1 -0
  245. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail4.json +1 -0
  246. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail5.json +1 -0
  247. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail6.json +1 -0
  248. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail7.json +1 -0
  249. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail8.json +1 -0
  250. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail9.json +1 -0
  251. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass1.json +56 -0
  252. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass15.json +1 -0
  253. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass16.json +1 -0
  254. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass17.json +1 -0
  255. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass2.json +1 -0
  256. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass26.json +1 -0
  257. data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass3.json +6 -0
  258. data/vendor/bundle/gems/json-1.6.3/tests/setup_variant.rb +11 -0
  259. data/vendor/bundle/gems/json-1.6.3/tests/test_json.rb +476 -0
  260. data/vendor/bundle/gems/json-1.6.3/tests/test_json_addition.rb +188 -0
  261. data/vendor/bundle/gems/json-1.6.3/tests/test_json_encoding.rb +65 -0
  262. data/vendor/bundle/gems/json-1.6.3/tests/test_json_fixtures.rb +35 -0
  263. data/vendor/bundle/gems/json-1.6.3/tests/test_json_generate.rb +249 -0
  264. data/vendor/bundle/gems/json-1.6.3/tests/test_json_string_matching.rb +40 -0
  265. data/vendor/bundle/gems/json-1.6.3/tests/test_json_unicode.rb +72 -0
  266. data/vendor/bundle/gems/json-1.6.3/tools/fuzz.rb +139 -0
  267. data/vendor/bundle/gems/json-1.6.3/tools/server.rb +62 -0
  268. data/vendor/bundle/gems/multi_json-1.0.4/.document +5 -0
  269. data/vendor/bundle/gems/multi_json-1.0.4/.rspec +3 -0
  270. data/vendor/bundle/gems/multi_json-1.0.4/.travis.yml +7 -0
  271. data/vendor/bundle/gems/multi_json-1.0.4/Gemfile +6 -0
  272. data/vendor/bundle/gems/multi_json-1.0.4/LICENSE.md +20 -0
  273. data/vendor/bundle/gems/multi_json-1.0.4/README.md +94 -0
  274. data/vendor/bundle/gems/multi_json-1.0.4/Rakefile +25 -0
  275. data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json.rb +85 -0
  276. data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/json_common.rb +27 -0
  277. data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/json_gem.rb +12 -0
  278. data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/json_pure.rb +12 -0
  279. data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/ok_json.rb +48 -0
  280. data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/yajl.rb +18 -0
  281. data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/vendor/ok_json.rb +587 -0
  282. data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/version.rb +3 -0
  283. data/vendor/bundle/gems/multi_json-1.0.4/multi_json.gemspec +22 -0
  284. data/vendor/bundle/gems/multi_json-1.0.4/spec/helper.rb +35 -0
  285. data/vendor/bundle/gems/multi_json-1.0.4/spec/multi_json_spec.rb +178 -0
  286. data/vendor/bundle/gems/multi_xml-0.4.1/.gemtest +0 -0
  287. data/vendor/bundle/gems/multi_xml-0.4.1/.gitignore +10 -0
  288. data/vendor/bundle/gems/multi_xml-0.4.1/.rspec +3 -0
  289. data/vendor/bundle/gems/multi_xml-0.4.1/.travis.yml +7 -0
  290. data/vendor/bundle/gems/multi_xml-0.4.1/.yardopts +5 -0
  291. data/vendor/bundle/gems/multi_xml-0.4.1/Gemfile +9 -0
  292. data/vendor/bundle/gems/multi_xml-0.4.1/LICENSE.md +20 -0
  293. data/vendor/bundle/gems/multi_xml-0.4.1/README.md +113 -0
  294. data/vendor/bundle/gems/multi_xml-0.4.1/Rakefile +23 -0
  295. data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml.rb +237 -0
  296. data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/libxml.rb +30 -0
  297. data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/libxml2_parser.rb +66 -0
  298. data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/nokogiri.rb +32 -0
  299. data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/ox.rb +97 -0
  300. data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/rexml.rb +113 -0
  301. data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/version.rb +3 -0
  302. data/vendor/bundle/gems/multi_xml-0.4.1/multi_xml.gemspec +24 -0
  303. data/vendor/bundle/gems/multi_xml-0.4.1/spec/helper.rb +3 -0
  304. data/vendor/bundle/gems/multi_xml-0.4.1/spec/multi_xml_spec.rb +41 -0
  305. data/vendor/bundle/gems/multi_xml-0.4.1/spec/parser_shared_example.rb +552 -0
  306. data/vendor/bundle/gems/multi_xml-0.4.1/spec/speed.rb +63 -0
  307. data/vendor/bundle/gems/rspec-2.7.0/.document +2 -0
  308. data/vendor/bundle/gems/rspec-2.7.0/.gitignore +8 -0
  309. data/vendor/bundle/gems/rspec-2.7.0/Gemfile +7 -0
  310. data/vendor/bundle/gems/rspec-2.7.0/License.txt +22 -0
  311. data/vendor/bundle/gems/rspec-2.7.0/README.markdown +47 -0
  312. data/vendor/bundle/gems/rspec-2.7.0/Rakefile +30 -0
  313. data/vendor/bundle/gems/rspec-2.7.0/lib/rspec.rb +4 -0
  314. data/vendor/bundle/gems/rspec-2.7.0/lib/rspec/version.rb +5 -0
  315. data/vendor/bundle/gems/rspec-2.7.0/rspec.gemspec +33 -0
  316. data/vendor/bundle/gems/rspec-core-2.7.1/README.md +68 -0
  317. data/vendor/bundle/gems/rspec-core-2.7.1/exe/autospec +13 -0
  318. data/vendor/bundle/gems/rspec-core-2.7.1/exe/rspec +25 -0
  319. data/vendor/bundle/gems/rspec-core-2.7.1/features/Autotest.md +38 -0
  320. data/vendor/bundle/gems/rspec-core-2.7.1/features/README.md +17 -0
  321. data/vendor/bundle/gems/rspec-core-2.7.1/features/Upgrade.md +364 -0
  322. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/README.md +28 -0
  323. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/configure.feature +22 -0
  324. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/example_name_option.feature +86 -0
  325. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/exit_status.feature +83 -0
  326. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/format_option.feature +81 -0
  327. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/line_number_appended_to_path.feature +140 -0
  328. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/line_number_option.feature +58 -0
  329. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/pattern_option.feature +31 -0
  330. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/rake_task.feature +68 -0
  331. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/ruby.feature +22 -0
  332. data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/tag.feature +90 -0
  333. data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/alias_example_to.feature +48 -0
  334. data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/custom_settings.feature +84 -0
  335. data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/default_path.feature +38 -0
  336. data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/fail_fast.feature +77 -0
  337. data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/read_options_from_file.feature +87 -0
  338. data/vendor/bundle/gems/rspec-core-2.7.1/features/example_groups/basic_structure.feature +55 -0
  339. data/vendor/bundle/gems/rspec-core-2.7.1/features/example_groups/shared_context.feature +74 -0
  340. data/vendor/bundle/gems/rspec-core-2.7.1/features/example_groups/shared_examples.feature +204 -0
  341. data/vendor/bundle/gems/rspec-core-2.7.1/features/expectation_framework_integration/configure_expectation_framework.feature +73 -0
  342. data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/exclusion_filters.feature +139 -0
  343. data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/if_and_unless.feature +168 -0
  344. data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/inclusion_filters.feature +105 -0
  345. data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/run_all_when_everything_filtered.feature +46 -0
  346. data/vendor/bundle/gems/rspec-core-2.7.1/features/formatters/custom_formatter.feature +36 -0
  347. data/vendor/bundle/gems/rspec-core-2.7.1/features/formatters/text_formatter.feature +46 -0
  348. data/vendor/bundle/gems/rspec-core-2.7.1/features/helper_methods/arbitrary_methods.feature +40 -0
  349. data/vendor/bundle/gems/rspec-core-2.7.1/features/helper_methods/let.feature +50 -0
  350. data/vendor/bundle/gems/rspec-core-2.7.1/features/helper_methods/modules.feature +149 -0
  351. data/vendor/bundle/gems/rspec-core-2.7.1/features/hooks/around_hooks.feature +343 -0
  352. data/vendor/bundle/gems/rspec-core-2.7.1/features/hooks/before_and_after_hooks.feature +423 -0
  353. data/vendor/bundle/gems/rspec-core-2.7.1/features/hooks/filtering.feature +234 -0
  354. data/vendor/bundle/gems/rspec-core-2.7.1/features/metadata/current_example.feature +17 -0
  355. data/vendor/bundle/gems/rspec-core-2.7.1/features/metadata/described_class.feature +17 -0
  356. data/vendor/bundle/gems/rspec-core-2.7.1/features/metadata/user_defined.feature +113 -0
  357. data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_any_framework.feature +106 -0
  358. data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_flexmock.feature +96 -0
  359. data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_mocha.feature +97 -0
  360. data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_rr.feature +98 -0
  361. data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_rspec.feature +97 -0
  362. data/vendor/bundle/gems/rspec-core-2.7.1/features/pending/pending_examples.feature +229 -0
  363. data/vendor/bundle/gems/rspec-core-2.7.1/features/spec_files/arbitrary_file_suffix.feature +13 -0
  364. data/vendor/bundle/gems/rspec-core-2.7.1/features/step_definitions/additional_cli_steps.rb +30 -0
  365. data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/attribute_of_subject.feature +122 -0
  366. data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/explicit_subject.feature +78 -0
  367. data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_receiver.feature +29 -0
  368. data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature +30 -0
  369. data/vendor/bundle/gems/rspec-core-2.7.1/features/support/env.rb +5 -0
  370. data/vendor/bundle/gems/rspec-core-2.7.1/lib/autotest/discover.rb +1 -0
  371. data/vendor/bundle/gems/rspec-core-2.7.1/lib/autotest/rspec2.rb +73 -0
  372. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/autorun.rb +2 -0
  373. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core.rb +81 -0
  374. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb +63 -0
  375. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb +32 -0
  376. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/command_line_configuration.rb +62 -0
  377. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb +558 -0
  378. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/configuration_options.rb +139 -0
  379. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/deprecation.rb +48 -0
  380. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/drb_command_line.rb +23 -0
  381. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/dsl.rb +11 -0
  382. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/errors.rb +13 -0
  383. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/example.rb +178 -0
  384. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/example_group.rb +348 -0
  385. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/expecting/with_rspec.rb +9 -0
  386. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/expecting/with_stdlib.rb +9 -0
  387. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions.rb +3 -0
  388. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions/instance_eval_with_args.rb +39 -0
  389. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions/kernel.rb +9 -0
  390. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions/module_eval_with_args.rb +34 -0
  391. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/base_formatter.rb +172 -0
  392. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/base_text_formatter.rb +185 -0
  393. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/documentation_formatter.rb +71 -0
  394. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/helpers.rb +24 -0
  395. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/html_formatter.rb +458 -0
  396. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/progress_formatter.rb +32 -0
  397. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/snippet_extractor.rb +58 -0
  398. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/text_mate_formatter.rb +34 -0
  399. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/hooks.rb +160 -0
  400. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/let.rb +101 -0
  401. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/load_path.rb +3 -0
  402. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/metadata.rb +229 -0
  403. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/metadata_hash_builder.rb +93 -0
  404. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_absolutely_nothing.rb +11 -0
  405. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_flexmock.rb +27 -0
  406. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_mocha.rb +23 -0
  407. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_rr.rb +27 -0
  408. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_rspec.rb +23 -0
  409. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/option_parser.rb +147 -0
  410. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/pending.rb +38 -0
  411. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/rake_task.rb +201 -0
  412. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/reporter.rb +78 -0
  413. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/ruby_project.rb +44 -0
  414. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb +86 -0
  415. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/shared_context.rb +16 -0
  416. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/shared_example_group.rb +67 -0
  417. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/subject.rb +175 -0
  418. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/version.rb +7 -0
  419. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/world.rb +150 -0
  420. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/monkey.rb +1 -0
  421. data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/monkey/spork/test_framework/rspec.rb +8 -0
  422. data/vendor/bundle/gems/rspec-core-2.7.1/spec/autotest/discover_spec.rb +19 -0
  423. data/vendor/bundle/gems/rspec-core-2.7.1/spec/autotest/failed_results_re_spec.rb +45 -0
  424. data/vendor/bundle/gems/rspec-core-2.7.1/spec/autotest/rspec_spec.rb +123 -0
  425. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/command_line_configuration_spec.rb +26 -0
  426. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/command_line_spec.rb +169 -0
  427. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/command_line_spec_output.txt +0 -0
  428. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/configuration_options_spec.rb +437 -0
  429. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/configuration_spec.rb +920 -0
  430. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/deprecations_spec.rb +66 -0
  431. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/drb_command_line_spec.rb +124 -0
  432. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/example_group_spec.rb +1046 -0
  433. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/example_spec.rb +289 -0
  434. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/base_formatter_spec.rb +80 -0
  435. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/base_text_formatter_spec.rb +344 -0
  436. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/documentation_formatter_spec.rb +66 -0
  437. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/helpers_spec.rb +46 -0
  438. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +462 -0
  439. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.8.7.html +399 -0
  440. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.9.2.html +406 -0
  441. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.9.3.html +406 -0
  442. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatter_spec.rb +81 -0
  443. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/progress_formatter_spec.rb +30 -0
  444. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/snippet_extractor_spec.rb +18 -0
  445. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +462 -0
  446. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +399 -0
  447. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +406 -0
  448. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.9.3.html +406 -0
  449. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatter_spec.rb +84 -0
  450. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/hooks_filtering_spec.rb +227 -0
  451. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/hooks_spec.rb +143 -0
  452. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/kernel_extensions_spec.rb +9 -0
  453. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/let_spec.rb +55 -0
  454. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/metadata_spec.rb +383 -0
  455. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/option_parser_spec.rb +86 -0
  456. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/pending_example_spec.rb +187 -0
  457. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/rake_task_spec.rb +138 -0
  458. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/reporter_spec.rb +86 -0
  459. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/a_bar.rb +0 -0
  460. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/a_foo.rb +0 -0
  461. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/a_spec.rb +1 -0
  462. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/custom_example_group_runner.rb +14 -0
  463. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/formatter_specs.rb +60 -0
  464. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/utf8_encoded.rb +8 -0
  465. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/rspec_matchers_spec.rb +45 -0
  466. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/ruby_project_spec.rb +24 -0
  467. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/runner_spec.rb +82 -0
  468. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/shared_context_spec.rb +30 -0
  469. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/shared_example_group_spec.rb +84 -0
  470. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/subject_spec.rb +199 -0
  471. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/world_spec.rb +315 -0
  472. data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core_spec.rb +31 -0
  473. data/vendor/bundle/gems/rspec-core-2.7.1/spec/spec_helper.rb +92 -0
  474. data/vendor/bundle/gems/rspec-core-2.7.1/spec/support/matchers.rb +75 -0
  475. data/vendor/bundle/gems/rspec-core-2.7.1/spec/support/shared_example_groups.rb +41 -0
  476. data/vendor/bundle/gems/rspec-core-2.7.1/spec/support/spec_files.rb +44 -0
  477. data/vendor/bundle/gems/rspec-expectations-2.7.0/README.md +24 -0
  478. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/README.markdown +49 -0
  479. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/Upgrade.md +53 -0
  480. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/README.md +73 -0
  481. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/be.feature +135 -0
  482. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/be_within.feature +43 -0
  483. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/cover.feature +45 -0
  484. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/equality.feature +145 -0
  485. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/exist.feature +43 -0
  486. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/expect_change.feature +59 -0
  487. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/expect_error.feature +138 -0
  488. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/have.feature +103 -0
  489. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/include.feature +121 -0
  490. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/match.feature +50 -0
  491. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/operators.feature +221 -0
  492. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/predicates.feature +128 -0
  493. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/respond_to.feature +78 -0
  494. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/satisfy.feature +31 -0
  495. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/throw_symbol.feature +85 -0
  496. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/types.feature +114 -0
  497. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/access_running_example.feature +53 -0
  498. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_diffable_matcher.feature +27 -0
  499. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_matcher.feature +340 -0
  500. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_matcher_outside_rspec.feature +38 -0
  501. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_matcher_with_fluent_interface.feature +24 -0
  502. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/customized_message.feature +22 -0
  503. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/diffing.feature +85 -0
  504. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/implicit_docstrings.feature +52 -0
  505. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/step_definitions/additional_cli_steps.rb +22 -0
  506. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/support/env.rb +5 -0
  507. data/vendor/bundle/gems/rspec-expectations-2.7.0/features/test_frameworks/test_unit.feature +46 -0
  508. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec-expectations.rb +1 -0
  509. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations.rb +37 -0
  510. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/deprecation.rb +38 -0
  511. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/differ.rb +62 -0
  512. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/errors.rb +9 -0
  513. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions.rb +3 -0
  514. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions/array.rb +9 -0
  515. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions/kernel.rb +26 -0
  516. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions/object.rb +39 -0
  517. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/fail_with.rb +54 -0
  518. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/handler.rb +50 -0
  519. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/version.rb +8 -0
  520. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers.rb +206 -0
  521. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be.rb +213 -0
  522. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_close.rb +9 -0
  523. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb +26 -0
  524. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_kind_of.rb +26 -0
  525. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_within.rb +37 -0
  526. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/block_aliases.rb +19 -0
  527. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/change.rb +197 -0
  528. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/compatibility.rb +14 -0
  529. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/cover.rb +35 -0
  530. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb +22 -0
  531. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eq.rb +46 -0
  532. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb +41 -0
  533. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/equal.rb +48 -0
  534. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/errors.rb +5 -0
  535. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/exist.rb +26 -0
  536. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/extensions/instance_eval_with_args.rb +39 -0
  537. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/generated_descriptions.rb +36 -0
  538. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/has.rb +44 -0
  539. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/have.rb +168 -0
  540. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/include.rb +54 -0
  541. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/match.rb +21 -0
  542. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/match_array.rb +71 -0
  543. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/matcher.rb +165 -0
  544. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/method_missing.rb +12 -0
  545. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/operator_matcher.rb +87 -0
  546. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/pretty.rb +37 -0
  547. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/raise_error.rb +130 -0
  548. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/respond_to.rb +85 -0
  549. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/satisfy.rb +51 -0
  550. data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/throw_symbol.rb +121 -0
  551. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/differ_spec.rb +96 -0
  552. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/extensions/kernel_spec.rb +45 -0
  553. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/fail_with_spec.rb +70 -0
  554. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/handler_spec.rb +206 -0
  555. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_close_spec.rb +22 -0
  556. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_instance_of_spec.rb +36 -0
  557. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_kind_of_spec.rb +33 -0
  558. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_spec.rb +452 -0
  559. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_within_spec.rb +64 -0
  560. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/change_spec.rb +522 -0
  561. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/compatibility_spec.rb +28 -0
  562. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/cover_spec.rb +65 -0
  563. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/description_generation_spec.rb +176 -0
  564. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb +25 -0
  565. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb +38 -0
  566. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eql_spec.rb +37 -0
  567. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/equal_spec.rb +57 -0
  568. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/exist_spec.rb +104 -0
  569. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/has_spec.rb +113 -0
  570. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/have_spec.rb +458 -0
  571. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/include_spec.rb +341 -0
  572. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/match_array_spec.rb +108 -0
  573. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/match_spec.rb +57 -0
  574. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/matcher_spec.rb +420 -0
  575. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/matchers_spec.rb +31 -0
  576. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb +23 -0
  577. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/operator_matcher_spec.rb +221 -0
  578. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/raise_error_spec.rb +339 -0
  579. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/respond_to_spec.rb +292 -0
  580. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/satisfy_spec.rb +40 -0
  581. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/throw_symbol_spec.rb +113 -0
  582. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/spec_helper.rb +26 -0
  583. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/support/classes.rb +56 -0
  584. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/support/matchers.rb +22 -0
  585. data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/support/ruby_version.rb +10 -0
  586. data/vendor/bundle/gems/rspec-mocks-2.7.0/README.md +40 -0
  587. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/README.markdown +67 -0
  588. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/Scope.md +17 -0
  589. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/Upgrade.md +22 -0
  590. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/README.md +27 -0
  591. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/explicit.feature +60 -0
  592. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/general_matchers.feature +85 -0
  593. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/type_matchers.feature +25 -0
  594. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/README.md +58 -0
  595. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/any_instance.feature +21 -0
  596. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/block_local_expectations.feature.pending +55 -0
  597. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/expect_message.feature +94 -0
  598. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/receive_counts.feature +209 -0
  599. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/warn_when_expectation_is_set_on_nil.feature +50 -0
  600. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/README.md +43 -0
  601. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/any_instance.feature +133 -0
  602. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/as_null_object.feature +36 -0
  603. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/simple_return_value.feature +64 -0
  604. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/stub_chain.feature +51 -0
  605. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/stub_implementation.feature +26 -0
  606. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/to_ary.feature +47 -0
  607. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/outside_rspec/configuration.feature +82 -0
  608. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/outside_rspec/standalone.feature +32 -0
  609. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/step_definitions/additional_cli_steps.rb +4 -0
  610. data/vendor/bundle/gems/rspec-mocks-2.7.0/features/support/env.rb +6 -0
  611. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks.rb +196 -0
  612. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance.rb +29 -0
  613. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/chain.rb +49 -0
  614. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/expectation_chain.rb +33 -0
  615. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/message_chains.rb +48 -0
  616. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/recorder.rb +168 -0
  617. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/stub_chain.rb +35 -0
  618. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/stub_chain_chain.rb +34 -0
  619. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/argument_expectation.rb +54 -0
  620. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/argument_matchers.rb +227 -0
  621. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/error_generator.rb +97 -0
  622. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/errors.rb +10 -0
  623. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/instance_exec.rb +31 -0
  624. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/marshal.rb +23 -0
  625. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb +23 -0
  626. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/framework.rb +18 -0
  627. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/message_expectation.rb +357 -0
  628. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/method_double.rb +165 -0
  629. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/methods.rb +98 -0
  630. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/mock.rb +79 -0
  631. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/order_group.rb +29 -0
  632. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/proxy.rb +158 -0
  633. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/serialization.rb +28 -0
  634. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/space.rb +28 -0
  635. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/spec_methods.rb +53 -0
  636. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/standalone.rb +3 -0
  637. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/version.rb +7 -0
  638. data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/spec/mocks.rb +2 -0
  639. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/and_yield_spec.rb +114 -0
  640. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/any_instance/message_chains_spec.rb +40 -0
  641. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/any_instance_spec.rb +785 -0
  642. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/any_number_of_times_spec.rb +30 -0
  643. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/argument_expectation_spec.rb +37 -0
  644. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/at_least_spec.rb +103 -0
  645. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/at_most_spec.rb +99 -0
  646. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/block_return_value_spec.rb +45 -0
  647. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_10260_spec.rb +8 -0
  648. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_10263_spec.rb +25 -0
  649. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_11545_spec.rb +32 -0
  650. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_496_spec.rb +17 -0
  651. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_600_spec.rb +22 -0
  652. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_7611_spec.rb +16 -0
  653. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_8165_spec.rb +31 -0
  654. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_830_spec.rb +21 -0
  655. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_957_spec.rb +22 -0
  656. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/double_spec.rb +12 -0
  657. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/failing_argument_matchers_spec.rb +95 -0
  658. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/hash_including_matcher_spec.rb +90 -0
  659. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/hash_not_including_matcher_spec.rb +67 -0
  660. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/mock_ordering_spec.rb +94 -0
  661. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/mock_space_spec.rb +54 -0
  662. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/mock_spec.rb +702 -0
  663. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/multiple_return_value_spec.rb +191 -0
  664. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/nil_expectation_warning_spec.rb +62 -0
  665. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/null_object_mock_spec.rb +78 -0
  666. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/once_counts_spec.rb +53 -0
  667. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/options_hash_spec.rb +35 -0
  668. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/partial_mock_spec.rb +156 -0
  669. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb +95 -0
  670. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/passing_argument_matchers_spec.rb +142 -0
  671. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/precise_counts_spec.rb +58 -0
  672. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/record_messages_spec.rb +26 -0
  673. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/serialization_spec.rb +111 -0
  674. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stash_spec.rb +27 -0
  675. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stub_chain_spec.rb +149 -0
  676. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stub_implementation_spec.rb +68 -0
  677. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stub_spec.rb +235 -0
  678. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb +26 -0
  679. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/to_ary_spec.rb +40 -0
  680. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/twice_counts_spec.rb +67 -0
  681. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks_spec.rb +51 -0
  682. data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/spec_helper.rb +52 -0
  683. data/vendor/bundle/specifications/diff-lcs-1.1.3.gemspec +35 -0
  684. data/vendor/bundle/specifications/httparty-0.8.1.gemspec +34 -0
  685. data/vendor/bundle/specifications/json-1.6.3.gemspec +39 -0
  686. data/vendor/bundle/specifications/multi_json-1.0.4.gemspec +40 -0
  687. data/vendor/bundle/specifications/multi_xml-0.4.1.gemspec +49 -0
  688. data/vendor/bundle/specifications/rspec-2.7.0.gemspec +38 -0
  689. data/vendor/bundle/specifications/rspec-core-2.7.1.gemspec +31 -0
  690. data/vendor/bundle/specifications/rspec-expectations-2.7.0.gemspec +32 -0
  691. data/vendor/bundle/specifications/rspec-mocks-2.7.0.gemspec +29 -0
  692. metadata +771 -0
@@ -0,0 +1,161 @@
1
+ #ifndef _GENERATOR_H_
2
+ #define _GENERATOR_H_
3
+
4
+ #include <string.h>
5
+ #include <assert.h>
6
+ #include <math.h>
7
+
8
+ #include "ruby.h"
9
+
10
+ #ifdef HAVE_RUBY_RE_H
11
+ #include "ruby/re.h"
12
+ #else
13
+ #include "re.h"
14
+ #endif
15
+
16
+ #define option_given_p(opts, key) RTEST(rb_funcall(opts, i_key_p, 1, key))
17
+
18
+ #ifndef RHASH_SIZE
19
+ #define RHASH_SIZE(hsh) (RHASH(hsh)->tbl->num_entries)
20
+ #endif
21
+
22
+ #ifndef RFLOAT_VALUE
23
+ #define RFLOAT_VALUE(val) (RFLOAT(val)->value)
24
+ #endif
25
+
26
+ #ifndef RARRAY_PTR
27
+ #define RARRAY_PTR(ARRAY) RARRAY(ARRAY)->ptr
28
+ #endif
29
+ #ifndef RARRAY_LEN
30
+ #define RARRAY_LEN(ARRAY) RARRAY(ARRAY)->len
31
+ #endif
32
+ #ifndef RSTRING_PTR
33
+ #define RSTRING_PTR(string) RSTRING(string)->ptr
34
+ #endif
35
+ #ifndef RSTRING_LEN
36
+ #define RSTRING_LEN(string) RSTRING(string)->len
37
+ #endif
38
+
39
+ /* unicode defintions */
40
+
41
+ #define UNI_STRICT_CONVERSION 1
42
+
43
+ typedef unsigned long UTF32; /* at least 32 bits */
44
+ typedef unsigned short UTF16; /* at least 16 bits */
45
+ typedef unsigned char UTF8; /* typically 8 bits */
46
+
47
+ #define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
48
+ #define UNI_MAX_BMP (UTF32)0x0000FFFF
49
+ #define UNI_MAX_UTF16 (UTF32)0x0010FFFF
50
+ #define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
51
+ #define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
52
+
53
+ #define UNI_SUR_HIGH_START (UTF32)0xD800
54
+ #define UNI_SUR_HIGH_END (UTF32)0xDBFF
55
+ #define UNI_SUR_LOW_START (UTF32)0xDC00
56
+ #define UNI_SUR_LOW_END (UTF32)0xDFFF
57
+
58
+ static const int halfShift = 10; /* used for shifting by 10 bits */
59
+
60
+ static const UTF32 halfBase = 0x0010000UL;
61
+ static const UTF32 halfMask = 0x3FFUL;
62
+
63
+ static unsigned char isLegalUTF8(const UTF8 *source, unsigned long length);
64
+ static void unicode_escape(char *buf, UTF16 character);
65
+ static void unicode_escape_to_buffer(FBuffer *buffer, char buf[6], UTF16 character);
66
+ static void convert_UTF8_to_JSON_ASCII(FBuffer *buffer, VALUE string);
67
+ static void convert_UTF8_to_JSON(FBuffer *buffer, VALUE string);
68
+ static char *fstrndup(const char *ptr, unsigned long len);
69
+
70
+ /* ruby api and some helpers */
71
+
72
+ typedef struct JSON_Generator_StateStruct {
73
+ char *indent;
74
+ long indent_len;
75
+ char *space;
76
+ long space_len;
77
+ char *space_before;
78
+ long space_before_len;
79
+ char *object_nl;
80
+ long object_nl_len;
81
+ char *array_nl;
82
+ long array_nl_len;
83
+ FBuffer *array_delim;
84
+ FBuffer *object_delim;
85
+ FBuffer *object_delim2;
86
+ long max_nesting;
87
+ char allow_nan;
88
+ char ascii_only;
89
+ char quirks_mode;
90
+ long depth;
91
+ long buffer_initial_length;
92
+ } JSON_Generator_State;
93
+
94
+ #define GET_STATE(self) \
95
+ JSON_Generator_State *state; \
96
+ Data_Get_Struct(self, JSON_Generator_State, state)
97
+
98
+ #define GENERATE_JSON(type) \
99
+ FBuffer *buffer; \
100
+ VALUE Vstate; \
101
+ JSON_Generator_State *state; \
102
+ \
103
+ rb_scan_args(argc, argv, "01", &Vstate); \
104
+ Vstate = cState_from_state_s(cState, Vstate); \
105
+ Data_Get_Struct(Vstate, JSON_Generator_State, state); \
106
+ buffer = cState_prepare_buffer(Vstate); \
107
+ generate_json_##type(buffer, Vstate, state, self); \
108
+ return fbuffer_to_s(buffer)
109
+
110
+ static VALUE mHash_to_json(int argc, VALUE *argv, VALUE self);
111
+ static VALUE mArray_to_json(int argc, VALUE *argv, VALUE self);
112
+ static VALUE mFixnum_to_json(int argc, VALUE *argv, VALUE self);
113
+ static VALUE mBignum_to_json(int argc, VALUE *argv, VALUE self);
114
+ static VALUE mFloat_to_json(int argc, VALUE *argv, VALUE self);
115
+ static VALUE mString_included_s(VALUE self, VALUE modul);
116
+ static VALUE mString_to_json(int argc, VALUE *argv, VALUE self);
117
+ static VALUE mString_to_json_raw_object(VALUE self);
118
+ static VALUE mString_to_json_raw(int argc, VALUE *argv, VALUE self);
119
+ static VALUE mString_Extend_json_create(VALUE self, VALUE o);
120
+ static VALUE mTrueClass_to_json(int argc, VALUE *argv, VALUE self);
121
+ static VALUE mFalseClass_to_json(int argc, VALUE *argv, VALUE self);
122
+ static VALUE mNilClass_to_json(int argc, VALUE *argv, VALUE self);
123
+ static VALUE mObject_to_json(int argc, VALUE *argv, VALUE self);
124
+ static void State_free(JSON_Generator_State *state);
125
+ static JSON_Generator_State *State_allocate();
126
+ static VALUE cState_s_allocate(VALUE klass);
127
+ static VALUE cState_configure(VALUE self, VALUE opts);
128
+ static VALUE cState_to_h(VALUE self);
129
+ static void generate_json(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
130
+ static void generate_json_object(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
131
+ static void generate_json_array(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
132
+ static void generate_json_string(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
133
+ static void generate_json_null(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
134
+ static void generate_json_false(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
135
+ static void generate_json_true(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
136
+ static void generate_json_fixnum(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
137
+ static void generate_json_bignum(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
138
+ static void generate_json_float(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
139
+ static VALUE cState_partial_generate(VALUE self, VALUE obj);
140
+ static VALUE cState_generate(VALUE self, VALUE obj);
141
+ static VALUE cState_initialize(int argc, VALUE *argv, VALUE self);
142
+ static VALUE cState_from_state_s(VALUE self, VALUE opts);
143
+ static VALUE cState_indent(VALUE self);
144
+ static VALUE cState_indent_set(VALUE self, VALUE indent);
145
+ static VALUE cState_space(VALUE self);
146
+ static VALUE cState_space_set(VALUE self, VALUE space);
147
+ static VALUE cState_space_before(VALUE self);
148
+ static VALUE cState_space_before_set(VALUE self, VALUE space_before);
149
+ static VALUE cState_object_nl(VALUE self);
150
+ static VALUE cState_object_nl_set(VALUE self, VALUE object_nl);
151
+ static VALUE cState_array_nl(VALUE self);
152
+ static VALUE cState_array_nl_set(VALUE self, VALUE array_nl);
153
+ static VALUE cState_max_nesting(VALUE self);
154
+ static VALUE cState_max_nesting_set(VALUE self, VALUE depth);
155
+ static VALUE cState_allow_nan_p(VALUE self);
156
+ static VALUE cState_ascii_only_p(VALUE self);
157
+ static VALUE cState_depth(VALUE self);
158
+ static VALUE cState_depth_set(VALUE self, VALUE depth);
159
+ static FBuffer *cState_prepare_buffer(VALUE self);
160
+
161
+ #endif
@@ -0,0 +1,187 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ #### Start of system configuration section. ####
5
+
6
+ srcdir = .
7
+ topdir = /Users/mshafrir/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1
8
+ hdrdir = /Users/mshafrir/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1
9
+ arch_hdrdir = /Users/mshafrir/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1/$(arch)
10
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
11
+ prefix = $(DESTDIR)/Users/mshafrir/.rbenv/versions/1.9.2-p290
12
+ rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
13
+ exec_prefix = $(prefix)
14
+ vendorhdrdir = $(rubyhdrdir)/vendor_ruby
15
+ sitehdrdir = $(rubyhdrdir)/site_ruby
16
+ rubyhdrdir = $(includedir)/$(RUBY_BASE_NAME)-$(ruby_version)
17
+ vendordir = $(rubylibprefix)/vendor_ruby
18
+ sitedir = $(rubylibprefix)/site_ruby
19
+ ridir = $(datarootdir)/$(RI_BASE_NAME)
20
+ mandir = $(datarootdir)/man
21
+ localedir = $(datarootdir)/locale
22
+ libdir = $(exec_prefix)/lib
23
+ psdir = $(docdir)
24
+ pdfdir = $(docdir)
25
+ dvidir = $(docdir)
26
+ htmldir = $(docdir)
27
+ infodir = $(datarootdir)/info
28
+ docdir = $(datarootdir)/doc/$(PACKAGE)
29
+ oldincludedir = $(DESTDIR)/usr/include
30
+ includedir = $(prefix)/include
31
+ localstatedir = $(prefix)/var
32
+ sharedstatedir = $(prefix)/com
33
+ sysconfdir = $(prefix)/etc
34
+ datadir = $(datarootdir)
35
+ datarootdir = $(prefix)/share
36
+ libexecdir = $(exec_prefix)/libexec
37
+ sbindir = $(exec_prefix)/sbin
38
+ bindir = $(exec_prefix)/bin
39
+ rubylibdir = $(rubylibprefix)/$(ruby_version)
40
+ archdir = $(rubylibdir)/$(arch)
41
+ sitelibdir = $(sitedir)/$(ruby_version)
42
+ sitearchdir = $(sitelibdir)/$(sitearch)
43
+ vendorlibdir = $(vendordir)/$(ruby_version)
44
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
45
+
46
+ CC = gcc
47
+ CXX = g++
48
+ LIBRUBY = $(LIBRUBY_A)
49
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
50
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
51
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
52
+ OUTFLAG = -o
53
+ COUTFLAG = -o
54
+
55
+ RUBY_EXTCONF_H =
56
+ cflags = $(optflags) $(debugflags) $(warnflags)
57
+ optflags = -O3
58
+ debugflags = -ggdb
59
+ warnflags = -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long
60
+ CFLAGS = -fno-common $(cflags) -pipe -O3 -Wall
61
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
62
+ DEFS =
63
+ CPPFLAGS = -I'/Users/mshafrir/.rbenv/versions/1.9.2-p290/include' -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE $(DEFS) $(cppflags)
64
+ CXXFLAGS = $(CFLAGS) $(cxxflags)
65
+ ldflags = -L. -L'/Users/mshafrir/.rbenv/versions/1.9.2-p290/lib' -L/usr/local/lib
66
+ dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace
67
+ ARCH_FLAG =
68
+ DLDFLAGS = $(ldflags) $(dldflags)
69
+ LDSHARED = $(CC) -dynamic -bundle
70
+ LDSHAREDXX = $(CXX) -dynamic -bundle
71
+ AR = ar
72
+ EXEEXT =
73
+
74
+ RUBY_BASE_NAME = ruby
75
+ RUBY_INSTALL_NAME = ruby
76
+ RUBY_SO_NAME = ruby
77
+ arch = x86_64-darwin11.1.0
78
+ sitearch = $(arch)
79
+ ruby_version = 1.9.1
80
+ ruby = /Users/mshafrir/.rbenv/versions/1.9.2-p290/bin/ruby
81
+ RUBY = $(ruby)
82
+ RM = rm -f
83
+ RM_RF = $(RUBY) -run -e rm -- -rf
84
+ RMDIRS = $(RUBY) -run -e rmdir -- -p
85
+ MAKEDIRS = mkdir -p
86
+ INSTALL = /usr/bin/install -c
87
+ INSTALL_PROG = $(INSTALL) -m 0755
88
+ INSTALL_DATA = $(INSTALL) -m 644
89
+ COPY = cp
90
+
91
+ #### End of system configuration section. ####
92
+
93
+ preload =
94
+
95
+ libpath = . $(libdir)
96
+ LIBPATH = -L. -L$(libdir)
97
+ DEFFILE =
98
+
99
+ CLEANFILES = mkmf.log
100
+ DISTCLEANFILES =
101
+ DISTCLEANDIRS =
102
+
103
+ extout =
104
+ extout_prefix =
105
+ target_prefix = /json/ext
106
+ LOCAL_LIBS =
107
+ LIBS = -lpthread -ldl -lobjc
108
+ SRCS = parser.c
109
+ OBJS = parser.o
110
+ TARGET = parser
111
+ DLLIB = $(TARGET).bundle
112
+ EXTSTATIC =
113
+ STATIC_LIB =
114
+
115
+ BINDIR = $(bindir)
116
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
117
+ RUBYLIBDIR = /Users/mshafrir/Dev/nutshell-crm/vendor/bundle/gems/json-1.6.3/ext/json/ext$(target_prefix)
118
+ RUBYARCHDIR = /Users/mshafrir/Dev/nutshell-crm/vendor/bundle/gems/json-1.6.3/ext/json/ext$(target_prefix)
119
+ HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
120
+ ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
121
+
122
+ TARGET_SO = $(DLLIB)
123
+ CLEANLIBS = $(TARGET).bundle
124
+ CLEANOBJS = *.o *.bak
125
+
126
+ all: $(DLLIB)
127
+ static: $(STATIC_LIB)
128
+ .PHONY: all install static install-so install-rb
129
+ .PHONY: clean clean-so clean-rb
130
+
131
+ clean-rb-default::
132
+ clean-rb::
133
+ clean-so::
134
+ clean: clean-so clean-rb-default clean-rb
135
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
136
+
137
+ distclean-rb-default::
138
+ distclean-rb::
139
+ distclean-so::
140
+ distclean: clean distclean-so distclean-rb-default distclean-rb
141
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
142
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
143
+ @-$(RMDIRS) $(DISTCLEANDIRS)
144
+
145
+ realclean: distclean
146
+ install: install-so install-rb
147
+
148
+ install-so: $(RUBYARCHDIR)
149
+ install-so: $(RUBYARCHDIR)/$(DLLIB)
150
+ $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
151
+ @-$(MAKEDIRS) $(@D)
152
+ $(INSTALL_PROG) $(DLLIB) $(@D)
153
+ install-rb: pre-install-rb install-rb-default
154
+ install-rb-default: pre-install-rb-default
155
+ pre-install-rb: Makefile
156
+ pre-install-rb-default: Makefile
157
+ $(RUBYARCHDIR):
158
+ $(MAKEDIRS) $@
159
+
160
+ site-install: site-install-so site-install-rb
161
+ site-install-so: install-so
162
+ site-install-rb: install-rb
163
+
164
+ .SUFFIXES: .c .m .cc .cxx .cpp .C .o
165
+
166
+ .cc.o:
167
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
168
+
169
+ .cxx.o:
170
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
171
+
172
+ .cpp.o:
173
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
174
+
175
+ .C.o:
176
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
177
+
178
+ .c.o:
179
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
180
+
181
+ $(DLLIB): $(OBJS) Makefile
182
+ @-$(RM) $(@)
183
+ $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
184
+
185
+
186
+
187
+ $(OBJS): $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h
@@ -0,0 +1,13 @@
1
+ require 'mkmf'
2
+
3
+ unless $CFLAGS.gsub!(/ -O[\dsz]?/, ' -O3')
4
+ $CFLAGS << ' -O3'
5
+ end
6
+ if CONFIG['CC'] =~ /gcc/
7
+ $CFLAGS << ' -Wall'
8
+ #unless $CFLAGS.gsub!(/ -O[\dsz]?/, ' -O0 -ggdb')
9
+ # $CFLAGS << ' -O0 -ggdb'
10
+ #end
11
+ end
12
+
13
+ create_makefile 'json/ext/parser'
@@ -0,0 +1,2197 @@
1
+
2
+ #line 1 "parser.rl"
3
+ #include "../fbuffer/fbuffer.h"
4
+ #include "parser.h"
5
+
6
+ /* unicode */
7
+
8
+ static const char digit_values[256] = {
9
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
10
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
11
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1,
12
+ -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1,
13
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
14
+ 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
15
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
16
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
17
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
18
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
19
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
20
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
21
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
22
+ -1, -1, -1, -1, -1, -1, -1
23
+ };
24
+
25
+ static UTF32 unescape_unicode(const unsigned char *p)
26
+ {
27
+ char b;
28
+ UTF32 result = 0;
29
+ b = digit_values[p[0]];
30
+ if (b < 0) return UNI_REPLACEMENT_CHAR;
31
+ result = (result << 4) | b;
32
+ b = digit_values[p[1]];
33
+ result = (result << 4) | b;
34
+ if (b < 0) return UNI_REPLACEMENT_CHAR;
35
+ b = digit_values[p[2]];
36
+ result = (result << 4) | b;
37
+ if (b < 0) return UNI_REPLACEMENT_CHAR;
38
+ b = digit_values[p[3]];
39
+ result = (result << 4) | b;
40
+ if (b < 0) return UNI_REPLACEMENT_CHAR;
41
+ return result;
42
+ }
43
+
44
+ static int convert_UTF32_to_UTF8(char *buf, UTF32 ch)
45
+ {
46
+ int len = 1;
47
+ if (ch <= 0x7F) {
48
+ buf[0] = (char) ch;
49
+ } else if (ch <= 0x07FF) {
50
+ buf[0] = (char) ((ch >> 6) | 0xC0);
51
+ buf[1] = (char) ((ch & 0x3F) | 0x80);
52
+ len++;
53
+ } else if (ch <= 0xFFFF) {
54
+ buf[0] = (char) ((ch >> 12) | 0xE0);
55
+ buf[1] = (char) (((ch >> 6) & 0x3F) | 0x80);
56
+ buf[2] = (char) ((ch & 0x3F) | 0x80);
57
+ len += 2;
58
+ } else if (ch <= 0x1fffff) {
59
+ buf[0] =(char) ((ch >> 18) | 0xF0);
60
+ buf[1] =(char) (((ch >> 12) & 0x3F) | 0x80);
61
+ buf[2] =(char) (((ch >> 6) & 0x3F) | 0x80);
62
+ buf[3] =(char) ((ch & 0x3F) | 0x80);
63
+ len += 3;
64
+ } else {
65
+ buf[0] = '?';
66
+ }
67
+ return len;
68
+ }
69
+
70
+ #ifdef HAVE_RUBY_ENCODING_H
71
+ static VALUE CEncoding_ASCII_8BIT, CEncoding_UTF_8, CEncoding_UTF_16BE,
72
+ CEncoding_UTF_16LE, CEncoding_UTF_32BE, CEncoding_UTF_32LE;
73
+ static ID i_encoding, i_encode;
74
+ #else
75
+ static ID i_iconv;
76
+ #endif
77
+
78
+ static VALUE mJSON, mExt, cParser, eParserError, eNestingError;
79
+ static VALUE CNaN, CInfinity, CMinusInfinity;
80
+
81
+ static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
82
+ i_chr, i_max_nesting, i_allow_nan, i_symbolize_names, i_quirks_mode,
83
+ i_object_class, i_array_class, i_key_p, i_deep_const_get, i_match,
84
+ i_match_string, i_aset, i_leftshift;
85
+
86
+
87
+ #line 110 "parser.rl"
88
+
89
+
90
+
91
+ #line 92 "parser.c"
92
+ static const int JSON_object_start = 1;
93
+ static const int JSON_object_first_final = 27;
94
+ static const int JSON_object_error = 0;
95
+
96
+ static const int JSON_object_en_main = 1;
97
+
98
+
99
+ #line 151 "parser.rl"
100
+
101
+
102
+ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result)
103
+ {
104
+ int cs = EVIL;
105
+ VALUE last_name = Qnil;
106
+ VALUE object_class = json->object_class;
107
+
108
+ if (json->max_nesting && json->current_nesting > json->max_nesting) {
109
+ rb_raise(eNestingError, "nesting of %d is too deep", json->current_nesting);
110
+ }
111
+
112
+ *result = NIL_P(object_class) ? rb_hash_new() : rb_class_new_instance(0, 0, object_class);
113
+
114
+
115
+ #line 116 "parser.c"
116
+ {
117
+ cs = JSON_object_start;
118
+ }
119
+
120
+ #line 166 "parser.rl"
121
+
122
+ #line 123 "parser.c"
123
+ {
124
+ if ( p == pe )
125
+ goto _test_eof;
126
+ switch ( cs )
127
+ {
128
+ case 1:
129
+ if ( (*p) == 123 )
130
+ goto st2;
131
+ goto st0;
132
+ st0:
133
+ cs = 0;
134
+ goto _out;
135
+ st2:
136
+ if ( ++p == pe )
137
+ goto _test_eof2;
138
+ case 2:
139
+ switch( (*p) ) {
140
+ case 13: goto st2;
141
+ case 32: goto st2;
142
+ case 34: goto tr2;
143
+ case 47: goto st23;
144
+ case 125: goto tr4;
145
+ }
146
+ if ( 9 <= (*p) && (*p) <= 10 )
147
+ goto st2;
148
+ goto st0;
149
+ tr2:
150
+ #line 133 "parser.rl"
151
+ {
152
+ char *np;
153
+ json->parsing_name = 1;
154
+ np = JSON_parse_string(json, p, pe, &last_name);
155
+ json->parsing_name = 0;
156
+ if (np == NULL) { p--; {p++; cs = 3; goto _out;} } else {p = (( np))-1;}
157
+ }
158
+ goto st3;
159
+ st3:
160
+ if ( ++p == pe )
161
+ goto _test_eof3;
162
+ case 3:
163
+ #line 164 "parser.c"
164
+ switch( (*p) ) {
165
+ case 13: goto st3;
166
+ case 32: goto st3;
167
+ case 47: goto st4;
168
+ case 58: goto st8;
169
+ }
170
+ if ( 9 <= (*p) && (*p) <= 10 )
171
+ goto st3;
172
+ goto st0;
173
+ st4:
174
+ if ( ++p == pe )
175
+ goto _test_eof4;
176
+ case 4:
177
+ switch( (*p) ) {
178
+ case 42: goto st5;
179
+ case 47: goto st7;
180
+ }
181
+ goto st0;
182
+ st5:
183
+ if ( ++p == pe )
184
+ goto _test_eof5;
185
+ case 5:
186
+ if ( (*p) == 42 )
187
+ goto st6;
188
+ goto st5;
189
+ st6:
190
+ if ( ++p == pe )
191
+ goto _test_eof6;
192
+ case 6:
193
+ switch( (*p) ) {
194
+ case 42: goto st6;
195
+ case 47: goto st3;
196
+ }
197
+ goto st5;
198
+ st7:
199
+ if ( ++p == pe )
200
+ goto _test_eof7;
201
+ case 7:
202
+ if ( (*p) == 10 )
203
+ goto st3;
204
+ goto st7;
205
+ st8:
206
+ if ( ++p == pe )
207
+ goto _test_eof8;
208
+ case 8:
209
+ switch( (*p) ) {
210
+ case 13: goto st8;
211
+ case 32: goto st8;
212
+ case 34: goto tr11;
213
+ case 45: goto tr11;
214
+ case 47: goto st19;
215
+ case 73: goto tr11;
216
+ case 78: goto tr11;
217
+ case 91: goto tr11;
218
+ case 102: goto tr11;
219
+ case 110: goto tr11;
220
+ case 116: goto tr11;
221
+ case 123: goto tr11;
222
+ }
223
+ if ( (*p) > 10 ) {
224
+ if ( 48 <= (*p) && (*p) <= 57 )
225
+ goto tr11;
226
+ } else if ( (*p) >= 9 )
227
+ goto st8;
228
+ goto st0;
229
+ tr11:
230
+ #line 118 "parser.rl"
231
+ {
232
+ VALUE v = Qnil;
233
+ char *np = JSON_parse_value(json, p, pe, &v);
234
+ if (np == NULL) {
235
+ p--; {p++; cs = 9; goto _out;}
236
+ } else {
237
+ if (NIL_P(json->object_class)) {
238
+ rb_hash_aset(*result, last_name, v);
239
+ } else {
240
+ rb_funcall(*result, i_aset, 2, last_name, v);
241
+ }
242
+ {p = (( np))-1;}
243
+ }
244
+ }
245
+ goto st9;
246
+ st9:
247
+ if ( ++p == pe )
248
+ goto _test_eof9;
249
+ case 9:
250
+ #line 251 "parser.c"
251
+ switch( (*p) ) {
252
+ case 13: goto st9;
253
+ case 32: goto st9;
254
+ case 44: goto st10;
255
+ case 47: goto st15;
256
+ case 125: goto tr4;
257
+ }
258
+ if ( 9 <= (*p) && (*p) <= 10 )
259
+ goto st9;
260
+ goto st0;
261
+ st10:
262
+ if ( ++p == pe )
263
+ goto _test_eof10;
264
+ case 10:
265
+ switch( (*p) ) {
266
+ case 13: goto st10;
267
+ case 32: goto st10;
268
+ case 34: goto tr2;
269
+ case 47: goto st11;
270
+ }
271
+ if ( 9 <= (*p) && (*p) <= 10 )
272
+ goto st10;
273
+ goto st0;
274
+ st11:
275
+ if ( ++p == pe )
276
+ goto _test_eof11;
277
+ case 11:
278
+ switch( (*p) ) {
279
+ case 42: goto st12;
280
+ case 47: goto st14;
281
+ }
282
+ goto st0;
283
+ st12:
284
+ if ( ++p == pe )
285
+ goto _test_eof12;
286
+ case 12:
287
+ if ( (*p) == 42 )
288
+ goto st13;
289
+ goto st12;
290
+ st13:
291
+ if ( ++p == pe )
292
+ goto _test_eof13;
293
+ case 13:
294
+ switch( (*p) ) {
295
+ case 42: goto st13;
296
+ case 47: goto st10;
297
+ }
298
+ goto st12;
299
+ st14:
300
+ if ( ++p == pe )
301
+ goto _test_eof14;
302
+ case 14:
303
+ if ( (*p) == 10 )
304
+ goto st10;
305
+ goto st14;
306
+ st15:
307
+ if ( ++p == pe )
308
+ goto _test_eof15;
309
+ case 15:
310
+ switch( (*p) ) {
311
+ case 42: goto st16;
312
+ case 47: goto st18;
313
+ }
314
+ goto st0;
315
+ st16:
316
+ if ( ++p == pe )
317
+ goto _test_eof16;
318
+ case 16:
319
+ if ( (*p) == 42 )
320
+ goto st17;
321
+ goto st16;
322
+ st17:
323
+ if ( ++p == pe )
324
+ goto _test_eof17;
325
+ case 17:
326
+ switch( (*p) ) {
327
+ case 42: goto st17;
328
+ case 47: goto st9;
329
+ }
330
+ goto st16;
331
+ st18:
332
+ if ( ++p == pe )
333
+ goto _test_eof18;
334
+ case 18:
335
+ if ( (*p) == 10 )
336
+ goto st9;
337
+ goto st18;
338
+ tr4:
339
+ #line 141 "parser.rl"
340
+ { p--; {p++; cs = 27; goto _out;} }
341
+ goto st27;
342
+ st27:
343
+ if ( ++p == pe )
344
+ goto _test_eof27;
345
+ case 27:
346
+ #line 347 "parser.c"
347
+ goto st0;
348
+ st19:
349
+ if ( ++p == pe )
350
+ goto _test_eof19;
351
+ case 19:
352
+ switch( (*p) ) {
353
+ case 42: goto st20;
354
+ case 47: goto st22;
355
+ }
356
+ goto st0;
357
+ st20:
358
+ if ( ++p == pe )
359
+ goto _test_eof20;
360
+ case 20:
361
+ if ( (*p) == 42 )
362
+ goto st21;
363
+ goto st20;
364
+ st21:
365
+ if ( ++p == pe )
366
+ goto _test_eof21;
367
+ case 21:
368
+ switch( (*p) ) {
369
+ case 42: goto st21;
370
+ case 47: goto st8;
371
+ }
372
+ goto st20;
373
+ st22:
374
+ if ( ++p == pe )
375
+ goto _test_eof22;
376
+ case 22:
377
+ if ( (*p) == 10 )
378
+ goto st8;
379
+ goto st22;
380
+ st23:
381
+ if ( ++p == pe )
382
+ goto _test_eof23;
383
+ case 23:
384
+ switch( (*p) ) {
385
+ case 42: goto st24;
386
+ case 47: goto st26;
387
+ }
388
+ goto st0;
389
+ st24:
390
+ if ( ++p == pe )
391
+ goto _test_eof24;
392
+ case 24:
393
+ if ( (*p) == 42 )
394
+ goto st25;
395
+ goto st24;
396
+ st25:
397
+ if ( ++p == pe )
398
+ goto _test_eof25;
399
+ case 25:
400
+ switch( (*p) ) {
401
+ case 42: goto st25;
402
+ case 47: goto st2;
403
+ }
404
+ goto st24;
405
+ st26:
406
+ if ( ++p == pe )
407
+ goto _test_eof26;
408
+ case 26:
409
+ if ( (*p) == 10 )
410
+ goto st2;
411
+ goto st26;
412
+ }
413
+ _test_eof2: cs = 2; goto _test_eof;
414
+ _test_eof3: cs = 3; goto _test_eof;
415
+ _test_eof4: cs = 4; goto _test_eof;
416
+ _test_eof5: cs = 5; goto _test_eof;
417
+ _test_eof6: cs = 6; goto _test_eof;
418
+ _test_eof7: cs = 7; goto _test_eof;
419
+ _test_eof8: cs = 8; goto _test_eof;
420
+ _test_eof9: cs = 9; goto _test_eof;
421
+ _test_eof10: cs = 10; goto _test_eof;
422
+ _test_eof11: cs = 11; goto _test_eof;
423
+ _test_eof12: cs = 12; goto _test_eof;
424
+ _test_eof13: cs = 13; goto _test_eof;
425
+ _test_eof14: cs = 14; goto _test_eof;
426
+ _test_eof15: cs = 15; goto _test_eof;
427
+ _test_eof16: cs = 16; goto _test_eof;
428
+ _test_eof17: cs = 17; goto _test_eof;
429
+ _test_eof18: cs = 18; goto _test_eof;
430
+ _test_eof27: cs = 27; goto _test_eof;
431
+ _test_eof19: cs = 19; goto _test_eof;
432
+ _test_eof20: cs = 20; goto _test_eof;
433
+ _test_eof21: cs = 21; goto _test_eof;
434
+ _test_eof22: cs = 22; goto _test_eof;
435
+ _test_eof23: cs = 23; goto _test_eof;
436
+ _test_eof24: cs = 24; goto _test_eof;
437
+ _test_eof25: cs = 25; goto _test_eof;
438
+ _test_eof26: cs = 26; goto _test_eof;
439
+
440
+ _test_eof: {}
441
+ _out: {}
442
+ }
443
+
444
+ #line 167 "parser.rl"
445
+
446
+ if (cs >= JSON_object_first_final) {
447
+ if (json->create_additions) {
448
+ VALUE klassname = rb_hash_aref(*result, json->create_id);
449
+ if (!NIL_P(klassname)) {
450
+ VALUE klass = rb_funcall(mJSON, i_deep_const_get, 1, klassname);
451
+ if (RTEST(rb_funcall(klass, i_json_creatable_p, 0))) {
452
+ *result = rb_funcall(klass, i_json_create, 1, *result);
453
+ }
454
+ }
455
+ }
456
+ return p + 1;
457
+ } else {
458
+ return NULL;
459
+ }
460
+ }
461
+
462
+
463
+
464
+ #line 465 "parser.c"
465
+ static const int JSON_value_start = 1;
466
+ static const int JSON_value_first_final = 21;
467
+ static const int JSON_value_error = 0;
468
+
469
+ static const int JSON_value_en_main = 1;
470
+
471
+
472
+ #line 266 "parser.rl"
473
+
474
+
475
+ static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result)
476
+ {
477
+ int cs = EVIL;
478
+
479
+
480
+ #line 481 "parser.c"
481
+ {
482
+ cs = JSON_value_start;
483
+ }
484
+
485
+ #line 273 "parser.rl"
486
+
487
+ #line 488 "parser.c"
488
+ {
489
+ if ( p == pe )
490
+ goto _test_eof;
491
+ switch ( cs )
492
+ {
493
+ case 1:
494
+ switch( (*p) ) {
495
+ case 34: goto tr0;
496
+ case 45: goto tr2;
497
+ case 73: goto st2;
498
+ case 78: goto st9;
499
+ case 91: goto tr5;
500
+ case 102: goto st11;
501
+ case 110: goto st15;
502
+ case 116: goto st18;
503
+ case 123: goto tr9;
504
+ }
505
+ if ( 48 <= (*p) && (*p) <= 57 )
506
+ goto tr2;
507
+ goto st0;
508
+ st0:
509
+ cs = 0;
510
+ goto _out;
511
+ tr0:
512
+ #line 214 "parser.rl"
513
+ {
514
+ char *np = JSON_parse_string(json, p, pe, result);
515
+ if (np == NULL) { p--; {p++; cs = 21; goto _out;} } else {p = (( np))-1;}
516
+ }
517
+ goto st21;
518
+ tr2:
519
+ #line 219 "parser.rl"
520
+ {
521
+ char *np;
522
+ if(pe > p + 9 - json->quirks_mode && !strncmp(MinusInfinity, p, 9)) {
523
+ if (json->allow_nan) {
524
+ *result = CMinusInfinity;
525
+ {p = (( p + 10))-1;}
526
+ p--; {p++; cs = 21; goto _out;}
527
+ } else {
528
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
529
+ }
530
+ }
531
+ np = JSON_parse_float(json, p, pe, result);
532
+ if (np != NULL) {p = (( np))-1;}
533
+ np = JSON_parse_integer(json, p, pe, result);
534
+ if (np != NULL) {p = (( np))-1;}
535
+ p--; {p++; cs = 21; goto _out;}
536
+ }
537
+ goto st21;
538
+ tr5:
539
+ #line 237 "parser.rl"
540
+ {
541
+ char *np;
542
+ json->current_nesting++;
543
+ np = JSON_parse_array(json, p, pe, result);
544
+ json->current_nesting--;
545
+ if (np == NULL) { p--; {p++; cs = 21; goto _out;} } else {p = (( np))-1;}
546
+ }
547
+ goto st21;
548
+ tr9:
549
+ #line 245 "parser.rl"
550
+ {
551
+ char *np;
552
+ json->current_nesting++;
553
+ np = JSON_parse_object(json, p, pe, result);
554
+ json->current_nesting--;
555
+ if (np == NULL) { p--; {p++; cs = 21; goto _out;} } else {p = (( np))-1;}
556
+ }
557
+ goto st21;
558
+ tr16:
559
+ #line 207 "parser.rl"
560
+ {
561
+ if (json->allow_nan) {
562
+ *result = CInfinity;
563
+ } else {
564
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
565
+ }
566
+ }
567
+ goto st21;
568
+ tr18:
569
+ #line 200 "parser.rl"
570
+ {
571
+ if (json->allow_nan) {
572
+ *result = CNaN;
573
+ } else {
574
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
575
+ }
576
+ }
577
+ goto st21;
578
+ tr22:
579
+ #line 194 "parser.rl"
580
+ {
581
+ *result = Qfalse;
582
+ }
583
+ goto st21;
584
+ tr25:
585
+ #line 191 "parser.rl"
586
+ {
587
+ *result = Qnil;
588
+ }
589
+ goto st21;
590
+ tr28:
591
+ #line 197 "parser.rl"
592
+ {
593
+ *result = Qtrue;
594
+ }
595
+ goto st21;
596
+ st21:
597
+ if ( ++p == pe )
598
+ goto _test_eof21;
599
+ case 21:
600
+ #line 253 "parser.rl"
601
+ { p--; {p++; cs = 21; goto _out;} }
602
+ #line 603 "parser.c"
603
+ goto st0;
604
+ st2:
605
+ if ( ++p == pe )
606
+ goto _test_eof2;
607
+ case 2:
608
+ if ( (*p) == 110 )
609
+ goto st3;
610
+ goto st0;
611
+ st3:
612
+ if ( ++p == pe )
613
+ goto _test_eof3;
614
+ case 3:
615
+ if ( (*p) == 102 )
616
+ goto st4;
617
+ goto st0;
618
+ st4:
619
+ if ( ++p == pe )
620
+ goto _test_eof4;
621
+ case 4:
622
+ if ( (*p) == 105 )
623
+ goto st5;
624
+ goto st0;
625
+ st5:
626
+ if ( ++p == pe )
627
+ goto _test_eof5;
628
+ case 5:
629
+ if ( (*p) == 110 )
630
+ goto st6;
631
+ goto st0;
632
+ st6:
633
+ if ( ++p == pe )
634
+ goto _test_eof6;
635
+ case 6:
636
+ if ( (*p) == 105 )
637
+ goto st7;
638
+ goto st0;
639
+ st7:
640
+ if ( ++p == pe )
641
+ goto _test_eof7;
642
+ case 7:
643
+ if ( (*p) == 116 )
644
+ goto st8;
645
+ goto st0;
646
+ st8:
647
+ if ( ++p == pe )
648
+ goto _test_eof8;
649
+ case 8:
650
+ if ( (*p) == 121 )
651
+ goto tr16;
652
+ goto st0;
653
+ st9:
654
+ if ( ++p == pe )
655
+ goto _test_eof9;
656
+ case 9:
657
+ if ( (*p) == 97 )
658
+ goto st10;
659
+ goto st0;
660
+ st10:
661
+ if ( ++p == pe )
662
+ goto _test_eof10;
663
+ case 10:
664
+ if ( (*p) == 78 )
665
+ goto tr18;
666
+ goto st0;
667
+ st11:
668
+ if ( ++p == pe )
669
+ goto _test_eof11;
670
+ case 11:
671
+ if ( (*p) == 97 )
672
+ goto st12;
673
+ goto st0;
674
+ st12:
675
+ if ( ++p == pe )
676
+ goto _test_eof12;
677
+ case 12:
678
+ if ( (*p) == 108 )
679
+ goto st13;
680
+ goto st0;
681
+ st13:
682
+ if ( ++p == pe )
683
+ goto _test_eof13;
684
+ case 13:
685
+ if ( (*p) == 115 )
686
+ goto st14;
687
+ goto st0;
688
+ st14:
689
+ if ( ++p == pe )
690
+ goto _test_eof14;
691
+ case 14:
692
+ if ( (*p) == 101 )
693
+ goto tr22;
694
+ goto st0;
695
+ st15:
696
+ if ( ++p == pe )
697
+ goto _test_eof15;
698
+ case 15:
699
+ if ( (*p) == 117 )
700
+ goto st16;
701
+ goto st0;
702
+ st16:
703
+ if ( ++p == pe )
704
+ goto _test_eof16;
705
+ case 16:
706
+ if ( (*p) == 108 )
707
+ goto st17;
708
+ goto st0;
709
+ st17:
710
+ if ( ++p == pe )
711
+ goto _test_eof17;
712
+ case 17:
713
+ if ( (*p) == 108 )
714
+ goto tr25;
715
+ goto st0;
716
+ st18:
717
+ if ( ++p == pe )
718
+ goto _test_eof18;
719
+ case 18:
720
+ if ( (*p) == 114 )
721
+ goto st19;
722
+ goto st0;
723
+ st19:
724
+ if ( ++p == pe )
725
+ goto _test_eof19;
726
+ case 19:
727
+ if ( (*p) == 117 )
728
+ goto st20;
729
+ goto st0;
730
+ st20:
731
+ if ( ++p == pe )
732
+ goto _test_eof20;
733
+ case 20:
734
+ if ( (*p) == 101 )
735
+ goto tr28;
736
+ goto st0;
737
+ }
738
+ _test_eof21: cs = 21; goto _test_eof;
739
+ _test_eof2: cs = 2; goto _test_eof;
740
+ _test_eof3: cs = 3; goto _test_eof;
741
+ _test_eof4: cs = 4; goto _test_eof;
742
+ _test_eof5: cs = 5; goto _test_eof;
743
+ _test_eof6: cs = 6; goto _test_eof;
744
+ _test_eof7: cs = 7; goto _test_eof;
745
+ _test_eof8: cs = 8; goto _test_eof;
746
+ _test_eof9: cs = 9; goto _test_eof;
747
+ _test_eof10: cs = 10; goto _test_eof;
748
+ _test_eof11: cs = 11; goto _test_eof;
749
+ _test_eof12: cs = 12; goto _test_eof;
750
+ _test_eof13: cs = 13; goto _test_eof;
751
+ _test_eof14: cs = 14; goto _test_eof;
752
+ _test_eof15: cs = 15; goto _test_eof;
753
+ _test_eof16: cs = 16; goto _test_eof;
754
+ _test_eof17: cs = 17; goto _test_eof;
755
+ _test_eof18: cs = 18; goto _test_eof;
756
+ _test_eof19: cs = 19; goto _test_eof;
757
+ _test_eof20: cs = 20; goto _test_eof;
758
+
759
+ _test_eof: {}
760
+ _out: {}
761
+ }
762
+
763
+ #line 274 "parser.rl"
764
+
765
+ if (cs >= JSON_value_first_final) {
766
+ return p;
767
+ } else {
768
+ return NULL;
769
+ }
770
+ }
771
+
772
+
773
+ #line 774 "parser.c"
774
+ static const int JSON_integer_start = 1;
775
+ static const int JSON_integer_first_final = 3;
776
+ static const int JSON_integer_error = 0;
777
+
778
+ static const int JSON_integer_en_main = 1;
779
+
780
+
781
+ #line 290 "parser.rl"
782
+
783
+
784
+ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result)
785
+ {
786
+ int cs = EVIL;
787
+
788
+
789
+ #line 790 "parser.c"
790
+ {
791
+ cs = JSON_integer_start;
792
+ }
793
+
794
+ #line 297 "parser.rl"
795
+ json->memo = p;
796
+
797
+ #line 798 "parser.c"
798
+ {
799
+ if ( p == pe )
800
+ goto _test_eof;
801
+ switch ( cs )
802
+ {
803
+ case 1:
804
+ switch( (*p) ) {
805
+ case 45: goto st2;
806
+ case 48: goto st3;
807
+ }
808
+ if ( 49 <= (*p) && (*p) <= 57 )
809
+ goto st5;
810
+ goto st0;
811
+ st0:
812
+ cs = 0;
813
+ goto _out;
814
+ st2:
815
+ if ( ++p == pe )
816
+ goto _test_eof2;
817
+ case 2:
818
+ if ( (*p) == 48 )
819
+ goto st3;
820
+ if ( 49 <= (*p) && (*p) <= 57 )
821
+ goto st5;
822
+ goto st0;
823
+ st3:
824
+ if ( ++p == pe )
825
+ goto _test_eof3;
826
+ case 3:
827
+ if ( 48 <= (*p) && (*p) <= 57 )
828
+ goto st0;
829
+ goto tr4;
830
+ tr4:
831
+ #line 287 "parser.rl"
832
+ { p--; {p++; cs = 4; goto _out;} }
833
+ goto st4;
834
+ st4:
835
+ if ( ++p == pe )
836
+ goto _test_eof4;
837
+ case 4:
838
+ #line 839 "parser.c"
839
+ goto st0;
840
+ st5:
841
+ if ( ++p == pe )
842
+ goto _test_eof5;
843
+ case 5:
844
+ if ( 48 <= (*p) && (*p) <= 57 )
845
+ goto st5;
846
+ goto tr4;
847
+ }
848
+ _test_eof2: cs = 2; goto _test_eof;
849
+ _test_eof3: cs = 3; goto _test_eof;
850
+ _test_eof4: cs = 4; goto _test_eof;
851
+ _test_eof5: cs = 5; goto _test_eof;
852
+
853
+ _test_eof: {}
854
+ _out: {}
855
+ }
856
+
857
+ #line 299 "parser.rl"
858
+
859
+ if (cs >= JSON_integer_first_final) {
860
+ long len = p - json->memo;
861
+ fbuffer_clear(json->fbuffer);
862
+ fbuffer_append(json->fbuffer, json->memo, len);
863
+ fbuffer_append_char(json->fbuffer, '\0');
864
+ *result = rb_cstr2inum(FBUFFER_PTR(json->fbuffer), 10);
865
+ return p + 1;
866
+ } else {
867
+ return NULL;
868
+ }
869
+ }
870
+
871
+
872
+ #line 873 "parser.c"
873
+ static const int JSON_float_start = 1;
874
+ static const int JSON_float_first_final = 8;
875
+ static const int JSON_float_error = 0;
876
+
877
+ static const int JSON_float_en_main = 1;
878
+
879
+
880
+ #line 324 "parser.rl"
881
+
882
+
883
+ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
884
+ {
885
+ int cs = EVIL;
886
+
887
+
888
+ #line 889 "parser.c"
889
+ {
890
+ cs = JSON_float_start;
891
+ }
892
+
893
+ #line 331 "parser.rl"
894
+ json->memo = p;
895
+
896
+ #line 897 "parser.c"
897
+ {
898
+ if ( p == pe )
899
+ goto _test_eof;
900
+ switch ( cs )
901
+ {
902
+ case 1:
903
+ switch( (*p) ) {
904
+ case 45: goto st2;
905
+ case 48: goto st3;
906
+ }
907
+ if ( 49 <= (*p) && (*p) <= 57 )
908
+ goto st7;
909
+ goto st0;
910
+ st0:
911
+ cs = 0;
912
+ goto _out;
913
+ st2:
914
+ if ( ++p == pe )
915
+ goto _test_eof2;
916
+ case 2:
917
+ if ( (*p) == 48 )
918
+ goto st3;
919
+ if ( 49 <= (*p) && (*p) <= 57 )
920
+ goto st7;
921
+ goto st0;
922
+ st3:
923
+ if ( ++p == pe )
924
+ goto _test_eof3;
925
+ case 3:
926
+ switch( (*p) ) {
927
+ case 46: goto st4;
928
+ case 69: goto st5;
929
+ case 101: goto st5;
930
+ }
931
+ goto st0;
932
+ st4:
933
+ if ( ++p == pe )
934
+ goto _test_eof4;
935
+ case 4:
936
+ if ( 48 <= (*p) && (*p) <= 57 )
937
+ goto st8;
938
+ goto st0;
939
+ st8:
940
+ if ( ++p == pe )
941
+ goto _test_eof8;
942
+ case 8:
943
+ switch( (*p) ) {
944
+ case 69: goto st5;
945
+ case 101: goto st5;
946
+ }
947
+ if ( (*p) > 46 ) {
948
+ if ( 48 <= (*p) && (*p) <= 57 )
949
+ goto st8;
950
+ } else if ( (*p) >= 45 )
951
+ goto st0;
952
+ goto tr9;
953
+ tr9:
954
+ #line 318 "parser.rl"
955
+ { p--; {p++; cs = 9; goto _out;} }
956
+ goto st9;
957
+ st9:
958
+ if ( ++p == pe )
959
+ goto _test_eof9;
960
+ case 9:
961
+ #line 962 "parser.c"
962
+ goto st0;
963
+ st5:
964
+ if ( ++p == pe )
965
+ goto _test_eof5;
966
+ case 5:
967
+ switch( (*p) ) {
968
+ case 43: goto st6;
969
+ case 45: goto st6;
970
+ }
971
+ if ( 48 <= (*p) && (*p) <= 57 )
972
+ goto st10;
973
+ goto st0;
974
+ st6:
975
+ if ( ++p == pe )
976
+ goto _test_eof6;
977
+ case 6:
978
+ if ( 48 <= (*p) && (*p) <= 57 )
979
+ goto st10;
980
+ goto st0;
981
+ st10:
982
+ if ( ++p == pe )
983
+ goto _test_eof10;
984
+ case 10:
985
+ switch( (*p) ) {
986
+ case 69: goto st0;
987
+ case 101: goto st0;
988
+ }
989
+ if ( (*p) > 46 ) {
990
+ if ( 48 <= (*p) && (*p) <= 57 )
991
+ goto st10;
992
+ } else if ( (*p) >= 45 )
993
+ goto st0;
994
+ goto tr9;
995
+ st7:
996
+ if ( ++p == pe )
997
+ goto _test_eof7;
998
+ case 7:
999
+ switch( (*p) ) {
1000
+ case 46: goto st4;
1001
+ case 69: goto st5;
1002
+ case 101: goto st5;
1003
+ }
1004
+ if ( 48 <= (*p) && (*p) <= 57 )
1005
+ goto st7;
1006
+ goto st0;
1007
+ }
1008
+ _test_eof2: cs = 2; goto _test_eof;
1009
+ _test_eof3: cs = 3; goto _test_eof;
1010
+ _test_eof4: cs = 4; goto _test_eof;
1011
+ _test_eof8: cs = 8; goto _test_eof;
1012
+ _test_eof9: cs = 9; goto _test_eof;
1013
+ _test_eof5: cs = 5; goto _test_eof;
1014
+ _test_eof6: cs = 6; goto _test_eof;
1015
+ _test_eof10: cs = 10; goto _test_eof;
1016
+ _test_eof7: cs = 7; goto _test_eof;
1017
+
1018
+ _test_eof: {}
1019
+ _out: {}
1020
+ }
1021
+
1022
+ #line 333 "parser.rl"
1023
+
1024
+ if (cs >= JSON_float_first_final) {
1025
+ long len = p - json->memo;
1026
+ fbuffer_clear(json->fbuffer);
1027
+ fbuffer_append(json->fbuffer, json->memo, len);
1028
+ fbuffer_append_char(json->fbuffer, '\0');
1029
+ *result = rb_float_new(rb_cstr_to_dbl(FBUFFER_PTR(json->fbuffer), 1));
1030
+ return p + 1;
1031
+ } else {
1032
+ return NULL;
1033
+ }
1034
+ }
1035
+
1036
+
1037
+
1038
+ #line 1039 "parser.c"
1039
+ static const int JSON_array_start = 1;
1040
+ static const int JSON_array_first_final = 17;
1041
+ static const int JSON_array_error = 0;
1042
+
1043
+ static const int JSON_array_en_main = 1;
1044
+
1045
+
1046
+ #line 376 "parser.rl"
1047
+
1048
+
1049
+ static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result)
1050
+ {
1051
+ int cs = EVIL;
1052
+ VALUE array_class = json->array_class;
1053
+
1054
+ if (json->max_nesting && json->current_nesting > json->max_nesting) {
1055
+ rb_raise(eNestingError, "nesting of %d is too deep", json->current_nesting);
1056
+ }
1057
+ *result = NIL_P(array_class) ? rb_ary_new() : rb_class_new_instance(0, 0, array_class);
1058
+
1059
+
1060
+ #line 1061 "parser.c"
1061
+ {
1062
+ cs = JSON_array_start;
1063
+ }
1064
+
1065
+ #line 389 "parser.rl"
1066
+
1067
+ #line 1068 "parser.c"
1068
+ {
1069
+ if ( p == pe )
1070
+ goto _test_eof;
1071
+ switch ( cs )
1072
+ {
1073
+ case 1:
1074
+ if ( (*p) == 91 )
1075
+ goto st2;
1076
+ goto st0;
1077
+ st0:
1078
+ cs = 0;
1079
+ goto _out;
1080
+ st2:
1081
+ if ( ++p == pe )
1082
+ goto _test_eof2;
1083
+ case 2:
1084
+ switch( (*p) ) {
1085
+ case 13: goto st2;
1086
+ case 32: goto st2;
1087
+ case 34: goto tr2;
1088
+ case 45: goto tr2;
1089
+ case 47: goto st13;
1090
+ case 73: goto tr2;
1091
+ case 78: goto tr2;
1092
+ case 91: goto tr2;
1093
+ case 93: goto tr4;
1094
+ case 102: goto tr2;
1095
+ case 110: goto tr2;
1096
+ case 116: goto tr2;
1097
+ case 123: goto tr2;
1098
+ }
1099
+ if ( (*p) > 10 ) {
1100
+ if ( 48 <= (*p) && (*p) <= 57 )
1101
+ goto tr2;
1102
+ } else if ( (*p) >= 9 )
1103
+ goto st2;
1104
+ goto st0;
1105
+ tr2:
1106
+ #line 353 "parser.rl"
1107
+ {
1108
+ VALUE v = Qnil;
1109
+ char *np = JSON_parse_value(json, p, pe, &v);
1110
+ if (np == NULL) {
1111
+ p--; {p++; cs = 3; goto _out;}
1112
+ } else {
1113
+ if (NIL_P(json->array_class)) {
1114
+ rb_ary_push(*result, v);
1115
+ } else {
1116
+ rb_funcall(*result, i_leftshift, 1, v);
1117
+ }
1118
+ {p = (( np))-1;}
1119
+ }
1120
+ }
1121
+ goto st3;
1122
+ st3:
1123
+ if ( ++p == pe )
1124
+ goto _test_eof3;
1125
+ case 3:
1126
+ #line 1127 "parser.c"
1127
+ switch( (*p) ) {
1128
+ case 13: goto st3;
1129
+ case 32: goto st3;
1130
+ case 44: goto st4;
1131
+ case 47: goto st9;
1132
+ case 93: goto tr4;
1133
+ }
1134
+ if ( 9 <= (*p) && (*p) <= 10 )
1135
+ goto st3;
1136
+ goto st0;
1137
+ st4:
1138
+ if ( ++p == pe )
1139
+ goto _test_eof4;
1140
+ case 4:
1141
+ switch( (*p) ) {
1142
+ case 13: goto st4;
1143
+ case 32: goto st4;
1144
+ case 34: goto tr2;
1145
+ case 45: goto tr2;
1146
+ case 47: goto st5;
1147
+ case 73: goto tr2;
1148
+ case 78: goto tr2;
1149
+ case 91: goto tr2;
1150
+ case 102: goto tr2;
1151
+ case 110: goto tr2;
1152
+ case 116: goto tr2;
1153
+ case 123: goto tr2;
1154
+ }
1155
+ if ( (*p) > 10 ) {
1156
+ if ( 48 <= (*p) && (*p) <= 57 )
1157
+ goto tr2;
1158
+ } else if ( (*p) >= 9 )
1159
+ goto st4;
1160
+ goto st0;
1161
+ st5:
1162
+ if ( ++p == pe )
1163
+ goto _test_eof5;
1164
+ case 5:
1165
+ switch( (*p) ) {
1166
+ case 42: goto st6;
1167
+ case 47: goto st8;
1168
+ }
1169
+ goto st0;
1170
+ st6:
1171
+ if ( ++p == pe )
1172
+ goto _test_eof6;
1173
+ case 6:
1174
+ if ( (*p) == 42 )
1175
+ goto st7;
1176
+ goto st6;
1177
+ st7:
1178
+ if ( ++p == pe )
1179
+ goto _test_eof7;
1180
+ case 7:
1181
+ switch( (*p) ) {
1182
+ case 42: goto st7;
1183
+ case 47: goto st4;
1184
+ }
1185
+ goto st6;
1186
+ st8:
1187
+ if ( ++p == pe )
1188
+ goto _test_eof8;
1189
+ case 8:
1190
+ if ( (*p) == 10 )
1191
+ goto st4;
1192
+ goto st8;
1193
+ st9:
1194
+ if ( ++p == pe )
1195
+ goto _test_eof9;
1196
+ case 9:
1197
+ switch( (*p) ) {
1198
+ case 42: goto st10;
1199
+ case 47: goto st12;
1200
+ }
1201
+ goto st0;
1202
+ st10:
1203
+ if ( ++p == pe )
1204
+ goto _test_eof10;
1205
+ case 10:
1206
+ if ( (*p) == 42 )
1207
+ goto st11;
1208
+ goto st10;
1209
+ st11:
1210
+ if ( ++p == pe )
1211
+ goto _test_eof11;
1212
+ case 11:
1213
+ switch( (*p) ) {
1214
+ case 42: goto st11;
1215
+ case 47: goto st3;
1216
+ }
1217
+ goto st10;
1218
+ st12:
1219
+ if ( ++p == pe )
1220
+ goto _test_eof12;
1221
+ case 12:
1222
+ if ( (*p) == 10 )
1223
+ goto st3;
1224
+ goto st12;
1225
+ tr4:
1226
+ #line 368 "parser.rl"
1227
+ { p--; {p++; cs = 17; goto _out;} }
1228
+ goto st17;
1229
+ st17:
1230
+ if ( ++p == pe )
1231
+ goto _test_eof17;
1232
+ case 17:
1233
+ #line 1234 "parser.c"
1234
+ goto st0;
1235
+ st13:
1236
+ if ( ++p == pe )
1237
+ goto _test_eof13;
1238
+ case 13:
1239
+ switch( (*p) ) {
1240
+ case 42: goto st14;
1241
+ case 47: goto st16;
1242
+ }
1243
+ goto st0;
1244
+ st14:
1245
+ if ( ++p == pe )
1246
+ goto _test_eof14;
1247
+ case 14:
1248
+ if ( (*p) == 42 )
1249
+ goto st15;
1250
+ goto st14;
1251
+ st15:
1252
+ if ( ++p == pe )
1253
+ goto _test_eof15;
1254
+ case 15:
1255
+ switch( (*p) ) {
1256
+ case 42: goto st15;
1257
+ case 47: goto st2;
1258
+ }
1259
+ goto st14;
1260
+ st16:
1261
+ if ( ++p == pe )
1262
+ goto _test_eof16;
1263
+ case 16:
1264
+ if ( (*p) == 10 )
1265
+ goto st2;
1266
+ goto st16;
1267
+ }
1268
+ _test_eof2: cs = 2; goto _test_eof;
1269
+ _test_eof3: cs = 3; goto _test_eof;
1270
+ _test_eof4: cs = 4; goto _test_eof;
1271
+ _test_eof5: cs = 5; goto _test_eof;
1272
+ _test_eof6: cs = 6; goto _test_eof;
1273
+ _test_eof7: cs = 7; goto _test_eof;
1274
+ _test_eof8: cs = 8; goto _test_eof;
1275
+ _test_eof9: cs = 9; goto _test_eof;
1276
+ _test_eof10: cs = 10; goto _test_eof;
1277
+ _test_eof11: cs = 11; goto _test_eof;
1278
+ _test_eof12: cs = 12; goto _test_eof;
1279
+ _test_eof17: cs = 17; goto _test_eof;
1280
+ _test_eof13: cs = 13; goto _test_eof;
1281
+ _test_eof14: cs = 14; goto _test_eof;
1282
+ _test_eof15: cs = 15; goto _test_eof;
1283
+ _test_eof16: cs = 16; goto _test_eof;
1284
+
1285
+ _test_eof: {}
1286
+ _out: {}
1287
+ }
1288
+
1289
+ #line 390 "parser.rl"
1290
+
1291
+ if(cs >= JSON_array_first_final) {
1292
+ return p + 1;
1293
+ } else {
1294
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
1295
+ return NULL;
1296
+ }
1297
+ }
1298
+
1299
+ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
1300
+ {
1301
+ char *p = string, *pe = string, *unescape;
1302
+ int unescape_len;
1303
+
1304
+ while (pe < stringEnd) {
1305
+ if (*pe == '\\') {
1306
+ unescape = (char *) "?";
1307
+ unescape_len = 1;
1308
+ if (pe > p) rb_str_buf_cat(result, p, pe - p);
1309
+ switch (*++pe) {
1310
+ case 'n':
1311
+ unescape = (char *) "\n";
1312
+ break;
1313
+ case 'r':
1314
+ unescape = (char *) "\r";
1315
+ break;
1316
+ case 't':
1317
+ unescape = (char *) "\t";
1318
+ break;
1319
+ case '"':
1320
+ unescape = (char *) "\"";
1321
+ break;
1322
+ case '\\':
1323
+ unescape = (char *) "\\";
1324
+ break;
1325
+ case 'b':
1326
+ unescape = (char *) "\b";
1327
+ break;
1328
+ case 'f':
1329
+ unescape = (char *) "\f";
1330
+ break;
1331
+ case 'u':
1332
+ if (pe > stringEnd - 4) {
1333
+ return Qnil;
1334
+ } else {
1335
+ char buf[4];
1336
+ UTF32 ch = unescape_unicode((unsigned char *) ++pe);
1337
+ pe += 3;
1338
+ if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
1339
+ pe++;
1340
+ if (pe > stringEnd - 6) return Qnil;
1341
+ if (pe[0] == '\\' && pe[1] == 'u') {
1342
+ UTF32 sur = unescape_unicode((unsigned char *) pe + 2);
1343
+ ch = (((ch & 0x3F) << 10) | ((((ch >> 6) & 0xF) + 1) << 16)
1344
+ | (sur & 0x3FF));
1345
+ pe += 5;
1346
+ } else {
1347
+ unescape = (char *) "?";
1348
+ break;
1349
+ }
1350
+ }
1351
+ unescape_len = convert_UTF32_to_UTF8(buf, ch);
1352
+ unescape = buf;
1353
+ }
1354
+ break;
1355
+ default:
1356
+ p = pe;
1357
+ continue;
1358
+ }
1359
+ rb_str_buf_cat(result, unescape, unescape_len);
1360
+ p = ++pe;
1361
+ } else {
1362
+ pe++;
1363
+ }
1364
+ }
1365
+ rb_str_buf_cat(result, p, pe - p);
1366
+ return result;
1367
+ }
1368
+
1369
+
1370
+ #line 1371 "parser.c"
1371
+ static const int JSON_string_start = 1;
1372
+ static const int JSON_string_first_final = 8;
1373
+ static const int JSON_string_error = 0;
1374
+
1375
+ static const int JSON_string_en_main = 1;
1376
+
1377
+
1378
+ #line 489 "parser.rl"
1379
+
1380
+
1381
+ static int
1382
+ match_i(VALUE regexp, VALUE klass, VALUE memo)
1383
+ {
1384
+ if (regexp == Qundef) return ST_STOP;
1385
+ if (RTEST(rb_funcall(klass, i_json_creatable_p, 0)) &&
1386
+ RTEST(rb_funcall(regexp, i_match, 1, rb_ary_entry(memo, 0)))) {
1387
+ rb_ary_push(memo, klass);
1388
+ return ST_STOP;
1389
+ }
1390
+ return ST_CONTINUE;
1391
+ }
1392
+
1393
+ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *result)
1394
+ {
1395
+ int cs = EVIL;
1396
+ VALUE match_string;
1397
+
1398
+ *result = rb_str_buf_new(0);
1399
+
1400
+ #line 1401 "parser.c"
1401
+ {
1402
+ cs = JSON_string_start;
1403
+ }
1404
+
1405
+ #line 510 "parser.rl"
1406
+ json->memo = p;
1407
+
1408
+ #line 1409 "parser.c"
1409
+ {
1410
+ if ( p == pe )
1411
+ goto _test_eof;
1412
+ switch ( cs )
1413
+ {
1414
+ case 1:
1415
+ if ( (*p) == 34 )
1416
+ goto st2;
1417
+ goto st0;
1418
+ st0:
1419
+ cs = 0;
1420
+ goto _out;
1421
+ st2:
1422
+ if ( ++p == pe )
1423
+ goto _test_eof2;
1424
+ case 2:
1425
+ switch( (*p) ) {
1426
+ case 34: goto tr2;
1427
+ case 92: goto st3;
1428
+ }
1429
+ if ( 0 <= (*p) && (*p) <= 31 )
1430
+ goto st0;
1431
+ goto st2;
1432
+ tr2:
1433
+ #line 475 "parser.rl"
1434
+ {
1435
+ *result = json_string_unescape(*result, json->memo + 1, p);
1436
+ if (NIL_P(*result)) {
1437
+ p--;
1438
+ {p++; cs = 8; goto _out;}
1439
+ } else {
1440
+ FORCE_UTF8(*result);
1441
+ {p = (( p + 1))-1;}
1442
+ }
1443
+ }
1444
+ #line 486 "parser.rl"
1445
+ { p--; {p++; cs = 8; goto _out;} }
1446
+ goto st8;
1447
+ st8:
1448
+ if ( ++p == pe )
1449
+ goto _test_eof8;
1450
+ case 8:
1451
+ #line 1452 "parser.c"
1452
+ goto st0;
1453
+ st3:
1454
+ if ( ++p == pe )
1455
+ goto _test_eof3;
1456
+ case 3:
1457
+ if ( (*p) == 117 )
1458
+ goto st4;
1459
+ if ( 0 <= (*p) && (*p) <= 31 )
1460
+ goto st0;
1461
+ goto st2;
1462
+ st4:
1463
+ if ( ++p == pe )
1464
+ goto _test_eof4;
1465
+ case 4:
1466
+ if ( (*p) < 65 ) {
1467
+ if ( 48 <= (*p) && (*p) <= 57 )
1468
+ goto st5;
1469
+ } else if ( (*p) > 70 ) {
1470
+ if ( 97 <= (*p) && (*p) <= 102 )
1471
+ goto st5;
1472
+ } else
1473
+ goto st5;
1474
+ goto st0;
1475
+ st5:
1476
+ if ( ++p == pe )
1477
+ goto _test_eof5;
1478
+ case 5:
1479
+ if ( (*p) < 65 ) {
1480
+ if ( 48 <= (*p) && (*p) <= 57 )
1481
+ goto st6;
1482
+ } else if ( (*p) > 70 ) {
1483
+ if ( 97 <= (*p) && (*p) <= 102 )
1484
+ goto st6;
1485
+ } else
1486
+ goto st6;
1487
+ goto st0;
1488
+ st6:
1489
+ if ( ++p == pe )
1490
+ goto _test_eof6;
1491
+ case 6:
1492
+ if ( (*p) < 65 ) {
1493
+ if ( 48 <= (*p) && (*p) <= 57 )
1494
+ goto st7;
1495
+ } else if ( (*p) > 70 ) {
1496
+ if ( 97 <= (*p) && (*p) <= 102 )
1497
+ goto st7;
1498
+ } else
1499
+ goto st7;
1500
+ goto st0;
1501
+ st7:
1502
+ if ( ++p == pe )
1503
+ goto _test_eof7;
1504
+ case 7:
1505
+ if ( (*p) < 65 ) {
1506
+ if ( 48 <= (*p) && (*p) <= 57 )
1507
+ goto st2;
1508
+ } else if ( (*p) > 70 ) {
1509
+ if ( 97 <= (*p) && (*p) <= 102 )
1510
+ goto st2;
1511
+ } else
1512
+ goto st2;
1513
+ goto st0;
1514
+ }
1515
+ _test_eof2: cs = 2; goto _test_eof;
1516
+ _test_eof8: cs = 8; goto _test_eof;
1517
+ _test_eof3: cs = 3; goto _test_eof;
1518
+ _test_eof4: cs = 4; goto _test_eof;
1519
+ _test_eof5: cs = 5; goto _test_eof;
1520
+ _test_eof6: cs = 6; goto _test_eof;
1521
+ _test_eof7: cs = 7; goto _test_eof;
1522
+
1523
+ _test_eof: {}
1524
+ _out: {}
1525
+ }
1526
+
1527
+ #line 512 "parser.rl"
1528
+
1529
+ if (json->create_additions && RTEST(match_string = json->match_string)) {
1530
+ VALUE klass;
1531
+ VALUE memo = rb_ary_new2(2);
1532
+ rb_ary_push(memo, *result);
1533
+ rb_hash_foreach(match_string, match_i, memo);
1534
+ klass = rb_ary_entry(memo, 1);
1535
+ if (RTEST(klass)) {
1536
+ *result = rb_funcall(klass, i_json_create, 1, *result);
1537
+ }
1538
+ }
1539
+
1540
+ if (json->symbolize_names && json->parsing_name) {
1541
+ *result = rb_str_intern(*result);
1542
+ }
1543
+ if (cs >= JSON_string_first_final) {
1544
+ return p + 1;
1545
+ } else {
1546
+ return NULL;
1547
+ }
1548
+ }
1549
+
1550
+ /*
1551
+ * Document-class: JSON::Ext::Parser
1552
+ *
1553
+ * This is the JSON parser implemented as a C extension. It can be configured
1554
+ * to be used by setting
1555
+ *
1556
+ * JSON.parser = JSON::Ext::Parser
1557
+ *
1558
+ * with the method parser= in JSON.
1559
+ *
1560
+ */
1561
+
1562
+ static VALUE convert_encoding(VALUE source)
1563
+ {
1564
+ char *ptr = RSTRING_PTR(source);
1565
+ long len = RSTRING_LEN(source);
1566
+ if (len < 2) {
1567
+ rb_raise(eParserError, "A JSON text must at least contain two octets!");
1568
+ }
1569
+ #ifdef HAVE_RUBY_ENCODING_H
1570
+ {
1571
+ VALUE encoding = rb_funcall(source, i_encoding, 0);
1572
+ if (encoding == CEncoding_ASCII_8BIT) {
1573
+ if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
1574
+ source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_32BE);
1575
+ } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
1576
+ source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16BE);
1577
+ } else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
1578
+ source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_32LE);
1579
+ } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
1580
+ source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16LE);
1581
+ } else {
1582
+ source = rb_str_dup(source);
1583
+ FORCE_UTF8(source);
1584
+ }
1585
+ } else {
1586
+ source = rb_funcall(source, i_encode, 1, CEncoding_UTF_8);
1587
+ }
1588
+ }
1589
+ #else
1590
+ if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
1591
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-32be"), source);
1592
+ } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
1593
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-16be"), source);
1594
+ } else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
1595
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-32le"), source);
1596
+ } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
1597
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-16le"), source);
1598
+ }
1599
+ #endif
1600
+ return source;
1601
+ }
1602
+
1603
+ /*
1604
+ * call-seq: new(source, opts => {})
1605
+ *
1606
+ * Creates a new JSON::Ext::Parser instance for the string _source_.
1607
+ *
1608
+ * Creates a new JSON::Ext::Parser instance for the string _source_.
1609
+ *
1610
+ * It will be configured by the _opts_ hash. _opts_ can have the following
1611
+ * keys:
1612
+ *
1613
+ * _opts_ can have the following keys:
1614
+ * * *max_nesting*: The maximum depth of nesting allowed in the parsed data
1615
+ * structures. Disable depth checking with :max_nesting => false|nil|0, it
1616
+ * defaults to 19.
1617
+ * * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
1618
+ * defiance of RFC 4627 to be parsed by the Parser. This option defaults to
1619
+ * false.
1620
+ * * *symbolize_names*: If set to true, returns symbols for the names
1621
+ * (keys) in a JSON object. Otherwise strings are returned, which is also
1622
+ * the default.
1623
+ * * *create_additions*: If set to false, the Parser doesn't create
1624
+ * additions even if a matchin class and create_id was found. This option
1625
+ * defaults to true.
1626
+ * * *object_class*: Defaults to Hash
1627
+ * * *array_class*: Defaults to Array
1628
+ */
1629
+ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
1630
+ {
1631
+ VALUE source, opts;
1632
+ GET_PARSER_INIT;
1633
+
1634
+ if (json->Vsource) {
1635
+ rb_raise(rb_eTypeError, "already initialized instance");
1636
+ }
1637
+ rb_scan_args(argc, argv, "11", &source, &opts);
1638
+ if (!NIL_P(opts)) {
1639
+ opts = rb_convert_type(opts, T_HASH, "Hash", "to_hash");
1640
+ if (NIL_P(opts)) {
1641
+ rb_raise(rb_eArgError, "opts needs to be like a hash");
1642
+ } else {
1643
+ VALUE tmp = ID2SYM(i_max_nesting);
1644
+ if (option_given_p(opts, tmp)) {
1645
+ VALUE max_nesting = rb_hash_aref(opts, tmp);
1646
+ if (RTEST(max_nesting)) {
1647
+ Check_Type(max_nesting, T_FIXNUM);
1648
+ json->max_nesting = FIX2INT(max_nesting);
1649
+ } else {
1650
+ json->max_nesting = 0;
1651
+ }
1652
+ } else {
1653
+ json->max_nesting = 19;
1654
+ }
1655
+ tmp = ID2SYM(i_allow_nan);
1656
+ if (option_given_p(opts, tmp)) {
1657
+ json->allow_nan = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
1658
+ } else {
1659
+ json->allow_nan = 0;
1660
+ }
1661
+ tmp = ID2SYM(i_symbolize_names);
1662
+ if (option_given_p(opts, tmp)) {
1663
+ json->symbolize_names = RTEST(rb_hash_aref(opts, tmp)) ? 1 : 0;
1664
+ } else {
1665
+ json->symbolize_names = 0;
1666
+ }
1667
+ tmp = ID2SYM(i_quirks_mode);
1668
+ if (option_given_p(opts, tmp)) {
1669
+ VALUE quirks_mode = rb_hash_aref(opts, tmp);
1670
+ json->quirks_mode = RTEST(quirks_mode) ? 1 : 0;
1671
+ } else {
1672
+ json->quirks_mode = 0;
1673
+ }
1674
+ tmp = ID2SYM(i_create_additions);
1675
+ if (option_given_p(opts, tmp)) {
1676
+ json->create_additions = RTEST(rb_hash_aref(opts, tmp));
1677
+ } else {
1678
+ json->create_additions = 1;
1679
+ }
1680
+ tmp = ID2SYM(i_create_id);
1681
+ if (option_given_p(opts, tmp)) {
1682
+ json->create_id = rb_hash_aref(opts, tmp);
1683
+ } else {
1684
+ json->create_id = rb_funcall(mJSON, i_create_id, 0);
1685
+ }
1686
+ tmp = ID2SYM(i_object_class);
1687
+ if (option_given_p(opts, tmp)) {
1688
+ json->object_class = rb_hash_aref(opts, tmp);
1689
+ } else {
1690
+ json->object_class = Qnil;
1691
+ }
1692
+ tmp = ID2SYM(i_array_class);
1693
+ if (option_given_p(opts, tmp)) {
1694
+ json->array_class = rb_hash_aref(opts, tmp);
1695
+ } else {
1696
+ json->array_class = Qnil;
1697
+ }
1698
+ tmp = ID2SYM(i_match_string);
1699
+ if (option_given_p(opts, tmp)) {
1700
+ VALUE match_string = rb_hash_aref(opts, tmp);
1701
+ json->match_string = RTEST(match_string) ? match_string : Qnil;
1702
+ } else {
1703
+ json->match_string = Qnil;
1704
+ }
1705
+ }
1706
+ } else {
1707
+ json->max_nesting = 19;
1708
+ json->allow_nan = 0;
1709
+ json->create_additions = 1;
1710
+ json->create_id = rb_funcall(mJSON, i_create_id, 0);
1711
+ json->object_class = Qnil;
1712
+ json->array_class = Qnil;
1713
+ }
1714
+ source = rb_convert_type(source, T_STRING, "String", "to_str");
1715
+ if (!json->quirks_mode) {
1716
+ source = convert_encoding(StringValue(source));
1717
+ }
1718
+ json->current_nesting = 0;
1719
+ json->len = RSTRING_LEN(source);
1720
+ json->source = RSTRING_PTR(source);;
1721
+ json->Vsource = source;
1722
+ return self;
1723
+ }
1724
+
1725
+
1726
+ #line 1727 "parser.c"
1727
+ static const int JSON_start = 1;
1728
+ static const int JSON_first_final = 10;
1729
+ static const int JSON_error = 0;
1730
+
1731
+ static const int JSON_en_main = 1;
1732
+
1733
+
1734
+ #line 734 "parser.rl"
1735
+
1736
+
1737
+ static VALUE cParser_parse_strict(VALUE self)
1738
+ {
1739
+ char *p, *pe;
1740
+ int cs = EVIL;
1741
+ VALUE result = Qnil;
1742
+ GET_PARSER;
1743
+
1744
+
1745
+ #line 1746 "parser.c"
1746
+ {
1747
+ cs = JSON_start;
1748
+ }
1749
+
1750
+ #line 744 "parser.rl"
1751
+ p = json->source;
1752
+ pe = p + json->len;
1753
+
1754
+ #line 1755 "parser.c"
1755
+ {
1756
+ if ( p == pe )
1757
+ goto _test_eof;
1758
+ switch ( cs )
1759
+ {
1760
+ st1:
1761
+ if ( ++p == pe )
1762
+ goto _test_eof1;
1763
+ case 1:
1764
+ switch( (*p) ) {
1765
+ case 13: goto st1;
1766
+ case 32: goto st1;
1767
+ case 47: goto st2;
1768
+ case 91: goto tr3;
1769
+ case 123: goto tr4;
1770
+ }
1771
+ if ( 9 <= (*p) && (*p) <= 10 )
1772
+ goto st1;
1773
+ goto st0;
1774
+ st0:
1775
+ cs = 0;
1776
+ goto _out;
1777
+ st2:
1778
+ if ( ++p == pe )
1779
+ goto _test_eof2;
1780
+ case 2:
1781
+ switch( (*p) ) {
1782
+ case 42: goto st3;
1783
+ case 47: goto st5;
1784
+ }
1785
+ goto st0;
1786
+ st3:
1787
+ if ( ++p == pe )
1788
+ goto _test_eof3;
1789
+ case 3:
1790
+ if ( (*p) == 42 )
1791
+ goto st4;
1792
+ goto st3;
1793
+ st4:
1794
+ if ( ++p == pe )
1795
+ goto _test_eof4;
1796
+ case 4:
1797
+ switch( (*p) ) {
1798
+ case 42: goto st4;
1799
+ case 47: goto st1;
1800
+ }
1801
+ goto st3;
1802
+ st5:
1803
+ if ( ++p == pe )
1804
+ goto _test_eof5;
1805
+ case 5:
1806
+ if ( (*p) == 10 )
1807
+ goto st1;
1808
+ goto st5;
1809
+ tr3:
1810
+ #line 723 "parser.rl"
1811
+ {
1812
+ char *np;
1813
+ json->current_nesting = 1;
1814
+ np = JSON_parse_array(json, p, pe, &result);
1815
+ if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;}
1816
+ }
1817
+ goto st10;
1818
+ tr4:
1819
+ #line 716 "parser.rl"
1820
+ {
1821
+ char *np;
1822
+ json->current_nesting = 1;
1823
+ np = JSON_parse_object(json, p, pe, &result);
1824
+ if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;}
1825
+ }
1826
+ goto st10;
1827
+ st10:
1828
+ if ( ++p == pe )
1829
+ goto _test_eof10;
1830
+ case 10:
1831
+ #line 1832 "parser.c"
1832
+ switch( (*p) ) {
1833
+ case 13: goto st10;
1834
+ case 32: goto st10;
1835
+ case 47: goto st6;
1836
+ }
1837
+ if ( 9 <= (*p) && (*p) <= 10 )
1838
+ goto st10;
1839
+ goto st0;
1840
+ st6:
1841
+ if ( ++p == pe )
1842
+ goto _test_eof6;
1843
+ case 6:
1844
+ switch( (*p) ) {
1845
+ case 42: goto st7;
1846
+ case 47: goto st9;
1847
+ }
1848
+ goto st0;
1849
+ st7:
1850
+ if ( ++p == pe )
1851
+ goto _test_eof7;
1852
+ case 7:
1853
+ if ( (*p) == 42 )
1854
+ goto st8;
1855
+ goto st7;
1856
+ st8:
1857
+ if ( ++p == pe )
1858
+ goto _test_eof8;
1859
+ case 8:
1860
+ switch( (*p) ) {
1861
+ case 42: goto st8;
1862
+ case 47: goto st10;
1863
+ }
1864
+ goto st7;
1865
+ st9:
1866
+ if ( ++p == pe )
1867
+ goto _test_eof9;
1868
+ case 9:
1869
+ if ( (*p) == 10 )
1870
+ goto st10;
1871
+ goto st9;
1872
+ }
1873
+ _test_eof1: cs = 1; goto _test_eof;
1874
+ _test_eof2: cs = 2; goto _test_eof;
1875
+ _test_eof3: cs = 3; goto _test_eof;
1876
+ _test_eof4: cs = 4; goto _test_eof;
1877
+ _test_eof5: cs = 5; goto _test_eof;
1878
+ _test_eof10: cs = 10; goto _test_eof;
1879
+ _test_eof6: cs = 6; goto _test_eof;
1880
+ _test_eof7: cs = 7; goto _test_eof;
1881
+ _test_eof8: cs = 8; goto _test_eof;
1882
+ _test_eof9: cs = 9; goto _test_eof;
1883
+
1884
+ _test_eof: {}
1885
+ _out: {}
1886
+ }
1887
+
1888
+ #line 747 "parser.rl"
1889
+
1890
+ if (cs >= JSON_first_final && p == pe) {
1891
+ return result;
1892
+ } else {
1893
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
1894
+ return Qnil;
1895
+ }
1896
+ }
1897
+
1898
+
1899
+
1900
+ #line 1901 "parser.c"
1901
+ static const int JSON_quirks_mode_start = 1;
1902
+ static const int JSON_quirks_mode_first_final = 10;
1903
+ static const int JSON_quirks_mode_error = 0;
1904
+
1905
+ static const int JSON_quirks_mode_en_main = 1;
1906
+
1907
+
1908
+ #line 772 "parser.rl"
1909
+
1910
+
1911
+ static VALUE cParser_parse_quirks_mode(VALUE self)
1912
+ {
1913
+ char *p, *pe;
1914
+ int cs = EVIL;
1915
+ VALUE result = Qnil;
1916
+ GET_PARSER;
1917
+
1918
+
1919
+ #line 1920 "parser.c"
1920
+ {
1921
+ cs = JSON_quirks_mode_start;
1922
+ }
1923
+
1924
+ #line 782 "parser.rl"
1925
+ p = json->source;
1926
+ pe = p + json->len;
1927
+
1928
+ #line 1929 "parser.c"
1929
+ {
1930
+ if ( p == pe )
1931
+ goto _test_eof;
1932
+ switch ( cs )
1933
+ {
1934
+ st1:
1935
+ if ( ++p == pe )
1936
+ goto _test_eof1;
1937
+ case 1:
1938
+ switch( (*p) ) {
1939
+ case 13: goto st1;
1940
+ case 32: goto st1;
1941
+ case 34: goto tr2;
1942
+ case 45: goto tr2;
1943
+ case 47: goto st6;
1944
+ case 73: goto tr2;
1945
+ case 78: goto tr2;
1946
+ case 91: goto tr2;
1947
+ case 102: goto tr2;
1948
+ case 110: goto tr2;
1949
+ case 116: goto tr2;
1950
+ case 123: goto tr2;
1951
+ }
1952
+ if ( (*p) > 10 ) {
1953
+ if ( 48 <= (*p) && (*p) <= 57 )
1954
+ goto tr2;
1955
+ } else if ( (*p) >= 9 )
1956
+ goto st1;
1957
+ goto st0;
1958
+ st0:
1959
+ cs = 0;
1960
+ goto _out;
1961
+ tr2:
1962
+ #line 764 "parser.rl"
1963
+ {
1964
+ char *np = JSON_parse_value(json, p, pe, &result);
1965
+ if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;}
1966
+ }
1967
+ goto st10;
1968
+ st10:
1969
+ if ( ++p == pe )
1970
+ goto _test_eof10;
1971
+ case 10:
1972
+ #line 1973 "parser.c"
1973
+ switch( (*p) ) {
1974
+ case 13: goto st10;
1975
+ case 32: goto st10;
1976
+ case 47: goto st2;
1977
+ }
1978
+ if ( 9 <= (*p) && (*p) <= 10 )
1979
+ goto st10;
1980
+ goto st0;
1981
+ st2:
1982
+ if ( ++p == pe )
1983
+ goto _test_eof2;
1984
+ case 2:
1985
+ switch( (*p) ) {
1986
+ case 42: goto st3;
1987
+ case 47: goto st5;
1988
+ }
1989
+ goto st0;
1990
+ st3:
1991
+ if ( ++p == pe )
1992
+ goto _test_eof3;
1993
+ case 3:
1994
+ if ( (*p) == 42 )
1995
+ goto st4;
1996
+ goto st3;
1997
+ st4:
1998
+ if ( ++p == pe )
1999
+ goto _test_eof4;
2000
+ case 4:
2001
+ switch( (*p) ) {
2002
+ case 42: goto st4;
2003
+ case 47: goto st10;
2004
+ }
2005
+ goto st3;
2006
+ st5:
2007
+ if ( ++p == pe )
2008
+ goto _test_eof5;
2009
+ case 5:
2010
+ if ( (*p) == 10 )
2011
+ goto st10;
2012
+ goto st5;
2013
+ st6:
2014
+ if ( ++p == pe )
2015
+ goto _test_eof6;
2016
+ case 6:
2017
+ switch( (*p) ) {
2018
+ case 42: goto st7;
2019
+ case 47: goto st9;
2020
+ }
2021
+ goto st0;
2022
+ st7:
2023
+ if ( ++p == pe )
2024
+ goto _test_eof7;
2025
+ case 7:
2026
+ if ( (*p) == 42 )
2027
+ goto st8;
2028
+ goto st7;
2029
+ st8:
2030
+ if ( ++p == pe )
2031
+ goto _test_eof8;
2032
+ case 8:
2033
+ switch( (*p) ) {
2034
+ case 42: goto st8;
2035
+ case 47: goto st1;
2036
+ }
2037
+ goto st7;
2038
+ st9:
2039
+ if ( ++p == pe )
2040
+ goto _test_eof9;
2041
+ case 9:
2042
+ if ( (*p) == 10 )
2043
+ goto st1;
2044
+ goto st9;
2045
+ }
2046
+ _test_eof1: cs = 1; goto _test_eof;
2047
+ _test_eof10: cs = 10; goto _test_eof;
2048
+ _test_eof2: cs = 2; goto _test_eof;
2049
+ _test_eof3: cs = 3; goto _test_eof;
2050
+ _test_eof4: cs = 4; goto _test_eof;
2051
+ _test_eof5: cs = 5; goto _test_eof;
2052
+ _test_eof6: cs = 6; goto _test_eof;
2053
+ _test_eof7: cs = 7; goto _test_eof;
2054
+ _test_eof8: cs = 8; goto _test_eof;
2055
+ _test_eof9: cs = 9; goto _test_eof;
2056
+
2057
+ _test_eof: {}
2058
+ _out: {}
2059
+ }
2060
+
2061
+ #line 785 "parser.rl"
2062
+
2063
+ if (cs >= JSON_quirks_mode_first_final && p == pe) {
2064
+ return result;
2065
+ } else {
2066
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
2067
+ return Qnil;
2068
+ }
2069
+ }
2070
+
2071
+ /*
2072
+ * call-seq: parse()
2073
+ *
2074
+ * Parses the current JSON text _source_ and returns the complete data
2075
+ * structure as a result.
2076
+ */
2077
+ static VALUE cParser_parse(VALUE self)
2078
+ {
2079
+ GET_PARSER;
2080
+
2081
+ if (json->quirks_mode) {
2082
+ return cParser_parse_quirks_mode(self);
2083
+ } else {
2084
+ return cParser_parse_strict(self);
2085
+ }
2086
+ }
2087
+
2088
+
2089
+ static JSON_Parser *JSON_allocate()
2090
+ {
2091
+ JSON_Parser *json = ALLOC(JSON_Parser);
2092
+ MEMZERO(json, JSON_Parser, 1);
2093
+ json->fbuffer = fbuffer_alloc(0);
2094
+ return json;
2095
+ }
2096
+
2097
+ static void JSON_mark(JSON_Parser *json)
2098
+ {
2099
+ rb_gc_mark_maybe(json->Vsource);
2100
+ rb_gc_mark_maybe(json->create_id);
2101
+ rb_gc_mark_maybe(json->object_class);
2102
+ rb_gc_mark_maybe(json->array_class);
2103
+ rb_gc_mark_maybe(json->match_string);
2104
+ }
2105
+
2106
+ static void JSON_free(JSON_Parser *json)
2107
+ {
2108
+ fbuffer_free(json->fbuffer);
2109
+ ruby_xfree(json);
2110
+ }
2111
+
2112
+ static VALUE cJSON_parser_s_allocate(VALUE klass)
2113
+ {
2114
+ JSON_Parser *json = JSON_allocate();
2115
+ return Data_Wrap_Struct(klass, JSON_mark, JSON_free, json);
2116
+ }
2117
+
2118
+ /*
2119
+ * call-seq: source()
2120
+ *
2121
+ * Returns a copy of the current _source_ string, that was used to construct
2122
+ * this Parser.
2123
+ */
2124
+ static VALUE cParser_source(VALUE self)
2125
+ {
2126
+ GET_PARSER;
2127
+ return rb_str_dup(json->Vsource);
2128
+ }
2129
+
2130
+ /*
2131
+ * call-seq: quirks_mode?()
2132
+ *
2133
+ * Returns a true, if this parser is in quirks_mode, false otherwise.
2134
+ */
2135
+ static VALUE cParser_quirks_mode_p(VALUE self)
2136
+ {
2137
+ GET_PARSER;
2138
+ return json->quirks_mode ? Qtrue : Qfalse;
2139
+ }
2140
+
2141
+
2142
+ void Init_parser()
2143
+ {
2144
+ rb_require("json/common");
2145
+ mJSON = rb_define_module("JSON");
2146
+ mExt = rb_define_module_under(mJSON, "Ext");
2147
+ cParser = rb_define_class_under(mExt, "Parser", rb_cObject);
2148
+ eParserError = rb_path2class("JSON::ParserError");
2149
+ eNestingError = rb_path2class("JSON::NestingError");
2150
+ rb_define_alloc_func(cParser, cJSON_parser_s_allocate);
2151
+ rb_define_method(cParser, "initialize", cParser_initialize, -1);
2152
+ rb_define_method(cParser, "parse", cParser_parse, 0);
2153
+ rb_define_method(cParser, "source", cParser_source, 0);
2154
+ rb_define_method(cParser, "quirks_mode?", cParser_quirks_mode_p, 0);
2155
+
2156
+ CNaN = rb_const_get(mJSON, rb_intern("NaN"));
2157
+ CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
2158
+ CMinusInfinity = rb_const_get(mJSON, rb_intern("MinusInfinity"));
2159
+
2160
+ i_json_creatable_p = rb_intern("json_creatable?");
2161
+ i_json_create = rb_intern("json_create");
2162
+ i_create_id = rb_intern("create_id");
2163
+ i_create_additions = rb_intern("create_additions");
2164
+ i_chr = rb_intern("chr");
2165
+ i_max_nesting = rb_intern("max_nesting");
2166
+ i_allow_nan = rb_intern("allow_nan");
2167
+ i_symbolize_names = rb_intern("symbolize_names");
2168
+ i_quirks_mode = rb_intern("quirks_mode");
2169
+ i_object_class = rb_intern("object_class");
2170
+ i_array_class = rb_intern("array_class");
2171
+ i_match = rb_intern("match");
2172
+ i_match_string = rb_intern("match_string");
2173
+ i_key_p = rb_intern("key?");
2174
+ i_deep_const_get = rb_intern("deep_const_get");
2175
+ i_aset = rb_intern("[]=");
2176
+ i_leftshift = rb_intern("<<");
2177
+ #ifdef HAVE_RUBY_ENCODING_H
2178
+ CEncoding_UTF_8 = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-8"));
2179
+ CEncoding_UTF_16BE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-16be"));
2180
+ CEncoding_UTF_16LE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-16le"));
2181
+ CEncoding_UTF_32BE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-32be"));
2182
+ CEncoding_UTF_32LE = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-32le"));
2183
+ CEncoding_ASCII_8BIT = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("ascii-8bit"));
2184
+ i_encoding = rb_intern("encoding");
2185
+ i_encode = rb_intern("encode");
2186
+ #else
2187
+ i_iconv = rb_intern("iconv");
2188
+ #endif
2189
+ }
2190
+
2191
+ /*
2192
+ * Local variables:
2193
+ * mode: c
2194
+ * c-file-style: ruby
2195
+ * indent-tabs-mode: nil
2196
+ * End:
2197
+ */