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,415 @@
1
+ class Pry
2
+ class NoCommandError < StandardError
3
+ def initialize(match, owner)
4
+ super "Command '#{match}' not found in command set #{owner}"
5
+ end
6
+ end
7
+
8
+ # This class is used to create sets of commands. Commands can be imported from
9
+ # different sets, aliased, removed, etc.
10
+ class CommandSet
11
+ include Enumerable
12
+ include Pry::Helpers::BaseHelpers
13
+ attr_reader :helper_module
14
+
15
+ # @param [Array<Commandset>] imported_sets
16
+ # Sets which will be imported automatically
17
+ # @yield Optional block run to define commands
18
+ def initialize(*imported_sets, &block)
19
+ @commands = {}
20
+ @helper_module = Module.new
21
+ import(*imported_sets)
22
+ instance_eval(&block) if block
23
+ end
24
+
25
+ # Defines a new Pry command.
26
+ # @param [String, Regexp] match The start of invocations of this command.
27
+ # @param [String] description A description of the command.
28
+ # @param [Hash] options The optional configuration parameters.
29
+ # @option options [Boolean] :keep_retval Whether or not to use return value
30
+ # of the block for return of `command` or just to return `nil`
31
+ # (the default).
32
+ # @option options [Array<String>] :requires_gem Whether the command has
33
+ # any gem dependencies, if it does and dependencies not met then
34
+ # command is disabled and a stub proc giving instructions to
35
+ # install command is provided.
36
+ # @option options [Boolean] :interpolate Whether string #{} based
37
+ # interpolation is applied to the command arguments before
38
+ # executing the command. Defaults to true.
39
+ # @option options [String] :listing The listing name of the
40
+ # command. That is the name by which the command is looked up by
41
+ # help and by show-command. Necessary for commands with regex matches.
42
+ # @option options [Boolean] :use_prefix Whether the command uses
43
+ # `Pry.config.command_prefix` prefix (if one is defined). Defaults
44
+ # to true.
45
+ # @option options [Boolean] :shellwords Whether the command's arguments
46
+ # should be split using Shellwords instead of just split on spaces.
47
+ # Defaults to true.
48
+ # @yield The action to perform. The parameters in the block
49
+ # determines the parameters the command will receive. All
50
+ # parameters passed into the block will be strings. Successive
51
+ # command parameters are separated by whitespace at the Pry prompt.
52
+ # @example
53
+ # MyCommands = Pry::CommandSet.new do
54
+ # command "greet", "Greet somebody" do |name|
55
+ # puts "Good afternoon #{name.capitalize}!"
56
+ # end
57
+ # end
58
+ #
59
+ # # From pry:
60
+ # # pry(main)> _pry_.commands = MyCommands
61
+ # # pry(main)> greet john
62
+ # # Good afternoon John!
63
+ # # pry(main)> help greet
64
+ # # Greet somebody
65
+ # @example Regexp command
66
+ # MyCommands = Pry::CommandSet.new do
67
+ # command /number-(\d+)/, "number-N regex command", :listing => "number" do |num, name|
68
+ # puts "hello #{name}, nice number: #{num}"
69
+ # end
70
+ # end
71
+ #
72
+ # # From pry:
73
+ # # pry(main)> _pry_.commands = MyCommands
74
+ # # pry(main)> number-10 john
75
+ # # hello john, nice number: 10
76
+ # # pry(main)> help number
77
+ # # number-N regex command
78
+ def block_command(match, description = "No description.", options = {}, &block)
79
+ description, options = ["No description.", description] if description.is_a?(Hash)
80
+ options = Pry::Command.default_options(match).merge!(options)
81
+
82
+ @commands[match] = Pry::BlockCommand.subclass(match, description, options, helper_module, &block)
83
+ end
84
+ alias_method :command, :block_command
85
+
86
+ # Defines a new Pry command class.
87
+ #
88
+ # @param [String, Regexp] match The start of invocations of this command.
89
+ # @param [String] description A description of the command.
90
+ # @param [Hash] options The optional configuration parameters, see {#command}
91
+ # @yield The class body's definition.
92
+ #
93
+ # @example
94
+ # Pry::Commands.create_command "echo", "echo's the input", :shellwords => false do
95
+ # def options(opt)
96
+ # opt.banner "Usage: echo [-u | -d] <string to echo>"
97
+ # opt.on :u, :upcase, "ensure the output is all upper-case"
98
+ # opt.on :d, :downcase, "ensure the output is all lower-case"
99
+ # end
100
+ #
101
+ # def process
102
+ # raise Pry::CommandError, "-u and -d makes no sense" if opts.present?(:u) && opts.present?(:d)
103
+ # result = args.join(" ")
104
+ # result.downcase! if opts.present?(:downcase)
105
+ # result.upcase! if opts.present?(:upcase)
106
+ # output.puts result
107
+ # end
108
+ # end
109
+ #
110
+ def create_command(match, description = "No description.", options = {}, &block)
111
+ description, options = ["No description.", description] if description.is_a?(Hash)
112
+ options = Pry::Command.default_options(match).merge!(options)
113
+
114
+ @commands[match] = Pry::ClassCommand.subclass(match, description, options, helper_module, &block)
115
+ @commands[match].class_eval(&block)
116
+ @commands[match]
117
+ end
118
+
119
+ def each(&block)
120
+ @commands.each(&block)
121
+ end
122
+
123
+ # Removes some commands from the set
124
+ # @param [Array<String>] searches the matches or listings of the commands to remove
125
+ def delete(*searches)
126
+ searches.each do |search|
127
+ cmd = find_command_by_match_or_listing(search)
128
+ @commands.delete cmd.match
129
+ end
130
+ end
131
+
132
+ # Imports all the commands from one or more sets.
133
+ # @param [Array<CommandSet>] sets Command sets, all of the commands of which
134
+ # will be imported.
135
+ # @return [Pry::CommandSet] Returns the reciever (a command set).
136
+ def import(*sets)
137
+ sets.each do |set|
138
+ @commands.merge! set.to_hash
139
+ helper_module.send :include, set.helper_module
140
+ end
141
+ self
142
+ end
143
+
144
+ # Imports some commands from a set
145
+ # @param [CommandSet] set Set to import commands from
146
+ # @param [Array<String>] matches Commands to import
147
+ # @return [Pry::CommandSet] Returns the reciever (a command set).
148
+ def import_from(set, *matches)
149
+ helper_module.send :include, set.helper_module
150
+ matches.each do |match|
151
+ cmd = set.find_command_by_match_or_listing(match)
152
+ @commands[cmd.match] = cmd
153
+ end
154
+ self
155
+ end
156
+
157
+ # @param [String, Regexp] match_or_listing The match or listing of a command.
158
+ # of the command to retrieve.
159
+ # @return [Command] The command object matched.
160
+ def find_command_by_match_or_listing(match_or_listing)
161
+ cmd = (@commands[match_or_listing] ||
162
+ Pry::Helpers::BaseHelpers.find_command(match_or_listing, @commands))
163
+ cmd or raise ArgumentError, "Cannot find a command: '#{match_or_listing}'!"
164
+ end
165
+
166
+ # Aliases a command
167
+ # @param [String, Regex] match The match of the alias (can be a regex).
168
+ # @param [String] action The action to be performed (typically
169
+ # another command).
170
+ # @param [Hash] options The optional configuration parameters,
171
+ # accepts the same as the `command` method, but also allows the
172
+ # command description to be passed this way too as `:desc`
173
+ # @example Creating an alias for `ls -M`
174
+ # Pry.config.commands.alias_command "lM", "ls -M"
175
+ # @example Pass explicit description (overriding default).
176
+ # Pry.config.commands.alias_command "lM", "ls -M", :desc => "cutiepie"
177
+ def alias_command(match, action, options = {})
178
+ cmd = find_command(action) or fail "Command: `#{action}` not found"
179
+ original_options = cmd.options.dup
180
+
181
+ options = original_options.merge!({
182
+ desc: "Alias for `#{action}`",
183
+ listing: match
184
+ }).merge!(options)
185
+
186
+ # ensure default description is used if desc is nil
187
+ desc = options.delete(:desc).to_s
188
+
189
+ c = block_command match, desc, options do |*args|
190
+ run action, *args
191
+ end
192
+
193
+ c.class_eval do
194
+ define_method(:complete) do |input|
195
+ cmd.new(context).complete(input)
196
+ end
197
+ end
198
+
199
+ c.group "Aliases"
200
+
201
+ c
202
+ end
203
+
204
+ # Rename a command. Accepts either match or listing for the search.
205
+ #
206
+ # @param [String, Regexp] new_match The new match for the command.
207
+ # @param [String, Regexp] search The command's current match or listing.
208
+ # @param [Hash] options The optional configuration parameters,
209
+ # accepts the same as the `command` method, but also allows the
210
+ # command description to be passed this way too.
211
+ # @example Renaming the `ls` command and changing its description.
212
+ # Pry.config.commands.rename "dir", "ls", :description => "DOS friendly ls"
213
+ def rename_command(new_match, search, options = {})
214
+ cmd = find_command_by_match_or_listing(search)
215
+
216
+ options = {
217
+ listing: new_match,
218
+ description: cmd.description
219
+ }.merge!(options)
220
+
221
+ @commands[new_match] = cmd.dup
222
+ @commands[new_match].match = new_match
223
+ @commands[new_match].description = options.delete(:description)
224
+ @commands[new_match].options.merge!(options)
225
+ @commands.delete(cmd.match)
226
+ end
227
+
228
+ def disabled_command(name_of_disabled_command, message, matcher = name_of_disabled_command)
229
+ create_command name_of_disabled_command do
230
+ match matcher
231
+ description ""
232
+
233
+ define_method(:process) do
234
+ output.puts "DISABLED: #{message}"
235
+ end
236
+ end
237
+ end
238
+
239
+ # Sets or gets the description for a command (replacing the old
240
+ # description). Returns current description if no description
241
+ # parameter provided.
242
+ # @param [String, Regexp] search The command match.
243
+ # @param [String?] description (nil) The command description.
244
+ # @example Setting
245
+ # MyCommands = Pry::CommandSet.new do
246
+ # desc "help", "help description"
247
+ # end
248
+ # @example Getting
249
+ # Pry.config.commands.desc "amend-line"
250
+ def desc(search, description = nil)
251
+ cmd = find_command_by_match_or_listing(search)
252
+ return cmd.description if !description
253
+
254
+ cmd.description = description
255
+ end
256
+
257
+ # Defines helpers methods for this command sets.
258
+ # Those helpers are only defined in this command set.
259
+ #
260
+ # @yield A block defining helper methods
261
+ # @example
262
+ # helpers do
263
+ # def hello
264
+ # puts "Hello!"
265
+ # end
266
+ #
267
+ # include OtherModule
268
+ # end
269
+ def helpers(&block)
270
+ helper_module.class_eval(&block)
271
+ end
272
+
273
+ # @return [Array]
274
+ # The list of commands provided by the command set.
275
+ def list_commands
276
+ @commands.keys
277
+ end
278
+ alias_method :keys, :list_commands
279
+
280
+ def to_hash
281
+ @commands.dup
282
+ end
283
+ alias_method :to_h, :to_hash
284
+
285
+ # Find a command that matches the given line
286
+ # @param [String] pattern The line that might be a command invocation
287
+ # @return [Pry::Command, nil]
288
+ def [](pattern)
289
+ @commands.values.select do |command|
290
+ command.matches?(pattern)
291
+ end.sort_by do |command|
292
+ command.match_score(pattern)
293
+ end.last
294
+ end
295
+ alias_method :find_command, :[]
296
+
297
+ #
298
+ # Re-assign the command found at _pattern_ with _command_.
299
+ #
300
+ # @param [Regexp, String] pattern
301
+ # The command to add or replace(found at _pattern_).
302
+ #
303
+ # @param [Pry::Command] command
304
+ # The command to add.
305
+ #
306
+ # @return [Pry::Command]
307
+ # Returns the new command (matched with "pattern".)
308
+ #
309
+ # @example
310
+ # Pry.config.commands["help"] = MyHelpCommand
311
+ #
312
+ def []=(pattern, command)
313
+ if command.equal?(nil)
314
+ return @commands.delete(pattern)
315
+ end
316
+ unless Class === command && command < Pry::Command
317
+ raise TypeError, "command is not a subclass of Pry::Command"
318
+ end
319
+
320
+ bind_command_to_pattern = pattern != command.match
321
+ if bind_command_to_pattern
322
+ command_copy = command.dup
323
+ command_copy.match = pattern
324
+ @commands[pattern] = command_copy
325
+ else
326
+ @commands[pattern] = command
327
+ end
328
+ end
329
+
330
+ #
331
+ # Add a command to set.
332
+ #
333
+ # @param [Command] command
334
+ # a subclass of Pry::Command.
335
+ #
336
+ def add_command(command)
337
+ self[command.match] = command
338
+ end
339
+
340
+ # Find the command that the user might be trying to refer to.
341
+ # @param [String] search The user's search.
342
+ # @return [Pry::Command?]
343
+ def find_command_for_help(search)
344
+ find_command(search) || (begin
345
+ find_command_by_match_or_listing(search)
346
+ rescue ArgumentError
347
+ nil
348
+ end)
349
+ end
350
+
351
+ # Is the given line a command invocation?
352
+ # @param [String] val
353
+ # @return [Boolean]
354
+ def valid_command?(val)
355
+ !!find_command(val)
356
+ end
357
+
358
+ # Process the given line to see whether it needs executing as a command.
359
+ # @param [String] val The line to execute
360
+ # @param [Hash] context The context to execute the commands with
361
+ # @return [CommandSet::Result]
362
+ def process_line(val, context = {})
363
+ if (command = find_command(val))
364
+ context = context.merge(command_set: self)
365
+ retval = command.new(context).process_line(val)
366
+ Result.new(true, retval)
367
+ else
368
+ Result.new(false)
369
+ end
370
+ end
371
+
372
+ # @private (used for testing)
373
+ def run_command(context, match, *args)
374
+ command = @commands[match] or raise NoCommandError.new(match, self)
375
+ command.new(context).call_safely(*args)
376
+ end
377
+
378
+ # Generate completions for the user's search.
379
+ # @param [String] search The line to search for
380
+ # @param [Hash] context The context to create the command with
381
+ # @return [Array<String>]
382
+ def complete(search, context = {})
383
+ if (command = find_command(search))
384
+ command.new(context).complete(search)
385
+ else
386
+ @commands.keys.select do |key|
387
+ String === key && key.start_with?(search)
388
+ end.map { |key| key + " " }
389
+ end
390
+ end
391
+ end
392
+
393
+ # Wraps the return result of process_commands, indicates if the
394
+ # result IS a command and what kind of command (e.g void)
395
+ class Result
396
+ attr_reader :retval
397
+
398
+ def initialize(is_command, retval = nil)
399
+ @is_command, @retval = is_command, retval
400
+ end
401
+
402
+ # Is the result a command?
403
+ # @return [Boolean]
404
+ def command?
405
+ @is_command
406
+ end
407
+
408
+ # Is the result a command and if it is, is it a void command?
409
+ # (one that does not return a value)
410
+ # @return [Boolean]
411
+ def void_command?
412
+ retval == Command::VOID_VALUE
413
+ end
414
+ end
415
+ end
@@ -0,0 +1,98 @@
1
+ class Pry
2
+ class Command::AmendLine < Pry::ClassCommand
3
+ match(/amend-line(?: (-?\d+)(?:\.\.(-?\d+))?)?/)
4
+ group 'Editing'
5
+ description 'Amend a line of input in multi-line mode.'
6
+ command_options interpolate: false, listing: 'amend-line'
7
+
8
+ banner <<-'BANNER'
9
+ Amend a line of input in multi-line mode. `amend-line N`, where the N represents
10
+ line to replace. Can also specify a range of lines using `amend-line N..M`
11
+ syntax. Passing "!" as replacement content deletes the line(s) instead.
12
+
13
+ amend-line 1 puts 'new' # replace line 1
14
+ amend-line 1..4 ! # delete lines 1..4
15
+ amend-line 3 >puts 'bye' # insert before line 3
16
+ amend-line puts 'appended' # no line number modifies immediately preceding line
17
+ BANNER
18
+
19
+ def process
20
+ raise CommandError, "No input to amend." if eval_string.empty?
21
+
22
+ eval_string.replace(amend_input)
23
+ run "fix-indent"
24
+ run "show-input"
25
+ end
26
+
27
+ private
28
+
29
+ # @return [String] A new string with the amendments applied to it.
30
+ def amend_input
31
+ input_array = eval_string.each_line.to_a
32
+
33
+ if arg_string == "!"
34
+ delete_from_array(input_array, line_range)
35
+ elsif arg_string.start_with?(">")
36
+ insert_into_array(input_array, line_range)
37
+ else
38
+ replace_in_array(input_array, line_range)
39
+ end
40
+
41
+ input_array.join
42
+ end
43
+
44
+ def delete_from_array(array, range)
45
+ array.slice!(range)
46
+ end
47
+
48
+ def insert_into_array(array, range)
49
+ insert_slot = Array(range).first
50
+ array.insert(insert_slot, arg_string[1..-1] << "\n")
51
+ end
52
+
53
+ def replace_in_array(array, range)
54
+ array[range] = arg_string + "\n"
55
+ end
56
+
57
+ # @return [Fixnum] The number of lines currently in `eval_string` (the input buffer).
58
+ def line_count
59
+ eval_string.lines.count
60
+ end
61
+
62
+ # Returns the (one-indexed) start and end lines given by the user.
63
+ # The lines in this range will be affected by the `amend-line`.
64
+ # Returns `nil` if no lines were specified by the user.
65
+ # @return [Array<Fixnum>, nil]
66
+ def start_and_end_line_number
67
+ start_line_number, end_line_number = args
68
+ end_line_number ||= start_line_number.to_i
69
+
70
+ [start_line_number.to_i, end_line_number.to_i] if start_line_number
71
+ end
72
+
73
+ # Takes two numbers that are 1-indexed, and returns a range (or
74
+ # number) that is 0-indexed. 1-indexed means the first element is
75
+ # indentified by 1 rather than by 0 (as is the case for Ruby arrays).
76
+ # @param [Fixnum] start_line_number One-indexed number.
77
+ # @param [Fixnum] end_line_number One-indexed number.
78
+ # @return [Range] The zero-indexed range.
79
+ def zero_indexed_range_from_one_indexed_numbers(start_line_number, end_line_number)
80
+ # FIXME: one_index_number is a horrible name for this method
81
+ one_index_number(start_line_number)..one_index_number(end_line_number)
82
+ end
83
+
84
+ # The lines (or line) that will be modified by the `amend-line`.
85
+ # @return [Range, Fixnum] The lines or line.
86
+ def line_range
87
+ start_line_number, end_line_number = start_and_end_line_number
88
+ if start_line_number
89
+ zero_indexed_range_from_one_indexed_numbers(start_line_number,
90
+ end_line_number)
91
+ else
92
+ line_count - 1
93
+ end
94
+ end
95
+ end
96
+
97
+ Pry::Commands.add_command(Pry::Command::AmendLine)
98
+ end