nutshell-crm 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,289 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>The "Artistic License" - dev.perl.org</title>
6
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7
+
8
+
9
+ <link rel="stylesheet" type="text/css" href="http://cdn.pimg.net/css/leostyle.vffcd481.css">
10
+ <link rel="stylesheet" type="text/css" href="http://cdn.pimg.net/css/dev.v5f7fab3.css">
11
+
12
+
13
+ <link rel="shortcut icon" href="http://cdn.pimg.net/favicon.v249dfa7.ico">
14
+
15
+
16
+
17
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
18
+ <script src="http://cdn.pimg.net/js/jquery.corner.v84b7681.js" type="text/javascript" charset="utf-8"></script>
19
+ <script src="http://cdn.pimg.net/js/leo.v9872b9c.js" type="text/javascript" charset="utf-8"></script>
20
+
21
+ </head>
22
+ <body>
23
+
24
+ <div id="header_holder">
25
+ <div class="sub_holder">
26
+ <div id="page_image"></div>
27
+ <h1>
28
+ The "Artistic License"
29
+ </h1>
30
+ <div id="logo_holder">
31
+
32
+
33
+
34
+ <a href="/"><img src="http://cdn.pimg.net/images/camel_head.v25e738a.png" id="logo" alt="Perl programming" height="65" align="right" /></a>
35
+
36
+
37
+ <span>dev.perl.org</span>
38
+
39
+ </div>
40
+ </div>
41
+ </div>
42
+
43
+ <div id="nav">
44
+ <div class="sub_holder">
45
+ <ul>
46
+ <li>
47
+ <a href="/">Home</a>
48
+ </li>
49
+ <li class="">
50
+ <a href="/perl5/">Perl 5</a>
51
+ </li>
52
+ <li class="">
53
+ <a href="/perl6/">Perl 6</a>
54
+ </li>
55
+
56
+ </ul>
57
+
58
+ </div>
59
+ </div>
60
+
61
+ <div id="crum_holder">
62
+ <div id="crum" class="sub_holder">
63
+ &nbsp;
64
+ </div>
65
+ </div>
66
+
67
+ <div id="content_holder">
68
+ <div id="content" class="sub_holder">
69
+ <div id="main">
70
+
71
+ <PRE>
72
+
73
+ <A style="float:right"
74
+ HREF="http://www.opensource.org/licenses/artistic-license.php"
75
+ ><IMG BORDER=0 SRC="osi-certified-90x75.gif"
76
+ ></A>
77
+
78
+ The "Artistic License"
79
+
80
+ Preamble
81
+
82
+ The intent of this document is to state the conditions under which a
83
+ Package may be copied, such that the Copyright Holder maintains some
84
+ semblance of artistic control over the development of the package,
85
+ while giving the users of the package the right to use and distribute
86
+ the Package in a more-or-less customary fashion, plus the right to make
87
+ reasonable modifications.
88
+
89
+ Definitions:
90
+
91
+ "Package" refers to the collection of files distributed by the
92
+ Copyright Holder, and derivatives of that collection of files
93
+ created through textual modification.
94
+
95
+ "Standard Version" refers to such a Package if it has not been
96
+ modified, or has been modified in accordance with the wishes
97
+ of the Copyright Holder as specified below.
98
+
99
+ "Copyright Holder" is whoever is named in the copyright or
100
+ copyrights for the package.
101
+
102
+ "You" is you, if you're thinking about copying or distributing
103
+ this Package.
104
+
105
+ "Reasonable copying fee" is whatever you can justify on the
106
+ basis of media cost, duplication charges, time of people involved,
107
+ and so on. (You will not be required to justify it to the
108
+ Copyright Holder, but only to the computing community at large
109
+ as a market that must bear the fee.)
110
+
111
+ "Freely Available" means that no fee is charged for the item
112
+ itself, though there may be fees involved in handling the item.
113
+ It also means that recipients of the item may redistribute it
114
+ under the same conditions they received it.
115
+
116
+ 1. You may make and give away verbatim copies of the source form of the
117
+ Standard Version of this Package without restriction, provided that you
118
+ duplicate all of the original copyright notices and associated disclaimers.
119
+
120
+ 2. You may apply bug fixes, portability fixes and other modifications
121
+ derived from the Public Domain or from the Copyright Holder. A Package
122
+ modified in such a way shall still be considered the Standard Version.
123
+
124
+ 3. You may otherwise modify your copy of this Package in any way, provided
125
+ that you insert a prominent notice in each changed file stating how and
126
+ when you changed that file, and provided that you do at least ONE of the
127
+ following:
128
+
129
+ a) place your modifications in the Public Domain or otherwise make them
130
+ Freely Available, such as by posting said modifications to Usenet or
131
+ an equivalent medium, or placing the modifications on a major archive
132
+ site such as uunet.uu.net, or by allowing the Copyright Holder to include
133
+ your modifications in the Standard Version of the Package.
134
+
135
+ b) use the modified Package only within your corporation or organization.
136
+
137
+ c) rename any non-standard executables so the names do not conflict
138
+ with standard executables, which must also be provided, and provide
139
+ a separate manual page for each non-standard executable that clearly
140
+ documents how it differs from the Standard Version.
141
+
142
+ d) make other distribution arrangements with the Copyright Holder.
143
+
144
+ 4. You may distribute the programs of this Package in object code or
145
+ executable form, provided that you do at least ONE of the following:
146
+
147
+ a) distribute a Standard Version of the executables and library files,
148
+ together with instructions (in the manual page or equivalent) on where
149
+ to get the Standard Version.
150
+
151
+ b) accompany the distribution with the machine-readable source of
152
+ the Package with your modifications.
153
+
154
+ c) give non-standard executables non-standard names, and clearly
155
+ document the differences in manual pages (or equivalent), together
156
+ with instructions on where to get the Standard Version.
157
+
158
+ d) make other distribution arrangements with the Copyright Holder.
159
+
160
+ 5. You may charge a reasonable copying fee for any distribution of this
161
+ Package. You may charge any fee you choose for support of this
162
+ Package. You may not charge a fee for this Package itself. However,
163
+ you may distribute this Package in aggregate with other (possibly
164
+ commercial) programs as part of a larger (possibly commercial) software
165
+ distribution provided that you do not advertise this Package as a
166
+ product of your own. You may embed this Package's interpreter within
167
+ an executable of yours (by linking); this shall be construed as a mere
168
+ form of aggregation, provided that the complete Standard Version of the
169
+ interpreter is so embedded.
170
+
171
+ 6. The scripts and library files supplied as input to or produced as
172
+ output from the programs of this Package do not automatically fall
173
+ under the copyright of this Package, but belong to whoever generated
174
+ them, and may be sold commercially, and may be aggregated with this
175
+ Package. If such scripts or library files are aggregated with this
176
+ Package via the so-called "undump" or "unexec" methods of producing a
177
+ binary executable image, then distribution of such an image shall
178
+ neither be construed as a distribution of this Package nor shall it
179
+ fall under the restrictions of Paragraphs 3 and 4, provided that you do
180
+ not represent such an executable image as a Standard Version of this
181
+ Package.
182
+
183
+ 7. C subroutines (or comparably compiled subroutines in other
184
+ languages) supplied by you and linked into this Package in order to
185
+ emulate subroutines and variables of the language defined by this
186
+ Package shall not be considered part of this Package, but are the
187
+ equivalent of input as in Paragraph 6, provided these subroutines do
188
+ not change the language in any way that would cause it to fail the
189
+ regression tests for the language.
190
+
191
+ 8. Aggregation of this Package with a commercial distribution is always
192
+ permitted provided that the use of this Package is embedded; that is,
193
+ when no overt attempt is made to make this Package's interfaces visible
194
+ to the end user of the commercial distribution. Such use shall not be
195
+ construed as a distribution of this Package.
196
+
197
+ 9. The name of the Copyright Holder may not be used to endorse or promote
198
+ products derived from this software without specific prior written permission.
199
+
200
+ 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
201
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
202
+ WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
203
+
204
+ The End
205
+ </PRE>
206
+
207
+ </div>
208
+ <div id="short_lists" class="short_lists">
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+ <div id="spacer_for_google"></div>
219
+
220
+ </div>
221
+ </div>
222
+ </div>
223
+ <div style="clear:both"></div>
224
+
225
+ <div id="footer">
226
+ <div class="sub_holder">
227
+
228
+
229
+ <p class="sites">
230
+ &nbsp;When you need <em>Perl</em> think <strong>Perl.org</strong>: <a href="http://www.perl.org/">www</a> | <a href="http://blogs.perl.org/">blogs</a> | <a href="http://jobs.perl.org/">jobs</a> | <a href="http://learn.perl.org/">learn</a> <!-- | <a href="http://lists.perl.org/">lists</a> --> | <a href="http://dev.perl.org/">dev</a>
231
+ </p>
232
+ <p class="copyright">
233
+ <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/us/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/us/80x15.png"></a> © 2002-2011 Perl.org | <a href="/siteinfo.html">Site Info</a>
234
+ </p>
235
+
236
+
237
+
238
+
239
+ <div style="clear:both"></div>
240
+ <div id="google_translate_element"></div><script type="text/javascript">
241
+ function googleTranslateElementInit() {
242
+ new google.translate.TranslateElement({
243
+ pageLanguage: 'en',
244
+ autoDisplay: false
245
+ ,
246
+ gaTrack: true,
247
+ gaId: 'UA-50555-6'
248
+ }, 'google_translate_element');
249
+ }
250
+ </script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit" type="text/javascript">
251
+ </script>
252
+ </div>
253
+ </div>
254
+
255
+
256
+ <!--[if lt IE 7]>
257
+ <div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative; margin-top: 2em;'>
258
+ <div style='position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;'><a href='#' onclick='javascript:this.parentNode.parentNode.style.display="none"; return false;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-cornerx.jpg' style='border: none;' alt='Close this notice'/></a></div>
259
+ <div style='width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'>
260
+ <div style='width: 75px; float: left;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-warning.jpg' alt='Warning!'/></div>
261
+ <div style='width: 275px; float: left; font-family: Arial, sans-serif;'>
262
+ <div style='font-size: 14px; font-weight: bold; margin-top: 12px;'>You are using an outdated browser</div>
263
+ <div style='font-size: 12px; margin-top: 6px; line-height: 12px;'>For a better experience using this site, please upgrade to a modern web browser.</div>
264
+ </div>
265
+ <div style='width: 75px; float: left;'><a href='http://www.firefox.com' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-firefox.jpg' style='border: none;' alt='Get Firefox 3.5'/></a></div>
266
+ <div style='width: 75px; float: left;'><a href='http://www.browserforthebetter.com/download.html' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-ie8.jpg' style='border: none;' alt='Get Internet Explorer 8'/></a></div>
267
+ <div style='width: 73px; float: left;'><a href='http://www.apple.com/safari/download/' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-safari.jpg' style='border: none;' alt='Get Safari 4'/></a></div>
268
+ <div style='float: left;'><a href='http://www.google.com/chrome' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-chrome.jpg' style='border: none;' alt='Get Google Chrome'/></a></div>
269
+ </div>
270
+ </div>
271
+ <![endif]-->
272
+
273
+
274
+ <script type="text/javascript">
275
+ var _gaq = _gaq || [];
276
+ _gaq.push(['_setAccount', 'UA-50555-6']);
277
+ _gaq.push(['_trackPageview']);
278
+ (function() {
279
+ var ga = document.createElement('script');
280
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
281
+ 'http://www') + '.google-analytics.com/ga.js';
282
+ ga.setAttribute('async', 'true');
283
+ document.documentElement.firstChild.appendChild(ga);
284
+ })();
285
+ </script>
286
+ </body>
287
+ </html>
288
+
289
+
@@ -0,0 +1,5 @@
1
+ # -*- ruby encoding: utf-8 -*-
2
+
3
+ require 'diff/lcs'
4
+
5
+ # vim: ft=ruby
@@ -0,0 +1,1105 @@
1
+ # -*- ruby encoding: utf-8 -*-
2
+
3
+ module Diff
4
+ # = Diff::LCS 1.1.3
5
+ # Computes "intelligent" differences between two sequenced Enumerables.
6
+ # This is an implementation of the McIlroy-Hunt "diff" algorithm for
7
+ # Enumerable objects that include Diffable.
8
+ #
9
+ # Based on Mario I. Wolczko's Smalltalk version (1.2, 1993) and Ned Konz's
10
+ # Perl version (Algorithm::Diff 1.15).
11
+ #
12
+ # == Synopsis
13
+ # require 'diff/lcs'
14
+ #
15
+ # seq1 = %w(a b c e h j l m n p)
16
+ # seq2 = %w(b c d e f j k l m r s t)
17
+ #
18
+ # lcs = Diff::LCS.LCS(seq1, seq2)
19
+ # diffs = Diff::LCS.diff(seq1, seq2)
20
+ # sdiff = Diff::LCS.sdiff(seq1, seq2)
21
+ # seq = Diff::LCS.traverse_sequences(seq1, seq2, callback_obj)
22
+ # bal = Diff::LCS.traverse_balanced(seq1, seq2, callback_obj)
23
+ # seq2 == Diff::LCS.patch(seq1, diffs)
24
+ # seq2 == Diff::LCS.patch!(seq1, diffs)
25
+ # seq1 == Diff::LCS.unpatch(seq2, diffs)
26
+ # seq1 == Diff::LCS.unpatch!(seq2, diffs)
27
+ # seq2 == Diff::LCS.patch(seq1, sdiff)
28
+ # seq2 == Diff::LCS.patch!(seq1, sdiff)
29
+ # seq1 == Diff::LCS.unpatch(seq2, sdiff)
30
+ # seq1 == Diff::LCS.unpatch!(seq2, sdiff)
31
+ #
32
+ # Alternatively, objects can be extended with Diff::LCS:
33
+ #
34
+ # seq1.extend(Diff::LCS)
35
+ # lcs = seq1.lcs(seq2)
36
+ # diffs = seq1.diff(seq2)
37
+ # sdiff = seq1.sdiff(seq2)
38
+ # seq = seq1.traverse_sequences(seq2, callback_obj)
39
+ # bal = seq1.traverse_balanced(seq2, callback_obj)
40
+ # seq2 == seq1.patch(diffs)
41
+ # seq2 == seq1.patch!(diffs)
42
+ # seq1 == seq2.unpatch(diffs)
43
+ # seq1 == seq2.unpatch!(diffs)
44
+ # seq2 == seq1.patch(sdiff)
45
+ # seq2 == seq1.patch!(sdiff)
46
+ # seq1 == seq2.unpatch(sdiff)
47
+ # seq1 == seq2.unpatch!(sdiff)
48
+ #
49
+ # Default extensions are provided for Array and String objects through the
50
+ # use of 'diff/lcs/array' and 'diff/lcs/string'.
51
+ #
52
+ # == Introduction (by Mark-Jason Dominus)
53
+ #
54
+ # <em>The following text is from the Perl documentation. The only changes
55
+ # have been to make the text appear better in Rdoc</em>.
56
+ #
57
+ # I once read an article written by the authors of +diff+; they said that
58
+ # they hard worked very hard on the algorithm until they found the right
59
+ # one.
60
+ #
61
+ # I think what they ended up using (and I hope someone will correct me,
62
+ # because I am not very confident about this) was the `longest common
63
+ # subsequence' method. In the LCS problem, you have two sequences of
64
+ # items:
65
+ #
66
+ # a b c d f g h j q z
67
+ # a b c d e f g i j k r x y z
68
+ #
69
+ # and you want to find the longest sequence of items that is present in
70
+ # both original sequences in the same order. That is, you want to find a
71
+ # new sequence *S* which can be obtained from the first sequence by
72
+ # deleting some items, and from the second sequence by deleting other
73
+ # items. You also want *S* to be as long as possible. In this case *S* is:
74
+ #
75
+ # a b c d f g j z
76
+ #
77
+ # From there it's only a small step to get diff-like output:
78
+ #
79
+ # e h i k q r x y
80
+ # + - + + - + + +
81
+ #
82
+ # This module solves the LCS problem. It also includes a canned function
83
+ # to generate +diff+-like output.
84
+ #
85
+ # It might seem from the example above that the LCS of two sequences is
86
+ # always pretty obvious, but that's not always the case, especially when
87
+ # the two sequences have many repeated elements. For example, consider
88
+ #
89
+ # a x b y c z p d q
90
+ # a b c a x b y c z
91
+ #
92
+ # A naive approach might start by matching up the +a+ and +b+ that appear
93
+ # at the beginning of each sequence, like this:
94
+ #
95
+ # a x b y c z p d q
96
+ # a b c a b y c z
97
+ #
98
+ # This finds the common subsequence +a b c z+. But actually, the LCS is
99
+ # +a x b y c z+:
100
+ #
101
+ # a x b y c z p d q
102
+ # a b c a x b y c z
103
+ #
104
+ # == Author
105
+ # This version is by Austin Ziegler <austin@rubyforge.org>.
106
+ #
107
+ # It is based on the Perl Algorithm::Diff (1.15) by Ned Konz , copyright
108
+ # &copy; 2000&ndash;2002 and the Smalltalk diff version by Mario I.
109
+ # Wolczko, copyright &copy; 1993. Documentation includes work by
110
+ # Mark-Jason Dominus.
111
+ #
112
+ # == Licence
113
+ # Copyright &copy; 2004 Austin Ziegler
114
+ # This program is free software; you can redistribute it and/or modify it
115
+ # under the same terms as Ruby, or alternatively under the Perl Artistic
116
+ # licence.
117
+ #
118
+ # == Credits
119
+ # Much of the documentation is taken directly from the Perl
120
+ # Algorithm::Diff implementation and was written originally by Mark-Jason
121
+ # Dominus and later by Ned Konz. The basic Ruby implementation was
122
+ # re-ported from the Smalltalk implementation, available at
123
+ # ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st
124
+ #
125
+ # #sdiff and #traverse_balanced were written for the Perl version by Mike
126
+ # Schilli <m@perlmeister.com>.
127
+ #
128
+ # "The algorithm is described in <em>A Fast Algorithm for Computing
129
+ # Longest Common Subsequences</em>, CACM, vol.20, no.5, pp.350-353, May
130
+ # 1977, with a few minor improvements to improve the speed."
131
+ module LCS
132
+ VERSION = '1.1.3'
133
+ end
134
+ end
135
+
136
+ require 'diff/lcs/callbacks'
137
+
138
+ module Diff::LCS
139
+ # Returns an Array containing the longest common subsequence(s) between
140
+ # +self+ and +other+. See Diff::LCS#LCS.
141
+ #
142
+ # lcs = seq1.lcs(seq2)
143
+ def lcs(other, &block) #:yields self[ii] if there are matched subsequences:
144
+ Diff::LCS.LCS(self, other, &block)
145
+ end
146
+
147
+ # Returns the difference set between +self+ and +other+. See
148
+ # Diff::LCS#diff.
149
+ def diff(other, callbacks = nil, &block)
150
+ Diff::LCS::diff(self, other, callbacks, &block)
151
+ end
152
+
153
+ # Returns the balanced ("side-by-side") difference set between +self+ and
154
+ # +other+. See Diff::LCS#sdiff.
155
+ def sdiff(other, callbacks = nil, &block)
156
+ Diff::LCS::sdiff(self, other, callbacks, &block)
157
+ end
158
+
159
+ # Traverses the discovered longest common subsequences between +self+ and
160
+ # +other+. See Diff::LCS#traverse_sequences.
161
+ def traverse_sequences(other, callbacks = nil, &block)
162
+ traverse_sequences(self, other, callbacks ||
163
+ Diff::LCS::YieldingCallbacks, &block)
164
+ end
165
+
166
+ # Traverses the discovered longest common subsequences between +self+ and
167
+ # +other+ using the alternate, balanced algorithm. See
168
+ # Diff::LCS#traverse_balanced.
169
+ def traverse_balanced(other, callbacks = nil, &block)
170
+ traverse_balanced(self, other, callbacks ||
171
+ Diff::LCS::YieldingCallbacks, &block)
172
+ end
173
+
174
+ # Attempts to patch a copy of +self+ with the provided +patchset+. See
175
+ # Diff::LCS#patch.
176
+ def patch(patchset)
177
+ Diff::LCS::patch(self.dup, patchset)
178
+ end
179
+
180
+ # Attempts to unpatch a copy of +self+ with the provided +patchset+. See
181
+ # Diff::LCS#patch.
182
+ def unpatch(patchset)
183
+ Diff::LCS::unpatch(self.dup, patchset)
184
+ end
185
+
186
+ # Attempts to patch +self+ with the provided +patchset+. See
187
+ # Diff::LCS#patch!. Does no autodiscovery.
188
+ def patch!(patchset)
189
+ Diff::LCS::patch!(self, patchset)
190
+ end
191
+
192
+ # Attempts to unpatch +self+ with the provided +patchset+. See
193
+ # Diff::LCS#unpatch. Does no autodiscovery.
194
+ def unpatch!(patchset)
195
+ Diff::LCS::unpatch!(self, patchset)
196
+ end
197
+ end
198
+
199
+ module Diff::LCS
200
+ class << self
201
+ # Given two sequenced Enumerables, LCS returns an Array containing their
202
+ # longest common subsequences.
203
+ #
204
+ # lcs = Diff::LCS.LCS(seq1, seq2)
205
+ #
206
+ # This array whose contents is such that:
207
+ #
208
+ # lcs.each_with_index do |ee, ii|
209
+ # assert(ee.nil? || (seq1[ii] == seq2[ee]))
210
+ # end
211
+ #
212
+ # If a block is provided, the matching subsequences will be yielded from
213
+ # +seq1+ in turn and may be modified before they are placed into the
214
+ # returned Array of subsequences.
215
+ def LCS(seq1, seq2, &block) #:yields seq1[ii] for each matched:
216
+ matches = Diff::LCS.__lcs(seq1, seq2)
217
+ ret = []
218
+ matches.each_with_index do |ee, ii|
219
+ unless matches[ii].nil?
220
+ if block_given?
221
+ ret << (yield seq1[ii])
222
+ else
223
+ ret << seq1[ii]
224
+ end
225
+ end
226
+ end
227
+ ret
228
+ end
229
+
230
+ # Diff::LCS.diff computes the smallest set of additions and deletions
231
+ # necessary to turn the first sequence into the second, and returns a
232
+ # description of these changes.
233
+ #
234
+ # See Diff::LCS::DiffCallbacks for the default behaviour. An alternate
235
+ # behaviour may be implemented with Diff::LCS::ContextDiffCallbacks. If
236
+ # a Class argument is provided for +callbacks+, #diff will attempt to
237
+ # initialise it. If the +callbacks+ object (possibly initialised)
238
+ # responds to #finish, it will be called.
239
+ def diff(seq1, seq2, callbacks = nil, &block) # :yields diff changes:
240
+ callbacks ||= Diff::LCS::DiffCallbacks
241
+ if callbacks.kind_of?(Class)
242
+ cb = callbacks.new rescue callbacks
243
+ callbacks = cb
244
+ end
245
+ traverse_sequences(seq1, seq2, callbacks)
246
+ callbacks.finish if callbacks.respond_to?(:finish)
247
+
248
+ if block_given?
249
+ res = callbacks.diffs.map do |hunk|
250
+ if hunk.kind_of?(Array)
251
+ hunk = hunk.map { |hunk_block| yield hunk_block }
252
+ else
253
+ yield hunk
254
+ end
255
+ end
256
+ res
257
+ else
258
+ callbacks.diffs
259
+ end
260
+ end
261
+
262
+ # Diff::LCS.sdiff computes all necessary components to show two sequences
263
+ # and their minimized differences side by side, just like the Unix
264
+ # utility <em>sdiff</em> does:
265
+ #
266
+ # old < -
267
+ # same same
268
+ # before | after
269
+ # - > new
270
+ #
271
+ # See Diff::LCS::SDiffCallbacks for the default behaviour. An alternate
272
+ # behaviour may be implemented with Diff::LCS::ContextDiffCallbacks. If
273
+ # a Class argument is provided for +callbacks+, #diff will attempt to
274
+ # initialise it. If the +callbacks+ object (possibly initialised)
275
+ # responds to #finish, it will be called.
276
+ def sdiff(seq1, seq2, callbacks = nil, &block) #:yields diff changes:
277
+ callbacks ||= Diff::LCS::SDiffCallbacks
278
+ if callbacks.kind_of?(Class)
279
+ cb = callbacks.new rescue callbacks
280
+ callbacks = cb
281
+ end
282
+ traverse_balanced(seq1, seq2, callbacks)
283
+ callbacks.finish if callbacks.respond_to?(:finish)
284
+
285
+ if block_given?
286
+ res = callbacks.diffs.map do |hunk|
287
+ if hunk.kind_of?(Array)
288
+ hunk = hunk.map { |hunk_block| yield hunk_block }
289
+ else
290
+ yield hunk
291
+ end
292
+ end
293
+ res
294
+ else
295
+ callbacks.diffs
296
+ end
297
+ end
298
+
299
+ # Diff::LCS.traverse_sequences is the most general facility provided by this
300
+ # module; +diff+ and +LCS+ are implemented as calls to it.
301
+ #
302
+ # The arguments to #traverse_sequences are the two sequences to
303
+ # traverse, and a callback object, like this:
304
+ #
305
+ # traverse_sequences(seq1, seq2, Diff::LCS::ContextDiffCallbacks.new)
306
+ #
307
+ # #diff is implemented with #traverse_sequences.
308
+ #
309
+ # == Callback Methods
310
+ # Optional callback methods are <em>emphasized</em>.
311
+ #
312
+ # callbacks#match:: Called when +a+ and +b+ are pointing
313
+ # to common elements in +A+ and +B+.
314
+ # callbacks#discard_a:: Called when +a+ is pointing to an
315
+ # element not in +B+.
316
+ # callbacks#discard_b:: Called when +b+ is pointing to an
317
+ # element not in +A+.
318
+ # <em>callbacks#finished_a</em>:: Called when +a+ has reached the end of
319
+ # sequence +A+.
320
+ # <em>callbacks#finished_b</em>:: Called when +b+ has reached the end of
321
+ # sequence +B+.
322
+ #
323
+ # == Algorithm
324
+ # a---+
325
+ # v
326
+ # A = a b c e h j l m n p
327
+ # B = b c d e f j k l m r s t
328
+ # ^
329
+ # b---+
330
+ #
331
+ # If there are two arrows (+a+ and +b+) pointing to elements of
332
+ # sequences +A+ and +B+, the arrows will initially point to the first
333
+ # elements of their respective sequences. #traverse_sequences will
334
+ # advance the arrows through the sequences one element at a time,
335
+ # calling a method on the user-specified callback object before each
336
+ # advance. It will advance the arrows in such a way that if there are
337
+ # elements <tt>A[ii]</tt> and <tt>B[jj]</tt> which are both equal and
338
+ # part of the longest common subsequence, there will be some moment
339
+ # during the execution of #traverse_sequences when arrow +a+ is pointing
340
+ # to <tt>A[ii]</tt> and arrow +b+ is pointing to <tt>B[jj]</tt>. When
341
+ # this happens, #traverse_sequences will call <tt>callbacks#match</tt>
342
+ # and then it will advance both arrows.
343
+ #
344
+ # Otherwise, one of the arrows is pointing to an element of its sequence
345
+ # that is not part of the longest common subsequence.
346
+ # #traverse_sequences will advance that arrow and will call
347
+ # <tt>callbacks#discard_a</tt> or <tt>callbacks#discard_b</tt>, depending
348
+ # on which arrow it advanced. If both arrows point to elements that are
349
+ # not part of the longest common subsequence, then #traverse_sequences
350
+ # will advance one of them and call the appropriate callback, but it is
351
+ # not specified which it will call.
352
+ #
353
+ # The methods for <tt>callbacks#match</tt>, <tt>callbacks#discard_a</tt>,
354
+ # and <tt>callbacks#discard_b</tt> are invoked with an event comprising
355
+ # the action ("=", "+", or "-", respectively), the indicies +ii+ and
356
+ # +jj+, and the elements <tt>A[ii]</tt> and <tt>B[jj]</tt>. Return
357
+ # values are discarded by #traverse_sequences.
358
+ #
359
+ # === End of Sequences
360
+ # If arrow +a+ reaches the end of its sequence before arrow +b+ does,
361
+ # #traverse_sequence will try to call <tt>callbacks#finished_a</tt> with
362
+ # the last index and element of +A+ (<tt>A[-1]</tt>) and the current
363
+ # index and element of +B+ (<tt>B[jj]</tt>). If
364
+ # <tt>callbacks#finished_a</tt> does not exist, then
365
+ # <tt>callbacks#discard_b</tt> will be called on each element of +B+
366
+ # until the end of the sequence is reached (the call
367
+ # will be done with <tt>A[-1]</tt> and <tt>B[jj]</tt> for each element).
368
+ #
369
+ # If +b+ reaches the end of +B+ before +a+ reaches the end of +A+,
370
+ # <tt>callbacks#finished_b</tt> will be called with the current index
371
+ # and element of +A+ (<tt>A[ii]</tt>) and the last index and element of
372
+ # +B+ (<tt>A[-1]</tt>). Again, if <tt>callbacks#finished_b</tt> does not
373
+ # exist on the callback object, then <tt>callbacks#discard_a</tt> will
374
+ # be called on each element of +A+ until the end of the sequence is
375
+ # reached (<tt>A[ii]</tt> and <tt>B[-1]</tt>).
376
+ #
377
+ # There is a chance that one additional <tt>callbacks#discard_a</tt> or
378
+ # <tt>callbacks#discard_b</tt> will be called after the end of the
379
+ # sequence is reached, if +a+ has not yet reached the end of +A+ or +b+
380
+ # has not yet reached the end of +B+.
381
+ def traverse_sequences(seq1, seq2, callbacks = Diff::LCS::SequenceCallbacks, &block) #:yields change events:
382
+ matches = Diff::LCS.__lcs(seq1, seq2)
383
+
384
+ run_finished_a = run_finished_b = false
385
+ string = seq1.kind_of?(String)
386
+
387
+ a_size = seq1.size
388
+ b_size = seq2.size
389
+ ai = bj = 0
390
+
391
+ (0 .. matches.size).each do |ii|
392
+ b_line = matches[ii]
393
+
394
+ ax = string ? seq1[ii, 1] : seq1[ii]
395
+ bx = string ? seq2[bj, 1] : seq2[bj]
396
+
397
+ if b_line.nil?
398
+ unless ax.nil?
399
+ event = Diff::LCS::ContextChange.new('-', ii, ax, bj, bx)
400
+ event = yield event if block_given?
401
+ callbacks.discard_a(event)
402
+ end
403
+ else
404
+ loop do
405
+ break unless bj < b_line
406
+ bx = string ? seq2[bj, 1] : seq2[bj]
407
+ event = Diff::LCS::ContextChange.new('+', ii, ax, bj, bx)
408
+ event = yield event if block_given?
409
+ callbacks.discard_b(event)
410
+ bj += 1
411
+ end
412
+ bx = string ? seq2[bj, 1] : seq2[bj]
413
+ event = Diff::LCS::ContextChange.new('=', ii, ax, bj, bx)
414
+ event = yield event if block_given?
415
+ callbacks.match(event)
416
+ bj += 1
417
+ end
418
+ ai = ii
419
+ end
420
+ ai += 1
421
+
422
+ # The last entry (if any) processed was a match. +ai+ and +bj+ point
423
+ # just past the last matching lines in their sequences.
424
+ while (ai < a_size) or (bj < b_size)
425
+ # last A?
426
+ if ai == a_size and bj < b_size
427
+ if callbacks.respond_to?(:finished_a) and not run_finished_a
428
+ ax = string ? seq1[-1, 1] : seq1[-1]
429
+ bx = string ? seq2[bj, 1] : seq2[bj]
430
+ event = Diff::LCS::ContextChange.new('>', (a_size - 1), ax, bj, bx)
431
+ event = yield event if block_given?
432
+ callbacks.finished_a(event)
433
+ run_finished_a = true
434
+ else
435
+ ax = string ? seq1[ai, 1] : seq1[ai]
436
+ loop do
437
+ bx = string ? seq2[bj, 1] : seq2[bj]
438
+ event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx)
439
+ event = yield event if block_given?
440
+ callbacks.discard_b(event)
441
+ bj += 1
442
+ break unless bj < b_size
443
+ end
444
+ end
445
+ end
446
+
447
+ # last B?
448
+ if bj == b_size and ai < a_size
449
+ if callbacks.respond_to?(:finished_b) and not run_finished_b
450
+ ax = string ? seq1[ai, 1] : seq1[ai]
451
+ bx = string ? seq2[-1, 1] : seq2[-1]
452
+ event = Diff::LCS::ContextChange.new('<', ai, ax, (b_size - 1), bx)
453
+ event = yield event if block_given?
454
+ callbacks.finished_b(event)
455
+ run_finished_b = true
456
+ else
457
+ bx = string ? seq2[bj, 1] : seq2[bj]
458
+ loop do
459
+ ax = string ? seq1[ai, 1] : seq1[ai]
460
+ event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx)
461
+ event = yield event if block_given?
462
+ callbacks.discard_a(event)
463
+ ai += 1
464
+ break unless bj < b_size
465
+ end
466
+ end
467
+ end
468
+
469
+ if ai < a_size
470
+ ax = string ? seq1[ai, 1] : seq1[ai]
471
+ bx = string ? seq2[bj, 1] : seq2[bj]
472
+ event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx)
473
+ event = yield event if block_given?
474
+ callbacks.discard_a(event)
475
+ ai += 1
476
+ end
477
+
478
+ if bj < b_size
479
+ ax = string ? seq1[ai, 1] : seq1[ai]
480
+ bx = string ? seq2[bj, 1] : seq2[bj]
481
+ event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx)
482
+ event = yield event if block_given?
483
+ callbacks.discard_b(event)
484
+ bj += 1
485
+ end
486
+ end
487
+ end
488
+
489
+ # #traverse_balanced is an alternative to #traverse_sequences. It
490
+ # uses a different algorithm to iterate through the entries in the
491
+ # computed longest common subsequence. Instead of viewing the changes as
492
+ # insertions or deletions from one of the sequences, #traverse_balanced
493
+ # will report <em>changes</em> between the sequences. To represent a
494
+ #
495
+ # The arguments to #traverse_balanced are the two sequences to traverse
496
+ # and a callback object, like this:
497
+ #
498
+ # traverse_balanced(seq1, seq2, Diff::LCS::ContextDiffCallbacks.new)
499
+ #
500
+ # #sdiff is implemented with #traverse_balanced.
501
+ #
502
+ # == Callback Methods
503
+ # Optional callback methods are <em>emphasized</em>.
504
+ #
505
+ # callbacks#match:: Called when +a+ and +b+ are pointing
506
+ # to common elements in +A+ and +B+.
507
+ # callbacks#discard_a:: Called when +a+ is pointing to an
508
+ # element not in +B+.
509
+ # callbacks#discard_b:: Called when +b+ is pointing to an
510
+ # element not in +A+.
511
+ # <em>callbacks#change</em>:: Called when +a+ and +b+ are pointing
512
+ # to the same relative position, but
513
+ # <tt>A[a]</tt> and <tt>B[b]</tt> are
514
+ # not the same; a <em>change</em> has
515
+ # occurred.
516
+ #
517
+ # #traverse_balanced might be a bit slower than #traverse_sequences,
518
+ # noticable only while processing huge amounts of data.
519
+ #
520
+ # The +sdiff+ function of this module is implemented as call to
521
+ # #traverse_balanced.
522
+ #
523
+ # == Algorithm
524
+ # a---+
525
+ # v
526
+ # A = a b c e h j l m n p
527
+ # B = b c d e f j k l m r s t
528
+ # ^
529
+ # b---+
530
+ #
531
+ # === Matches
532
+ # If there are two arrows (+a+ and +b+) pointing to elements of
533
+ # sequences +A+ and +B+, the arrows will initially point to the first
534
+ # elements of their respective sequences. #traverse_sequences will
535
+ # advance the arrows through the sequences one element at a time,
536
+ # calling a method on the user-specified callback object before each
537
+ # advance. It will advance the arrows in such a way that if there are
538
+ # elements <tt>A[ii]</tt> and <tt>B[jj]</tt> which are both equal and
539
+ # part of the longest common subsequence, there will be some moment
540
+ # during the execution of #traverse_sequences when arrow +a+ is pointing
541
+ # to <tt>A[ii]</tt> and arrow +b+ is pointing to <tt>B[jj]</tt>. When
542
+ # this happens, #traverse_sequences will call <tt>callbacks#match</tt>
543
+ # and then it will advance both arrows.
544
+ #
545
+ # === Discards
546
+ # Otherwise, one of the arrows is pointing to an element of its sequence
547
+ # that is not part of the longest common subsequence.
548
+ # #traverse_sequences will advance that arrow and will call
549
+ # <tt>callbacks#discard_a</tt> or <tt>callbacks#discard_b</tt>,
550
+ # depending on which arrow it advanced.
551
+ #
552
+ # === Changes
553
+ # If both +a+ and +b+ point to elements that are not part of the longest
554
+ # common subsequence, then #traverse_sequences will try to call
555
+ # <tt>callbacks#change</tt> and advance both arrows. If
556
+ # <tt>callbacks#change</tt> is not implemented, then
557
+ # <tt>callbacks#discard_a</tt> and <tt>callbacks#discard_b</tt> will be
558
+ # called in turn.
559
+ #
560
+ # The methods for <tt>callbacks#match</tt>, <tt>callbacks#discard_a</tt>,
561
+ # <tt>callbacks#discard_b</tt>, and <tt>callbacks#change</tt> are
562
+ # invoked with an event comprising the action ("=", "+", "-", or "!",
563
+ # respectively), the indicies +ii+ and +jj+, and the elements
564
+ # <tt>A[ii]</tt> and <tt>B[jj]</tt>. Return values are discarded by
565
+ # #traverse_balanced.
566
+ #
567
+ # === Context
568
+ # Note that +ii+ and +jj+ may not be the same index position, even if
569
+ # +a+ and +b+ are considered to be pointing to matching or changed
570
+ # elements.
571
+ def traverse_balanced(seq1, seq2, callbacks = Diff::LCS::BalancedCallbacks)
572
+ matches = Diff::LCS.__lcs(seq1, seq2)
573
+ a_size = seq1.size
574
+ b_size = seq2.size
575
+ ai = bj = mb = 0
576
+ ma = -1
577
+ string = seq1.kind_of?(String)
578
+
579
+ # Process all the lines in the match vector.
580
+ loop do
581
+ # Find next match indices +ma+ and +mb+
582
+ loop do
583
+ ma += 1
584
+ break unless ma < matches.size and matches[ma].nil?
585
+ end
586
+
587
+ break if ma >= matches.size # end of matches?
588
+ mb = matches[ma]
589
+
590
+ # Change(seq2)
591
+ while (ai < ma) or (bj < mb)
592
+ ax = string ? seq1[ai, 1] : seq1[ai]
593
+ bx = string ? seq2[bj, 1] : seq2[bj]
594
+
595
+ case [(ai < ma), (bj < mb)]
596
+ when [true, true]
597
+ if callbacks.respond_to?(:change)
598
+ event = Diff::LCS::ContextChange.new('!', ai, ax, bj, bx)
599
+ event = yield event if block_given?
600
+ callbacks.change(event)
601
+ ai += 1
602
+ bj += 1
603
+ else
604
+ event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx)
605
+ event = yield event if block_given?
606
+ callbacks.discard_a(event)
607
+ ai += 1
608
+ ax = string ? seq1[ai, 1] : seq1[ai]
609
+ event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx)
610
+ event = yield event if block_given?
611
+ callbacks.discard_b(event)
612
+ bj += 1
613
+ end
614
+ when [true, false]
615
+ event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx)
616
+ event = yield event if block_given?
617
+ callbacks.discard_a(event)
618
+ ai += 1
619
+ when [false, true]
620
+ event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx)
621
+ event = yield event if block_given?
622
+ callbacks.discard_b(event)
623
+ bj += 1
624
+ end
625
+ end
626
+
627
+ # Match
628
+ ax = string ? seq1[ai, 1] : seq1[ai]
629
+ bx = string ? seq2[bj, 1] : seq2[bj]
630
+ event = Diff::LCS::ContextChange.new('=', ai, ax, bj, bx)
631
+ event = yield event if block_given?
632
+ callbacks.match(event)
633
+ ai += 1
634
+ bj += 1
635
+ end
636
+
637
+ while (ai < a_size) or (bj < b_size)
638
+ ax = string ? seq1[ai, 1] : seq1[ai]
639
+ bx = string ? seq2[bj, 1] : seq2[bj]
640
+
641
+ case [(ai < a_size), (bj < b_size)]
642
+ when [true, true]
643
+ if callbacks.respond_to?(:change)
644
+ event = Diff::LCS::ContextChange.new('!', ai, ax, bj, bx)
645
+ event = yield event if block_given?
646
+ callbacks.change(event)
647
+ ai += 1
648
+ bj += 1
649
+ else
650
+ event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx)
651
+ event = yield event if block_given?
652
+ callbacks.discard_a(event)
653
+ ai += 1
654
+ ax = string ? seq1[ai, 1] : seq1[ai]
655
+ event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx)
656
+ event = yield event if block_given?
657
+ callbacks.discard_b(event)
658
+ bj += 1
659
+ end
660
+ when [true, false]
661
+ event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx)
662
+ event = yield event if block_given?
663
+ callbacks.discard_a(event)
664
+ ai += 1
665
+ when [false, true]
666
+ event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx)
667
+ event = yield event if block_given?
668
+ callbacks.discard_b(event)
669
+ bj += 1
670
+ end
671
+ end
672
+ end
673
+
674
+ PATCH_MAP = { #:nodoc:
675
+ :patch => { '+' => '+', '-' => '-', '!' => '!', '=' => '=' },
676
+ :unpatch => { '+' => '-', '-' => '+', '!' => '!', '=' => '=' }
677
+ }
678
+
679
+ # Given a patchset, convert the current version to the new
680
+ # version. If +direction+ is not specified (must be
681
+ # <tt>:patch</tt> or <tt>:unpatch</tt>), then discovery of the
682
+ # direction of the patch will be attempted.
683
+ def patch(src, patchset, direction = nil)
684
+ string = src.kind_of?(String)
685
+ # Start with a new empty type of the source's class
686
+ res = src.class.new
687
+
688
+ # Normalize the patchset.
689
+ patchset = __normalize_patchset(patchset)
690
+
691
+ direction ||= Diff::LCS.__diff_direction(src, patchset)
692
+ direction ||= :patch
693
+
694
+ ai = bj = 0
695
+
696
+ patchset.each do |change|
697
+ # Both Change and ContextChange support #action
698
+ action = PATCH_MAP[direction][change.action]
699
+
700
+ case change
701
+ when Diff::LCS::ContextChange
702
+ case direction
703
+ when :patch
704
+ el = change.new_element
705
+ op = change.old_position
706
+ np = change.new_position
707
+ when :unpatch
708
+ el = change.old_element
709
+ op = change.new_position
710
+ np = change.old_position
711
+ end
712
+
713
+ case action
714
+ when '-' # Remove details from the old string
715
+ while ai < op
716
+ res << (string ? src[ai, 1] : src[ai])
717
+ ai += 1
718
+ bj += 1
719
+ end
720
+ ai += 1
721
+ when '+'
722
+ while bj < np
723
+ res << (string ? src[ai, 1] : src[ai])
724
+ ai += 1
725
+ bj += 1
726
+ end
727
+
728
+ res << el
729
+ bj += 1
730
+ when '='
731
+ # This only appears in sdiff output with the SDiff callback.
732
+ # Therefore, we only need to worry about dealing with a single
733
+ # element.
734
+ res << el
735
+
736
+ ai += 1
737
+ bj += 1
738
+ when '!'
739
+ while ai < op
740
+ res << (string ? src[ai, 1] : src[ai])
741
+ ai += 1
742
+ bj += 1
743
+ end
744
+
745
+ bj += 1
746
+ ai += 1
747
+
748
+ res << el
749
+ end
750
+ when Diff::LCS::Change
751
+ case action
752
+ when '-'
753
+ while ai < change.position
754
+ res << (string ? src[ai, 1] : src[ai])
755
+ ai += 1
756
+ bj += 1
757
+ end
758
+ ai += 1
759
+ when '+'
760
+ while bj < change.position
761
+ res << (string ? src[ai, 1] : src[ai])
762
+ ai += 1
763
+ bj += 1
764
+ end
765
+
766
+ bj += 1
767
+
768
+ res << change.element
769
+ end
770
+ end
771
+ end
772
+
773
+ while ai < src.size
774
+ res << (string ? src[ai, 1] : src[ai])
775
+ ai += 1
776
+ bj += 1
777
+ end
778
+
779
+ res
780
+ end
781
+
782
+ # Given a set of patchset, convert the current version to the prior
783
+ # version. Does no auto-discovery.
784
+ def unpatch!(src, patchset)
785
+ Diff::LCS.patch(src, patchset, :unpatch)
786
+ end
787
+
788
+ # Given a set of patchset, convert the current version to the next
789
+ # version. Does no auto-discovery.
790
+ def patch!(src, patchset)
791
+ Diff::LCS.patch(src, patchset, :patch)
792
+ end
793
+
794
+ # private
795
+ # Compute the longest common subsequence between the sequenced
796
+ # Enumerables +a+ and +b+. The result is an array whose contents is such
797
+ # that
798
+ #
799
+ # result = Diff::LCS.__lcs(a, b)
800
+ # result.each_with_index do |e, ii|
801
+ # assert_equal(a[ii], b[e]) unless e.nil?
802
+ # end
803
+ #
804
+ # Note: This will be deprecated as a public function in a future release.
805
+ def __lcs(a, b)
806
+ a_start = b_start = 0
807
+ a_finish = a.size - 1
808
+ b_finish = b.size - 1
809
+ vector = []
810
+
811
+ # Prune off any common elements at the beginning...
812
+ while (a_start <= a_finish) and
813
+ (b_start <= b_finish) and
814
+ (a[a_start] == b[b_start])
815
+ vector[a_start] = b_start
816
+ a_start += 1
817
+ b_start += 1
818
+ end
819
+
820
+ # Now the end...
821
+ while (a_start <= a_finish) and
822
+ (b_start <= b_finish) and
823
+ (a[a_finish] == b[b_finish])
824
+ vector[a_finish] = b_finish
825
+ a_finish -= 1
826
+ b_finish -= 1
827
+ end
828
+
829
+ # Now, compute the equivalence classes of positions of elements.
830
+ b_matches = Diff::LCS.__position_hash(b, b_start .. b_finish)
831
+
832
+ thresh = []
833
+ links = []
834
+
835
+ (a_start .. a_finish).each do |ii|
836
+ ai = a.kind_of?(String) ? a[ii, 1] : a[ii]
837
+ bm = b_matches[ai]
838
+ kk = nil
839
+ bm.reverse_each do |jj|
840
+ if kk and (thresh[kk] > jj) and (thresh[kk - 1] < jj)
841
+ thresh[kk] = jj
842
+ else
843
+ kk = Diff::LCS.__replace_next_larger(thresh, jj, kk)
844
+ end
845
+ links[kk] = [ (kk > 0) ? links[kk - 1] : nil, ii, jj ] unless kk.nil?
846
+ end
847
+ end
848
+
849
+ unless thresh.empty?
850
+ link = links[thresh.size - 1]
851
+ while not link.nil?
852
+ vector[link[1]] = link[2]
853
+ link = link[0]
854
+ end
855
+ end
856
+
857
+ vector
858
+ end
859
+
860
+ # Find the place at which +value+ would normally be inserted into the
861
+ # Enumerable. If that place is already occupied by +value+, do nothing
862
+ # and return +nil+. If the place does not exist (i.e., it is off the end
863
+ # of the Enumerable), add it to the end. Otherwise, replace the element
864
+ # at that point with +value+. It is assumed that the Enumerable's values
865
+ # are numeric.
866
+ #
867
+ # This operation preserves the sort order.
868
+ #
869
+ # Note: This will be deprecated as a public function in a future release.
870
+ def __replace_next_larger(enum, value, last_index = nil)
871
+ # Off the end?
872
+ if enum.empty? or (value > enum[-1])
873
+ enum << value
874
+ return enum.size - 1
875
+ end
876
+
877
+ # Binary search for the insertion point
878
+ last_index ||= enum.size
879
+ first_index = 0
880
+ while (first_index <= last_index)
881
+ ii = (first_index + last_index) >> 1
882
+
883
+ found = enum[ii]
884
+
885
+ if value == found
886
+ return nil
887
+ elsif value > found
888
+ first_index = ii + 1
889
+ else
890
+ last_index = ii - 1
891
+ end
892
+ end
893
+
894
+ # The insertion point is in first_index; overwrite the next larger
895
+ # value.
896
+ enum[first_index] = value
897
+ return first_index
898
+ end
899
+
900
+ # If +vector+ maps the matching elements of another collection onto this
901
+ # Enumerable, compute the inverse +vector+ that maps this Enumerable
902
+ # onto the collection. (Currently unused.)
903
+ #
904
+ # Note: This will be deprecated as a public function in a future release.
905
+ def __inverse_vector(a, vector)
906
+ inverse = a.dup
907
+ (0 ... vector.size).each do |ii|
908
+ inverse[vector[ii]] = ii unless vector[ii].nil?
909
+ end
910
+ inverse
911
+ end
912
+
913
+ # Returns a hash mapping each element of an Enumerable to the set of
914
+ # positions it occupies in the Enumerable, optionally restricted to the
915
+ # elements specified in the range of indexes specified by +interval+.
916
+ #
917
+ # Note: This will be deprecated as a public function in a future release.
918
+ def __position_hash(enum, interval = 0 .. -1)
919
+ hash = Hash.new { |hh, kk| hh[kk] = [] }
920
+ interval.each do |ii|
921
+ kk = enum.kind_of?(String) ? enum[ii, 1] : enum[ii]
922
+ hash[kk] << ii
923
+ end
924
+ hash
925
+ end
926
+
927
+ # Examine the patchset and the source to see in which direction the
928
+ # patch should be applied.
929
+ #
930
+ # WARNING: By default, this examines the whole patch, so this could take
931
+ # some time. This also works better with Diff::LCS::ContextChange or
932
+ # Diff::LCS::Change as its source, as an array will cause the creation
933
+ # of one of the above.
934
+ #
935
+ # Note: This will be deprecated as a public function in a future release.
936
+ def __diff_direction(src, patchset, limit = nil)
937
+ count = left = left_miss = right = right_miss = 0
938
+ string = src.kind_of?(String)
939
+
940
+ patchset.each do |change|
941
+ count += 1
942
+
943
+ case change
944
+ when Diff::LCS::Change
945
+ # With a simplistic change, we can't tell the difference between
946
+ # the left and right on '!' actions, so we ignore those. On '='
947
+ # actions, if there's a miss, we miss both left and right.
948
+ element = string ? src[change.position, 1] : src[change.position]
949
+
950
+ case change.action
951
+ when '-'
952
+ if element == change.element
953
+ left += 1
954
+ else
955
+ left_miss += 1
956
+ end
957
+ when '+'
958
+ if element == change.element
959
+ right += 1
960
+ else
961
+ right_miss += 1
962
+ end
963
+ when '='
964
+ if element != change.element
965
+ left_miss += 1
966
+ right_miss += 1
967
+ end
968
+ end
969
+ when Diff::LCS::ContextChange
970
+ case change.action
971
+ when '-' # Remove details from the old string
972
+ element = string ? src[change.old_position, 1] : src[change.old_position]
973
+ if element == change.old_element
974
+ left += 1
975
+ else
976
+ left_miss += 1
977
+ end
978
+ when '+'
979
+ element = string ? src[change.new_position, 1] : src[change.new_position]
980
+ if element == change.new_element
981
+ right += 1
982
+ else
983
+ right_miss += 1
984
+ end
985
+ when '='
986
+ le = string ? src[change.old_position, 1] : src[change.old_position]
987
+ re = string ? src[change.new_position, 1] : src[change.new_position]
988
+
989
+ left_miss += 1 if le != change.old_element
990
+ right_miss += 1 if re != change.new_element
991
+ when '!'
992
+ element = string ? src[change.old_position, 1] : src[change.old_position]
993
+ if element == change.old_element
994
+ left += 1
995
+ else
996
+ element = string ? src[change.new_position, 1] : src[change.new_position]
997
+ if element == change.new_element
998
+ right += 1
999
+ else
1000
+ left_miss += 1
1001
+ right_miss += 1
1002
+ end
1003
+ end
1004
+ end
1005
+ end
1006
+
1007
+ break if (not limit.nil?) && (count > limit)
1008
+ end
1009
+
1010
+ no_left = (left == 0) and (left_miss >= 0)
1011
+ no_right = (right == 0) and (right_miss >= 0)
1012
+
1013
+ case [no_left, no_right]
1014
+ when [false, true]
1015
+ return :patch
1016
+ when [true, false]
1017
+ return :unpatch
1018
+ else
1019
+ raise "The provided patchset does not appear to apply to the provided value as either source or destination value."
1020
+ end
1021
+ end
1022
+
1023
+ # Normalize the patchset. A patchset is always a sequence of changes, but
1024
+ # how those changes are represented may vary, depending on how they were
1025
+ # generated. In all cases we support, we also support the array
1026
+ # representation of the changes. The formats are:
1027
+ #
1028
+ # [ # patchset <- Diff::LCS.diff(a, b)
1029
+ # [ # one or more hunks
1030
+ # Diff::LCS::Change # one or more changes
1031
+ # ] ]
1032
+ #
1033
+ # [ # patchset, equivalent to the above
1034
+ # [ # one or more hunks
1035
+ # [ action, line, value ] # one or more changes
1036
+ # ] ]
1037
+ #
1038
+ # [ # patchset <- Diff::LCS.diff(a, b, Diff::LCS::ContextDiffCallbacks)
1039
+ # # OR <- Diff::LCS.sdiff(a, b, Diff::LCS::ContextDiffCallbacks)
1040
+ # [ # one or more hunks
1041
+ # Diff::LCS::ContextChange # one or more changes
1042
+ # ] ]
1043
+ #
1044
+ # [ # patchset, equivalent to the above
1045
+ # [ # one or more hunks
1046
+ # [ action, [ old line, old value ], [ new line, new value ] ]
1047
+ # # one or more changes
1048
+ # ] ]
1049
+ #
1050
+ # [ # patchset <- Diff::LCS.sdiff(a, b)
1051
+ # # OR <- Diff::LCS.diff(a, b, Diff::LCS::SDiffCallbacks)
1052
+ # Diff::LCS::ContextChange # one or more changes
1053
+ # ]
1054
+ #
1055
+ # [ # patchset, equivalent to the above
1056
+ # [ action, [ old line, old value ], [ new line, new value ] ]
1057
+ # # one or more changes
1058
+ # ]
1059
+ #
1060
+ # The result of this will be either of the following.
1061
+ #
1062
+ # [ # patchset
1063
+ # Diff::LCS::ContextChange # one or more changes
1064
+ # ]
1065
+ #
1066
+ # [ # patchset
1067
+ # Diff::LCS::Change # one or more changes
1068
+ # ]
1069
+ #
1070
+ # If either of the above is provided, it will be returned as such.
1071
+ #
1072
+ # Note: This will be deprecated as a public function in a future release.
1073
+ def __normalize_patchset(patchset)
1074
+ patchset.map do |hunk|
1075
+ case hunk
1076
+ when Diff::LCS::ContextChange, Diff::LCS::Change
1077
+ hunk
1078
+ when Array
1079
+ if (not hunk[0].kind_of?(Array)) and hunk[1].kind_of?(Array) and hunk[2].kind_of?(Array)
1080
+ Diff::LCS::ContextChange.from_a(hunk)
1081
+ else
1082
+ hunk.map do |change|
1083
+ case change
1084
+ when Diff::LCS::ContextChange, Diff::LCS::Change
1085
+ change
1086
+ when Array
1087
+ # change[1] will ONLY be an array in a ContextChange#to_a call.
1088
+ # In Change#to_a, it represents the line (singular).
1089
+ if change[1].kind_of?(Array)
1090
+ Diff::LCS::ContextChange.from_a(change)
1091
+ else
1092
+ Diff::LCS::Change.from_a(change)
1093
+ end
1094
+ end
1095
+ end
1096
+ end
1097
+ else
1098
+ raise ArgumentError, "Cannot normalise a hunk of class #{hunk.class}."
1099
+ end
1100
+ end.flatten
1101
+ end
1102
+ end
1103
+ end
1104
+
1105
+ # vim: ft=ruby