chess_engine 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 (292) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +5 -0
  3. data/Gemfile.lock +21 -0
  4. data/README.md +26 -0
  5. data/chess_engine.gemspec +14 -0
  6. data/lib/chess_engine/board.rb +95 -0
  7. data/lib/chess_engine/cli.rb +105 -0
  8. data/lib/chess_engine/game.rb +148 -0
  9. data/lib/chess_engine/input.rb +19 -0
  10. data/lib/chess_engine/move.rb +35 -0
  11. data/lib/chess_engine/piece.rb +97 -0
  12. data/lib/chess_engine/validator.rb +87 -0
  13. data/lib/chess_engine.rb +1 -0
  14. data/spec/board_spec.rb +70 -0
  15. data/spec/game_helper.rb +5 -0
  16. data/spec/game_spec.rb +79 -0
  17. data/spec/spec_helper.rb +100 -0
  18. data/spec/validator_spec.rb +26 -0
  19. data/vendor/bundle/bin/coderay +27 -0
  20. data/vendor/bundle/bin/pry +27 -0
  21. data/vendor/bundle/cache/coderay-1.1.2.gem +0 -0
  22. data/vendor/bundle/cache/colorize-0.8.1.gem +0 -0
  23. data/vendor/bundle/cache/method_source-0.9.2.gem +0 -0
  24. data/vendor/bundle/cache/pry-0.12.2.gem +0 -0
  25. data/vendor/bundle/cache/rb-readline-0.5.5.gem +0 -0
  26. data/vendor/bundle/gems/coderay-1.1.2/MIT-LICENSE +22 -0
  27. data/vendor/bundle/gems/coderay-1.1.2/README_INDEX.rdoc +123 -0
  28. data/vendor/bundle/gems/coderay-1.1.2/bin/coderay +215 -0
  29. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/duo.rb +81 -0
  30. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/_map.rb +17 -0
  31. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/comment_filter.rb +25 -0
  32. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/count.rb +39 -0
  33. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/debug.rb +49 -0
  34. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/debug_lint.rb +63 -0
  35. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/div.rb +23 -0
  36. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/encoder.rb +190 -0
  37. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/filter.rb +58 -0
  38. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html/css.rb +65 -0
  39. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html/numbering.rb +108 -0
  40. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html/output.rb +166 -0
  41. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html.rb +333 -0
  42. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/json.rb +83 -0
  43. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/lines_of_code.rb +45 -0
  44. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/lint.rb +59 -0
  45. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/null.rb +18 -0
  46. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/page.rb +24 -0
  47. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/span.rb +23 -0
  48. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/statistic.rb +95 -0
  49. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/terminal.rb +195 -0
  50. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/text.rb +46 -0
  51. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/token_kind_filter.rb +111 -0
  52. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/xml.rb +72 -0
  53. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/yaml.rb +50 -0
  54. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders.rb +18 -0
  55. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/for_redcloth.rb +95 -0
  56. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/file_type.rb +151 -0
  57. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/plugin.rb +55 -0
  58. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/plugin_host.rb +221 -0
  59. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/word_list.rb +72 -0
  60. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/_map.rb +24 -0
  61. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/c.rb +189 -0
  62. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/clojure.rb +217 -0
  63. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/cpp.rb +217 -0
  64. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/css.rb +196 -0
  65. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/debug.rb +75 -0
  66. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/delphi.rb +144 -0
  67. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/diff.rb +221 -0
  68. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/erb.rb +81 -0
  69. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/go.rb +208 -0
  70. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/groovy.rb +268 -0
  71. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/haml.rb +168 -0
  72. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/html.rb +275 -0
  73. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/java/builtin_types.rb +421 -0
  74. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/java.rb +174 -0
  75. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/java_script.rb +237 -0
  76. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/json.rb +98 -0
  77. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/lua.rb +280 -0
  78. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/php.rb +527 -0
  79. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/python.rb +287 -0
  80. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/raydebug.rb +75 -0
  81. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/ruby/patterns.rb +178 -0
  82. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/ruby/string_state.rb +79 -0
  83. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/ruby.rb +477 -0
  84. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/sass.rb +232 -0
  85. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/scanner.rb +337 -0
  86. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/sql.rb +169 -0
  87. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/taskpaper.rb +36 -0
  88. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/text.rb +26 -0
  89. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/xml.rb +17 -0
  90. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/yaml.rb +140 -0
  91. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners.rb +27 -0
  92. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles/_map.rb +7 -0
  93. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles/alpha.rb +153 -0
  94. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles/style.rb +18 -0
  95. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles.rb +15 -0
  96. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/token_kinds.rb +85 -0
  97. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/tokens.rb +161 -0
  98. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/tokens_proxy.rb +55 -0
  99. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/version.rb +3 -0
  100. data/vendor/bundle/gems/coderay-1.1.2/lib/coderay.rb +284 -0
  101. data/vendor/bundle/gems/colorize-0.8.1/CHANGELOG +65 -0
  102. data/vendor/bundle/gems/colorize-0.8.1/LICENSE +339 -0
  103. data/vendor/bundle/gems/colorize-0.8.1/README.md +105 -0
  104. data/vendor/bundle/gems/colorize-0.8.1/Rakefile +13 -0
  105. data/vendor/bundle/gems/colorize-0.8.1/colorize.gemspec +36 -0
  106. data/vendor/bundle/gems/colorize-0.8.1/lib/colorize/class_methods.rb +120 -0
  107. data/vendor/bundle/gems/colorize-0.8.1/lib/colorize/instance_methods.rb +132 -0
  108. data/vendor/bundle/gems/colorize-0.8.1/lib/colorize.rb +12 -0
  109. data/vendor/bundle/gems/colorize-0.8.1/lib/colorized_string.rb +19 -0
  110. data/vendor/bundle/gems/colorize-0.8.1/test/test_colorize.rb +164 -0
  111. data/vendor/bundle/gems/method_source-0.9.2/Gemfile +2 -0
  112. data/vendor/bundle/gems/method_source-0.9.2/LICENSE +25 -0
  113. data/vendor/bundle/gems/method_source-0.9.2/README.markdown +91 -0
  114. data/vendor/bundle/gems/method_source-0.9.2/Rakefile +81 -0
  115. data/vendor/bundle/gems/method_source-0.9.2/lib/method_source/code_helpers.rb +154 -0
  116. data/vendor/bundle/gems/method_source-0.9.2/lib/method_source/source_location.rb +138 -0
  117. data/vendor/bundle/gems/method_source-0.9.2/lib/method_source/version.rb +3 -0
  118. data/vendor/bundle/gems/method_source-0.9.2/lib/method_source.rb +141 -0
  119. data/vendor/bundle/gems/method_source-0.9.2/method_source.gemspec +35 -0
  120. data/vendor/bundle/gems/method_source-0.9.2/spec/method_source/code_helpers_spec.rb +43 -0
  121. data/vendor/bundle/gems/method_source-0.9.2/spec/method_source_spec.rb +143 -0
  122. data/vendor/bundle/gems/method_source-0.9.2/spec/spec_helper.rb +101 -0
  123. data/vendor/bundle/gems/pry-0.12.2/CHANGELOG.md +953 -0
  124. data/vendor/bundle/gems/pry-0.12.2/LICENSE +25 -0
  125. data/vendor/bundle/gems/pry-0.12.2/README.md +390 -0
  126. data/vendor/bundle/gems/pry-0.12.2/bin/pry +8 -0
  127. data/vendor/bundle/gems/pry-0.12.2/lib/pry/basic_object.rb +6 -0
  128. data/vendor/bundle/gems/pry-0.12.2/lib/pry/cli.rb +218 -0
  129. data/vendor/bundle/gems/pry-0.12.2/lib/pry/code/code_file.rb +110 -0
  130. data/vendor/bundle/gems/pry-0.12.2/lib/pry/code/code_range.rb +71 -0
  131. data/vendor/bundle/gems/pry-0.12.2/lib/pry/code/loc.rb +98 -0
  132. data/vendor/bundle/gems/pry-0.12.2/lib/pry/code.rb +353 -0
  133. data/vendor/bundle/gems/pry-0.12.2/lib/pry/code_object.rb +195 -0
  134. data/vendor/bundle/gems/pry-0.12.2/lib/pry/color_printer.rb +65 -0
  135. data/vendor/bundle/gems/pry-0.12.2/lib/pry/command.rb +723 -0
  136. data/vendor/bundle/gems/pry-0.12.2/lib/pry/command_set.rb +415 -0
  137. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/amend_line.rb +98 -0
  138. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/bang.rb +20 -0
  139. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/bang_pry.rb +17 -0
  140. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/abstract_formatter.rb +27 -0
  141. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/exception_formatter.rb +79 -0
  142. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/file_formatter.rb +71 -0
  143. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/input_expression_formatter.rb +43 -0
  144. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat.rb +63 -0
  145. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cd.rb +41 -0
  146. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/change_inspector.rb +27 -0
  147. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/change_prompt.rb +46 -0
  148. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/clear_screen.rb +14 -0
  149. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/code_collector.rb +167 -0
  150. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/disable_pry.rb +27 -0
  151. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/disabled_commands.rb +2 -0
  152. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/easter_eggs.rb +112 -0
  153. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/edit/exception_patcher.rb +25 -0
  154. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/edit/file_and_line_locator.rb +36 -0
  155. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/edit.rb +200 -0
  156. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/exit.rb +43 -0
  157. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/exit_all.rb +29 -0
  158. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/exit_program.rb +23 -0
  159. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/find_method.rb +191 -0
  160. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/fix_indent.rb +19 -0
  161. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_cd.rb +26 -0
  162. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_install.rb +32 -0
  163. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_list.rb +33 -0
  164. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_open.rb +29 -0
  165. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_readme.rb +25 -0
  166. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_search.rb +40 -0
  167. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_stats.rb +83 -0
  168. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gist.rb +102 -0
  169. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/help.rb +164 -0
  170. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/hist.rb +181 -0
  171. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/import_set.rb +23 -0
  172. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/install_command.rb +54 -0
  173. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/jump_to.rb +29 -0
  174. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb +35 -0
  175. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/constants.rb +58 -0
  176. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/formatter.rb +51 -0
  177. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/globals.rb +46 -0
  178. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/grep.rb +19 -0
  179. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/instance_vars.rb +38 -0
  180. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/interrogatable.rb +18 -0
  181. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/jruby_hacks.rb +49 -0
  182. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/local_names.rb +33 -0
  183. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/local_vars.rb +37 -0
  184. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/ls_entity.rb +69 -0
  185. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/methods.rb +54 -0
  186. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/methods_helper.rb +46 -0
  187. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/self_methods.rb +33 -0
  188. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls.rb +113 -0
  189. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/nesting.rb +25 -0
  190. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/play.rb +102 -0
  191. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/pry_backtrace.rb +25 -0
  192. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/pry_version.rb +17 -0
  193. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/raise_up.rb +33 -0
  194. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/reload_code.rb +62 -0
  195. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/reset.rb +18 -0
  196. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ri.rb +65 -0
  197. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/save_file.rb +61 -0
  198. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/shell_command.rb +75 -0
  199. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/shell_mode.rb +25 -0
  200. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_doc.rb +81 -0
  201. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_info.rb +216 -0
  202. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_input.rb +17 -0
  203. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_source.rb +53 -0
  204. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/stat.rb +40 -0
  205. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/switch_to.rb +23 -0
  206. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/toggle_color.rb +24 -0
  207. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/watch_expression/expression.rb +38 -0
  208. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/watch_expression.rb +107 -0
  209. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/whereami.rb +197 -0
  210. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/wtf.rb +70 -0
  211. data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands.rb +6 -0
  212. data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/behavior.rb +255 -0
  213. data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/convenience.rb +28 -0
  214. data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/default.rb +159 -0
  215. data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/memoization.rb +48 -0
  216. data/vendor/bundle/gems/pry-0.12.2/lib/pry/config.rb +35 -0
  217. data/vendor/bundle/gems/pry-0.12.2/lib/pry/core_extensions.rb +142 -0
  218. data/vendor/bundle/gems/pry-0.12.2/lib/pry/editor.rb +128 -0
  219. data/vendor/bundle/gems/pry-0.12.2/lib/pry/exceptions.rb +76 -0
  220. data/vendor/bundle/gems/pry-0.12.2/lib/pry/forwardable.rb +23 -0
  221. data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/base_helpers.rb +200 -0
  222. data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/command_helpers.rb +157 -0
  223. data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/documentation_helpers.rb +76 -0
  224. data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/options_helpers.rb +27 -0
  225. data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/platform.rb +58 -0
  226. data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/table.rb +114 -0
  227. data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/text.rb +115 -0
  228. data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers.rb +6 -0
  229. data/vendor/bundle/gems/pry-0.12.2/lib/pry/history.rb +161 -0
  230. data/vendor/bundle/gems/pry-0.12.2/lib/pry/hooks.rb +171 -0
  231. data/vendor/bundle/gems/pry-0.12.2/lib/pry/indent.rb +408 -0
  232. data/vendor/bundle/gems/pry-0.12.2/lib/pry/input_completer.rb +265 -0
  233. data/vendor/bundle/gems/pry-0.12.2/lib/pry/input_lock.rb +130 -0
  234. data/vendor/bundle/gems/pry-0.12.2/lib/pry/inspector.rb +27 -0
  235. data/vendor/bundle/gems/pry-0.12.2/lib/pry/last_exception.rb +61 -0
  236. data/vendor/bundle/gems/pry-0.12.2/lib/pry/method/disowned.rb +55 -0
  237. data/vendor/bundle/gems/pry-0.12.2/lib/pry/method/patcher.rb +122 -0
  238. data/vendor/bundle/gems/pry-0.12.2/lib/pry/method/weird_method_locator.rb +198 -0
  239. data/vendor/bundle/gems/pry-0.12.2/lib/pry/method.rb +552 -0
  240. data/vendor/bundle/gems/pry-0.12.2/lib/pry/object_path.rb +83 -0
  241. data/vendor/bundle/gems/pry-0.12.2/lib/pry/output.rb +50 -0
  242. data/vendor/bundle/gems/pry-0.12.2/lib/pry/pager.rb +250 -0
  243. data/vendor/bundle/gems/pry-0.12.2/lib/pry/platform.rb +91 -0
  244. data/vendor/bundle/gems/pry-0.12.2/lib/pry/plugins.rb +122 -0
  245. data/vendor/bundle/gems/pry-0.12.2/lib/pry/prompt.rb +145 -0
  246. data/vendor/bundle/gems/pry-0.12.2/lib/pry/pry_class.rb +425 -0
  247. data/vendor/bundle/gems/pry-0.12.2/lib/pry/pry_instance.rb +699 -0
  248. data/vendor/bundle/gems/pry-0.12.2/lib/pry/repl.rb +261 -0
  249. data/vendor/bundle/gems/pry-0.12.2/lib/pry/repl_file_loader.rb +73 -0
  250. data/vendor/bundle/gems/pry-0.12.2/lib/pry/ring.rb +84 -0
  251. data/vendor/bundle/gems/pry-0.12.2/lib/pry/rubygem.rb +84 -0
  252. data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop/LICENSE +20 -0
  253. data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop/commands.rb +195 -0
  254. data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop/option.rb +206 -0
  255. data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop.rb +661 -0
  256. data/vendor/bundle/gems/pry-0.12.2/lib/pry/terminal.rb +91 -0
  257. data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/evalable.rb +15 -0
  258. data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/mockable.rb +14 -0
  259. data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/pry_tester.rb +73 -0
  260. data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/utility.rb +26 -0
  261. data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/variables.rb +46 -0
  262. data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable.rb +70 -0
  263. data/vendor/bundle/gems/pry-0.12.2/lib/pry/version.rb +3 -0
  264. data/vendor/bundle/gems/pry-0.12.2/lib/pry/wrapped_module/candidate.rb +131 -0
  265. data/vendor/bundle/gems/pry-0.12.2/lib/pry/wrapped_module.rb +378 -0
  266. data/vendor/bundle/gems/pry-0.12.2/lib/pry.rb +132 -0
  267. data/vendor/bundle/gems/rb-readline-0.5.5/CHANGES +94 -0
  268. data/vendor/bundle/gems/rb-readline-0.5.5/LICENSE +25 -0
  269. data/vendor/bundle/gems/rb-readline-0.5.5/README.md +81 -0
  270. data/vendor/bundle/gems/rb-readline-0.5.5/Rakefile +25 -0
  271. data/vendor/bundle/gems/rb-readline-0.5.5/bench/_rl_adjust_point.rb +26 -0
  272. data/vendor/bundle/gems/rb-readline-0.5.5/examples/example_readline.rb +8 -0
  273. data/vendor/bundle/gems/rb-readline-0.5.5/examples/example_readline_with_completion.rb +18 -0
  274. data/vendor/bundle/gems/rb-readline-0.5.5/examples/tinyirb.rb +11 -0
  275. data/vendor/bundle/gems/rb-readline-0.5.5/lib/rb-readline.rb +18 -0
  276. data/vendor/bundle/gems/rb-readline-0.5.5/lib/rbreadline/version.rb +3 -0
  277. data/vendor/bundle/gems/rb-readline-0.5.5/lib/rbreadline.rb +8920 -0
  278. data/vendor/bundle/gems/rb-readline-0.5.5/lib/readline.rb +539 -0
  279. data/vendor/bundle/gems/rb-readline-0.5.5/rb-readline.gemspec +51 -0
  280. data/vendor/bundle/gems/rb-readline-0.5.5/setup.rb +1585 -0
  281. data/vendor/bundle/gems/rb-readline-0.5.5/test/support/filesystem_completion_helper.rb +53 -0
  282. data/vendor/bundle/gems/rb-readline-0.5.5/test/test_completion.rb +100 -0
  283. data/vendor/bundle/gems/rb-readline-0.5.5/test/test_filename_completion_proc.rb +88 -0
  284. data/vendor/bundle/gems/rb-readline-0.5.5/test/test_history.rb +29 -0
  285. data/vendor/bundle/gems/rb-readline-0.5.5/test/test_rbreadline.rb +23 -0
  286. data/vendor/bundle/gems/rb-readline-0.5.5/test/test_readline.rb +221 -0
  287. data/vendor/bundle/specifications/coderay-1.1.2.gemspec +26 -0
  288. data/vendor/bundle/specifications/colorize-0.8.1.gemspec +38 -0
  289. data/vendor/bundle/specifications/method_source-0.9.2.gemspec +35 -0
  290. data/vendor/bundle/specifications/pry-0.12.2.gemspec +38 -0
  291. data/vendor/bundle/specifications/rb-readline-0.5.5.gemspec +39 -0
  292. metadata +363 -0
@@ -0,0 +1,539 @@
1
+ # encoding: US-ASCII
2
+ #
3
+ # readline.rb -- GNU Readline module
4
+ # Copyright (C) 1997-2001 Shugo Maeda
5
+ #
6
+ # Ruby translation by Park Heesob phasis@gmail.com
7
+
8
+ module Readline
9
+
10
+ require 'rbreadline'
11
+ include RbReadline
12
+
13
+ @completion_proc = nil
14
+ @completion_case_fold = false
15
+
16
+ # Begins an interactive terminal process using +prompt+ as the command
17
+ # prompt that users see when they type commands. The method returns the
18
+ # line entered whenever a carriage return is encountered.
19
+ #
20
+ # If an +add_history+ argument is provided, commands entered by users are
21
+ # stored in a history buffer that can be recalled for later use.
22
+ #
23
+ # Note that this method depends on $stdin and $stdout both being open.
24
+ # Because this is meant as an interactive console interface, they should
25
+ # generally not be redirected.
26
+ #
27
+ # If you would like to add non-visible characters to the the prompt (for
28
+ # example to add colors) you must prepend the character \001 (^A) before
29
+ # each sequence of non-visible characters and add the character \002 (^B)
30
+ # after, otherwise line wrapping may not work properly.
31
+ #
32
+ # Example:
33
+ #
34
+ # loop{ Readline.readline('> ') }
35
+ #
36
+ def readline(prompt = "", add_history = nil)
37
+ if $stdin.closed?
38
+ raise IOError, "stdin closed"
39
+ end
40
+
41
+ RbReadline.rl_instream = $stdin
42
+ RbReadline.rl_outstream = $stdout
43
+
44
+ begin
45
+ buff = RbReadline.readline(prompt)
46
+ rescue Exception => e
47
+ buff = nil
48
+ RbReadline.rl_cleanup_after_signal()
49
+ RbReadline.rl_deprep_terminal()
50
+ raise e
51
+ end
52
+
53
+ if add_history && buff
54
+ RbReadline.add_history(buff)
55
+ end
56
+
57
+ return buff ? buff.dup : nil
58
+ end
59
+
60
+ # Sets the input stream (an IO object) for readline interaction. The
61
+ # default is <tt>$stdin</tt>.
62
+ #
63
+ def self.input=(input)
64
+ RbReadline.rl_instream = input
65
+ end
66
+
67
+ # Sets the output stream (an IO object) for readline interaction. The
68
+ # default is <tt>$stdout</tt>.
69
+ #
70
+ def self.output=(output)
71
+ RbReadline.rl_outstream = output
72
+ end
73
+
74
+ # Returns current line buffer
75
+ #
76
+ def self.line_buffer
77
+ RbReadline.rl_line_buffer
78
+ end
79
+
80
+ # Sets the auto-completion procedure (i.e. tab auto-complete).
81
+ #
82
+ # The +proc+ argument is typically a Proc object. It must respond to
83
+ # <tt>.call</tt>, take a single String argument and return an Array of
84
+ # candidates for completion.
85
+ #
86
+ # Example:
87
+ #
88
+ # list = ['search', 'next', 'clear']
89
+ # Readline.completion_proc = proc{ |s| list.grep( /^#{Regexp.escape(s)}/) }
90
+ #
91
+ def self.completion_proc=(proc)
92
+ unless proc.respond_to? :call
93
+ raise ArgumentError,"argument must respond to `call'"
94
+ end
95
+ @completion_proc = proc
96
+ end
97
+
98
+ # Returns the current auto-completion procedure.
99
+ #
100
+ def self.completion_proc()
101
+ @completion_proc
102
+ end
103
+
104
+ # Sets whether or not the completion proc should ignore case sensitivity.
105
+ # The default is false, i.e. completion procs are case sensitive.
106
+ #
107
+ def self.completion_case_fold=(bool)
108
+ @completion_case_fold = bool
109
+ end
110
+
111
+ # Returns whether or not the completion proc is case sensitive. The
112
+ # default is false, i.e. completion procs are case sensitive.
113
+ #
114
+ def self.completion_case_fold()
115
+ @completion_case_fold
116
+ end
117
+
118
+ # Returns nil if no matches are found or an array of strings:
119
+ #
120
+ # [0] is the replacement for text
121
+ # [1..n] the possible matches
122
+ # [n+1] nil
123
+ #
124
+ # The possible matches should not include [0].
125
+ #
126
+ # If this method sets RbReadline.rl_attempted_completion_over to true,
127
+ # then the default completion function will not be called when this
128
+ # function returns nil.
129
+ def self.readline_attempted_completion_function(text,start,_end)
130
+ proc = @completion_proc
131
+ return nil if proc.nil?
132
+
133
+ RbReadline.rl_attempted_completion_over = true
134
+
135
+ case_fold = @completion_case_fold
136
+ ary = proc.call(text)
137
+ if ary.class != Array
138
+ ary = Array(ary)
139
+ else
140
+ ary.compact!
141
+ end
142
+
143
+ matches = ary.length
144
+ return nil if (matches == 0)
145
+ result = Array.new(matches+2)
146
+ for i in 0 ... matches
147
+ result[i+1] = ary[i].dup
148
+ end
149
+ result[matches+1] = nil
150
+
151
+ if(matches==1)
152
+ result[0] = result[1].dup
153
+ result[1] = nil
154
+ else
155
+ i = 1
156
+ low = 100000
157
+
158
+ while (i < matches)
159
+ if (case_fold)
160
+ si = 0
161
+ while ((c1 = result[i][si,1].downcase) &&
162
+ (c2 = result[i + 1][si,1].downcase))
163
+ break if (c1 != c2)
164
+ si += 1
165
+ end
166
+ else
167
+ si = 0
168
+ while ((c1 = result[i][si,1]) &&
169
+ (c2 = result[i + 1][si,1]))
170
+ break if (c1 != c2)
171
+ si += 1
172
+ end
173
+ end
174
+ if (low > si)
175
+ low = si
176
+ end
177
+ i+=1
178
+ end
179
+ result[0] = result[1][0,low]
180
+ end
181
+
182
+ result
183
+ end
184
+
185
+ # Sets vi editing mode.
186
+ #
187
+ def self.vi_editing_mode()
188
+ RbReadline.rl_vi_editing_mode(1,0)
189
+ nil
190
+ end
191
+
192
+ # Sets emacs editing mode
193
+ #
194
+ def self.emacs_editing_mode()
195
+ RbReadline.rl_emacs_editing_mode(1,0)
196
+ nil
197
+ end
198
+
199
+ # Sets the character that is automatically appended after the
200
+ # Readline.completion_proc method is called.
201
+ #
202
+ # If +char+ is nil or empty, then a null character is used.
203
+ #
204
+ def self.completion_append_character=(char)
205
+ if char.nil?
206
+ RbReadline.rl_completion_append_character = ?\0
207
+ elsif char.length==0
208
+ RbReadline.rl_completion_append_character = ?\0
209
+ else
210
+ RbReadline.rl_completion_append_character = char[0].chr
211
+ end
212
+ end
213
+
214
+ # Returns the character that is automatically appended after the
215
+ # Readline.completion_proc method is called.
216
+ #
217
+ def self.completion_append_character()
218
+ if RbReadline.rl_completion_append_character == ?\0
219
+ return nil
220
+ end
221
+ return RbReadline.rl_completion_append_character
222
+ end
223
+
224
+ # Sets the character string that signal a break between words for the
225
+ # completion proc.
226
+ #
227
+ def self.basic_word_break_characters=(str)
228
+ RbReadline.rl_basic_word_break_characters = str.dup
229
+ end
230
+
231
+ # Returns the character string that signal a break between words for the
232
+ # completion proc. The default is " \t\n\"\\'`@$><=|&{(".
233
+ #
234
+ def self.basic_word_break_characters()
235
+ if RbReadline.rl_basic_word_break_characters.nil?
236
+ nil
237
+ else
238
+ RbReadline.rl_basic_word_break_characters.dup
239
+ end
240
+ end
241
+
242
+ # Sets the character string that signal the start or end of a word for
243
+ # the completion proc.
244
+ #
245
+ def self.completer_word_break_characters=(str)
246
+ RbReadline.rl_completer_word_break_characters = str.dup
247
+ end
248
+
249
+ # Returns the character string that signal the start or end of a word for
250
+ # the completion proc.
251
+ #
252
+ def self.completer_word_break_characters()
253
+ if RbReadline.rl_completer_word_break_characters.nil?
254
+ nil
255
+ else
256
+ RbReadline.rl_completer_word_break_characters.dup
257
+ end
258
+ end
259
+
260
+ # Sets the list of quote characters that can cause a word break.
261
+ #
262
+ def self.basic_quote_characters=(str)
263
+ RbReadline.rl_basic_quote_characters = str.dup
264
+ end
265
+
266
+ # Returns the list of quote characters that can cause a word break.
267
+ # The default is "'\"" (single and double quote characters).
268
+ #
269
+ def self.basic_quote_characters()
270
+ if RbReadline.rl_basic_quote_characters.nil?
271
+ nil
272
+ else
273
+ RbReadline.rl_basic_quote_characters.dup
274
+ end
275
+ end
276
+
277
+ # Sets the list of characters that can be used to quote a substring of
278
+ # the line, i.e. a group of characters within quotes.
279
+ #
280
+ def self.completer_quote_characters=(str)
281
+ RbReadline.rl_completer_quote_characters = str.dup
282
+ end
283
+
284
+ # Returns the list of characters that can be used to quote a substring
285
+ # of the line, i.e. a group of characters inside quotes.
286
+ #
287
+ def self.completer_quote_characters()
288
+ if RbReadline.rl_completer_quote_characters.nil?
289
+ nil
290
+ else
291
+ RbReadline.rl_completer_quote_characters.dup
292
+ end
293
+ end
294
+
295
+ # Sets the character string of one or more characters that indicate quotes
296
+ # for the filename completion of user input.
297
+ #
298
+ def self.filename_quote_characters=(str)
299
+ RbReadline.rl_filename_quote_characters = str.dup
300
+ end
301
+
302
+ # Returns the character string used to indicate quotes for the filename
303
+ # completion of user input.
304
+ #
305
+ def self.filename_quote_characters()
306
+ if RbReadline.rl_filename_quote_characters.nil?
307
+ nil
308
+ else
309
+ RbReadline.rl_filename_quote_characters.dup
310
+ end
311
+ end
312
+
313
+ # Returns the current offset in the current input line.
314
+ #
315
+ def self.point()
316
+ RbReadline.rl_point
317
+ end
318
+
319
+ # Temporarily disable warnings and call a block
320
+ #
321
+ def self.silence_warnings(&block)
322
+ warn_level = $VERBOSE
323
+ $VERBOSE = nil
324
+ result = block.call
325
+ $VERBOSE = warn_level
326
+ result
327
+ end
328
+
329
+ # The History class encapsulates a history of all commands entered by
330
+ # users at the prompt, providing an interface for inspection and retrieval
331
+ # of all commands.
332
+ class History
333
+ extend Enumerable
334
+
335
+ # The History class, stringified in all caps.
336
+ #--
337
+ # Why?
338
+ #
339
+ def self.to_s
340
+ "HISTORY"
341
+ end
342
+
343
+ # Returns the command that was entered at the specified +index+
344
+ # in the history buffer.
345
+ #
346
+ # Raises an IndexError if the entry is nil.
347
+ #
348
+ def self.[](index)
349
+ if index < 0
350
+ index += RbReadline.history_length
351
+ end
352
+ entry = RbReadline.history_get(RbReadline.history_base+index)
353
+ if entry.nil?
354
+ raise IndexError,"invalid index"
355
+ end
356
+ entry.line.dup
357
+ end
358
+
359
+ # Sets the command +str+ at the given index in the history buffer.
360
+ #
361
+ # You can only replace an existing entry. Attempting to create a new
362
+ # entry will result in an IndexError.
363
+ #
364
+ def self.[]=(index,str)
365
+ if index<0
366
+ index += RbReadline.history_length
367
+ end
368
+ entry = RbReadline.replace_history_entry(index,str,nil)
369
+ if entry.nil?
370
+ raise IndexError,"invalid index"
371
+ end
372
+ str
373
+ end
374
+
375
+ # Synonym for Readline.add_history.
376
+ #
377
+ def self.<<(str)
378
+ RbReadline.add_history(str)
379
+ end
380
+
381
+ # Pushes a list of +args+ onto the history buffer.
382
+ #
383
+ def self.push(*args)
384
+ args.each do |str|
385
+ RbReadline.add_history(str)
386
+ end
387
+ end
388
+
389
+ # Internal function that removes the item at +index+ from the history
390
+ # buffer, performing necessary duplication in the process.
391
+ #--
392
+ # TODO: mark private?
393
+ #
394
+ def self.rb_remove_history(index)
395
+ entry = RbReadline.remove_history(index)
396
+ if (entry)
397
+ val = entry.line.dup
398
+ entry = nil
399
+ return val
400
+ end
401
+ nil
402
+ end
403
+
404
+ # Removes and returns the last element from the history buffer.
405
+ #
406
+ def self.pop()
407
+ if RbReadline.history_length>0
408
+ rb_remove_history(RbReadline.history_length-1)
409
+ else
410
+ nil
411
+ end
412
+ end
413
+
414
+ # Removes and returns the first element from the history buffer.
415
+ #
416
+ def self.shift()
417
+ if RbReadline.history_length>0
418
+ rb_remove_history(0)
419
+ else
420
+ nil
421
+ end
422
+ end
423
+
424
+ # Iterates over each entry in the history buffer.
425
+ #
426
+ def self.each()
427
+ for i in 0 ... RbReadline.history_length
428
+ entry = RbReadline.history_get(RbReadline.history_base + i)
429
+ break if entry.nil?
430
+ yield entry.line.dup
431
+ end
432
+ self
433
+ end
434
+
435
+ # Returns the length of the history buffer.
436
+ #
437
+ def self.length()
438
+ RbReadline.history_length
439
+ end
440
+
441
+ # Synonym for Readline.length.
442
+ #
443
+ def self.size()
444
+ RbReadline.history_length
445
+ end
446
+
447
+ # Returns a bolean value indicating whether or not the history buffer
448
+ # is empty.
449
+ #
450
+ def self.empty?()
451
+ RbReadline.history_length == 0
452
+ end
453
+
454
+ # Deletes an entry from the histoyr buffer at the specified +index+.
455
+ #
456
+ def self.delete_at(index)
457
+ if index < 0
458
+ i += RbReadline.history_length
459
+ end
460
+ if index < 0 || index > RbReadline.history_length - 1
461
+ raise IndexError, "invalid index"
462
+ end
463
+ rb_remove_history(index)
464
+ end
465
+
466
+ end
467
+
468
+ silence_warnings { HISTORY = History }
469
+
470
+ # The Fcomp class provided to encapsulate typical filename completion
471
+ # procedure. You will not typically use this directly, but will instead
472
+ # use the Readline::FILENAME_COMPLETION_PROC.
473
+ #
474
+ class Fcomp
475
+ def self.call(str)
476
+ matches = RbReadline.rl_completion_matches(str, :rl_filename_completion_function)
477
+ if (matches)
478
+ result = []
479
+ i = 0
480
+ while(matches[i])
481
+ result << matches[i].dup
482
+ matches[i] = nil
483
+ i += 1
484
+ end
485
+ matches = nil
486
+ if (result.length >= 2)
487
+ result.shift
488
+ end
489
+ else
490
+ result = nil
491
+ end
492
+ return result
493
+ end
494
+ end
495
+
496
+ silence_warnings { FILENAME_COMPLETION_PROC = Fcomp }
497
+
498
+ # The Ucomp class provided to encapsulate typical filename completion
499
+ # procedure. You will not typically use this directly, but will instead
500
+ # use the Readline::USERNAME_COMPLETION_PROC.
501
+ #
502
+ # Note that this feature currently only works on Unix systems since it
503
+ # ultimately uses the Etc module to iterate over a list of users.
504
+ #
505
+ class Ucomp
506
+ def self.call(str)
507
+ matches = RbReadline.rl_completion_matches(str, :rl_username_completion_function)
508
+ if (matches)
509
+ result = []
510
+ i = 0
511
+ while(matches[i])
512
+ result << matches[i].dup
513
+ matches[i] = nil
514
+ i += 1
515
+ end
516
+ matches = nil
517
+ if (result.length >= 2)
518
+ result.shift
519
+ end
520
+ else
521
+ result = nil
522
+ end
523
+ return result
524
+ end
525
+ end
526
+
527
+ silence_warnings { USERNAME_COMPLETION_PROC = Ucomp }
528
+
529
+ RbReadline.rl_readline_name = "Ruby"
530
+
531
+ RbReadline.using_history()
532
+
533
+ silence_warnings { VERSION = RbReadline.rl_library_version }
534
+
535
+ module_function :readline
536
+
537
+ RbReadline.rl_attempted_completion_function = :readline_attempted_completion_function
538
+
539
+ end