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,25 @@
1
+ class Pry
2
+ class Command::PryBacktrace < Pry::ClassCommand
3
+ match 'pry-backtrace'
4
+ group 'Context'
5
+ description 'Show the backtrace for the Pry session.'
6
+
7
+ banner <<-BANNER
8
+ Usage: pry-backtrace [OPTIONS] [--help]
9
+
10
+ Show the backtrace for the position in the code where Pry was started. This can
11
+ be used to infer the behavior of the program immediately before it entered Pry,
12
+ just like the backtrace property of an exception.
13
+
14
+ NOTE: if you are looking for the backtrace of the most recent exception raised,
15
+ just type: `_ex_.backtrace` instead.
16
+ See: https://github.com/pry/pry/wiki/Special-Locals
17
+ BANNER
18
+
19
+ def process
20
+ _pry_.pager.page bold('Backtrace:') << "\n--\n" << _pry_.backtrace.join("\n")
21
+ end
22
+ end
23
+
24
+ Pry::Commands.add_command(Pry::Command::PryBacktrace)
25
+ end
@@ -0,0 +1,17 @@
1
+ class Pry
2
+ class Command::Version < Pry::ClassCommand
3
+ match 'pry-version'
4
+ group 'Misc'
5
+ description 'Show Pry version.'
6
+
7
+ banner <<-'BANNER'
8
+ Show Pry version.
9
+ BANNER
10
+
11
+ def process
12
+ output.puts "Pry version: #{Pry::VERSION} on Ruby #{RUBY_VERSION}."
13
+ end
14
+ end
15
+
16
+ Pry::Commands.add_command(Pry::Command::Version)
17
+ end
@@ -0,0 +1,33 @@
1
+ class Pry
2
+ # N.B. using a regular expresion here so that "raise-up 'foo'" does the right thing.
3
+ class Command::RaiseUp < Pry::ClassCommand
4
+ match(/raise-up(!?\b.*)/)
5
+ group 'Context'
6
+ description 'Raise an exception out of the current pry instance.'
7
+ command_options listing: 'raise-up'
8
+
9
+ banner <<-BANNER
10
+ Raise up, like exit, allows you to quit pry. Instead of returning a value
11
+ however, it raises an exception. If you don't provide the exception to be
12
+ raised, it will use the most recent exception (in pry `_ex_`).
13
+
14
+ When called as raise-up! (with an exclamation mark), this command raises the
15
+ exception through any nested prys you have created by "cd"ing into objects.
16
+
17
+ raise-up "get-me-out-of-here"
18
+
19
+ # This is equivalent to the command above.
20
+ raise "get-me-out-of-here"
21
+ raise-up
22
+ BANNER
23
+
24
+ def process
25
+ return _pry.pager.page help if captures[0] =~ /(-h|--help)\b/
26
+
27
+ # Handle 'raise-up', 'raise-up "foo"', 'raise-up RuntimeError, 'farble' in a rubyesque manner
28
+ target.eval("_pry_.raise_up#{captures[0]}")
29
+ end
30
+ end
31
+
32
+ Pry::Commands.add_command(Pry::Command::RaiseUp)
33
+ end
@@ -0,0 +1,62 @@
1
+ class Pry
2
+ class Command::ReloadCode < Pry::ClassCommand
3
+ match 'reload-code'
4
+ group 'Misc'
5
+ description 'Reload the source file that contains the specified code object.'
6
+
7
+ banner <<-'BANNER'
8
+ Reload the source file that contains the specified code object.
9
+
10
+ e.g reload-code MyClass#my_method #=> reload a method
11
+ reload-code MyClass #=> reload a class
12
+ reload-code my-command #=> reload a pry command
13
+ reload-code self #=> reload the current object
14
+ reload-code #=> reload the current file or object
15
+ BANNER
16
+
17
+ def process
18
+ if !args.empty?
19
+ reload_object(args.join(" "))
20
+ elsif internal_binding?(target)
21
+ reload_object("self")
22
+ else
23
+ reload_current_file
24
+ end
25
+ end
26
+
27
+ private
28
+
29
+ def current_file
30
+ File.expand_path target.eval("__FILE__")
31
+ end
32
+
33
+ def reload_current_file
34
+ if !File.exist?(current_file)
35
+ raise CommandError, "Current file: #{current_file} cannot be found on disk!"
36
+ end
37
+
38
+ load current_file
39
+ output.puts "The current file: #{current_file} was reloaded!"
40
+ end
41
+
42
+ def reload_object(identifier)
43
+ code_object = Pry::CodeObject.lookup(identifier, _pry_)
44
+ check_for_reloadability(code_object, identifier)
45
+ load code_object.source_file
46
+ output.puts "#{identifier} was reloaded!"
47
+ end
48
+
49
+ def check_for_reloadability(code_object, identifier)
50
+ if !code_object || !code_object.source_file
51
+ raise CommandError, "Cannot locate #{identifier}!"
52
+ elsif !File.exist?(code_object.source_file)
53
+ raise CommandError,
54
+ "Cannot reload #{identifier} as it has no associated file on disk. " \
55
+ "File found was: #{code_object.source_file}"
56
+ end
57
+ end
58
+ end
59
+
60
+ Pry::Commands.add_command(Pry::Command::ReloadCode)
61
+ Pry::Commands.alias_command 'reload-method', 'reload-code'
62
+ end
@@ -0,0 +1,18 @@
1
+ class Pry
2
+ class Command::Reset < Pry::ClassCommand
3
+ match 'reset'
4
+ group 'Context'
5
+ description 'Reset the REPL to a clean state.'
6
+
7
+ banner <<-'BANNER'
8
+ Reset the REPL to a clean state.
9
+ BANNER
10
+
11
+ def process
12
+ output.puts 'Pry reset.'
13
+ exec 'pry'
14
+ end
15
+ end
16
+
17
+ Pry::Commands.add_command(Pry::Command::Reset)
18
+ end
@@ -0,0 +1,65 @@
1
+ class Pry
2
+ class Command::Ri < Pry::ClassCommand
3
+ match 'ri'
4
+ group 'Introspection'
5
+ description 'View ri documentation.'
6
+
7
+ banner <<-'BANNER'
8
+ Usage: ri [spec]
9
+
10
+ View ri documentation. Relies on the "rdoc" gem being installed.
11
+ See also "show-doc" command.
12
+
13
+ ri Array#each
14
+ BANNER
15
+
16
+ def process(spec)
17
+ unless spec
18
+ return output.puts "Please provide a class, module, or method name (e.g: ri Array#push)"
19
+ end
20
+
21
+ # Lazily load RI
22
+ require 'rdoc/ri/driver'
23
+
24
+ unless defined? RDoc::RI::PryDriver
25
+
26
+ # Subclass RI so that it formats its output nicely, and uses `lesspipe`.
27
+ subclass = Class.new(RDoc::RI::Driver) # the hard way.
28
+
29
+ subclass.class_eval do
30
+ def initialize(pager, opts)
31
+ @pager = pager
32
+ super opts
33
+ end
34
+
35
+ def page
36
+ paging_text = StringIO.new
37
+ yield paging_text
38
+ @pager.page(paging_text.string)
39
+ end
40
+
41
+ def formatter(_io)
42
+ if @formatter_klass
43
+ @formatter_klass.new
44
+ else
45
+ RDoc::Markup::ToAnsi.new
46
+ end
47
+ end
48
+ end
49
+
50
+ RDoc::RI.const_set :PryDriver, subclass # hook it up!
51
+ end
52
+
53
+ # Spin-up an RI insance.
54
+ ri = RDoc::RI::PryDriver.new _pry_.pager, use_stdout: true, interactive: false
55
+
56
+ begin
57
+ ri.display_names [spec] # Get the documentation (finally!)
58
+ rescue RDoc::RI::Driver::NotFoundError => e
59
+ output.puts "error: '#{e.name}' not found"
60
+ end
61
+ end
62
+ end
63
+
64
+ Pry::Commands.add_command(Pry::Command::Ri)
65
+ end
@@ -0,0 +1,61 @@
1
+ require 'pry/commands/code_collector'
2
+
3
+ class Pry
4
+ class Command::SaveFile < Pry::ClassCommand
5
+ match 'save-file'
6
+ group 'Input and Output'
7
+ description 'Export to a file using content from the REPL.'
8
+
9
+ banner <<-'BANNER'
10
+ Usage: save-file [OPTIONS] --to [FILE]
11
+
12
+ Export to a file using content from the REPL.
13
+
14
+ save-file my_method --to hello.rb
15
+ save-file -i 1..10 --to hello.rb --append
16
+ save-file show-method --to my_command.rb
17
+ save-file sample_file.rb --lines 2..10 --to output_file.rb
18
+ BANNER
19
+
20
+ def options(opt)
21
+ CodeCollector.inject_options(opt)
22
+
23
+ opt.on :to=, "Specify the output file path"
24
+ opt.on :a, :append, "Append output to file"
25
+ end
26
+
27
+ def process
28
+ @cc = CodeCollector.new(args, opts, _pry_)
29
+ raise CommandError, "Found no code to save." if @cc.content.empty?
30
+
31
+ if !file_name
32
+ display_content
33
+ else
34
+ save_file
35
+ end
36
+ end
37
+
38
+ def file_name
39
+ opts[:to] || nil
40
+ end
41
+
42
+ def save_file
43
+ File.open(file_name, mode) do |f|
44
+ f.puts @cc.content
45
+ end
46
+ output.puts "#{file_name} successfully saved"
47
+ end
48
+
49
+ def display_content
50
+ output.puts @cc.content
51
+ output.puts "\n\n--\nPlease use `--to FILE` to export to a file."
52
+ output.puts "No file saved!\n--"
53
+ end
54
+
55
+ def mode
56
+ opts.present?(:append) ? "a" : "w"
57
+ end
58
+ end
59
+
60
+ Pry::Commands.add_command(Pry::Command::SaveFile)
61
+ end
@@ -0,0 +1,75 @@
1
+ class Pry
2
+ class Command::ShellCommand < Pry::ClassCommand
3
+ match(/\.(.*)/)
4
+ group 'Input and Output'
5
+ description "All text following a '.' is forwarded to the shell."
6
+ command_options listing: '.<shell command>', use_prefix: false,
7
+ takes_block: true
8
+
9
+ banner <<-'BANNER'
10
+ Usage: .COMMAND_NAME
11
+
12
+ All text following a "." is forwarded to the shell.
13
+
14
+ .ls -aF
15
+ .uname
16
+ BANNER
17
+
18
+ def process(cmd)
19
+ if cmd =~ /^cd\s*(.*)/i
20
+ process_cd parse_destination($1)
21
+ else
22
+ pass_block(cmd)
23
+ if command_block
24
+ command_block.call `#{cmd}`
25
+ else
26
+ _pry_.config.system.call(output, cmd, _pry_)
27
+ end
28
+ end
29
+ end
30
+
31
+ private
32
+
33
+ def parse_destination(dest)
34
+ return "~" if dest.empty?
35
+ return dest unless dest == "-"
36
+
37
+ state.old_pwd || raise(CommandError, "No prior directory available")
38
+ end
39
+
40
+ def process_cd(dest)
41
+ begin
42
+ state.old_pwd = Dir.pwd
43
+ Dir.chdir(File.expand_path(path_from_cd_path(dest) || dest))
44
+ rescue Errno::ENOENT
45
+ raise CommandError, "No such directory: #{dest}"
46
+ end
47
+ end
48
+
49
+ def cd_path_env
50
+ ENV['CDPATH']
51
+ end
52
+
53
+ def cd_path_exists?
54
+ cd_path_env && cd_path_env.length.nonzero?
55
+ end
56
+
57
+ def path_from_cd_path(dest)
58
+ return if !(dest && cd_path_exists?) || special_case_path?(dest)
59
+
60
+ cd_path_env.split(File::PATH_SEPARATOR).each do |path|
61
+ if File.directory?(path) && path.split(File::SEPARATOR).last == dest
62
+ return path
63
+ end
64
+ end
65
+
66
+ return nil
67
+ end
68
+
69
+ def special_case_path?(dest)
70
+ ['.', '..', '-'].include?(dest) || dest =~ /\A[#{File::PATH_SEPARATOR}~]/
71
+ end
72
+ end
73
+
74
+ Pry::Commands.add_command(Pry::Command::ShellCommand)
75
+ end
@@ -0,0 +1,25 @@
1
+ class Pry
2
+ class Command::ShellMode < Pry::ClassCommand
3
+ match 'shell-mode'
4
+ group 'Input and Output'
5
+ description 'Toggle shell mode. Bring in pwd prompt and file completion.'
6
+
7
+ banner <<-'BANNER'
8
+ Toggle shell mode. Bring in pwd prompt and file completion.
9
+ BANNER
10
+
11
+ def process
12
+ state.disabled ^= true
13
+
14
+ if state.disabled
15
+ state.prev_prompt = _pry_.prompt
16
+ _pry_.prompt = Pry::Prompt[:shell][:value]
17
+ else
18
+ _pry_.prompt = state.prev_prompt
19
+ end
20
+ end
21
+ end
22
+
23
+ Pry::Commands.add_command(Pry::Command::ShellMode)
24
+ Pry::Commands.alias_command 'file-mode', 'shell-mode'
25
+ end
@@ -0,0 +1,81 @@
1
+ require 'pry/commands/show_info'
2
+
3
+ class Pry
4
+ class Command::ShowDoc < Command::ShowInfo
5
+ include Pry::Helpers::DocumentationHelpers
6
+
7
+ match 'show-doc'
8
+ group 'Introspection'
9
+ description 'Show the documentation for a method or class.'
10
+
11
+ banner <<-BANNER
12
+ Usage: show-doc [OPTIONS] [METH]
13
+ Aliases: ?
14
+
15
+ Show the documentation for a method or class. Tries instance methods first and
16
+ then methods by default.
17
+
18
+ show-doc hi_method # docs for hi_method
19
+ show-doc Pry # for Pry class
20
+ show-doc Pry -a # for all definitions of Pry class (all monkey patches)
21
+ BANNER
22
+
23
+ # The docs for code_object prepared for display.
24
+ def content_for(code_object)
25
+ Code.new(render_doc_markup_for(code_object),
26
+ start_line_for(code_object), :text).
27
+ with_line_numbers(use_line_numbers?).to_s
28
+ end
29
+
30
+ # process the markup (if necessary) and apply colors
31
+ def render_doc_markup_for(code_object)
32
+ docs = docs_for(code_object)
33
+
34
+ if code_object.command?
35
+ # command '--help' shouldn't use markup highlighting
36
+ docs
37
+ else
38
+ if docs.empty?
39
+ raise CommandError, "No docs found for: #{
40
+ obj_name ? obj_name : 'current context'
41
+ }"
42
+ end
43
+ process_comment_markup(docs)
44
+ end
45
+ end
46
+
47
+ # Return docs for the code_object, adjusting for whether the code_object
48
+ # has yard docs available, in which case it returns those.
49
+ # (note we only have to check yard docs for modules since they can
50
+ # have multiple docs, but methods can only be doc'd once so we
51
+ # dont need to check them)
52
+ def docs_for(code_object)
53
+ if code_object.module_with_yard_docs?
54
+ # yard docs
55
+ code_object.yard_doc
56
+ else
57
+ # normal docs (i.e comments above method/module/command)
58
+ code_object.doc
59
+ end
60
+ end
61
+
62
+ # Which sections to include in the 'header', can toggle: :owner,
63
+ # :signature and visibility.
64
+ def header_options
65
+ super.merge signature: true
66
+ end
67
+
68
+ # figure out start line of docs by back-calculating based on
69
+ # number of lines in the comment and the start line of the code_object
70
+ # @return [Fixnum] start line of docs
71
+ def start_line_for(code_object)
72
+ return 1 if code_object.command? || opts.present?(:'base-one')
73
+ return 1 unless code_object.source_line
74
+
75
+ code_object.source_line - code_object.doc.lines.count
76
+ end
77
+ end
78
+
79
+ Pry::Commands.add_command(Pry::Command::ShowDoc)
80
+ Pry::Commands.alias_command '?', 'show-doc'
81
+ end