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.
- checksums.yaml +7 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +21 -0
- data/README.md +26 -0
- data/chess_engine.gemspec +14 -0
- data/lib/chess_engine/board.rb +95 -0
- data/lib/chess_engine/cli.rb +105 -0
- data/lib/chess_engine/game.rb +148 -0
- data/lib/chess_engine/input.rb +19 -0
- data/lib/chess_engine/move.rb +35 -0
- data/lib/chess_engine/piece.rb +97 -0
- data/lib/chess_engine/validator.rb +87 -0
- data/lib/chess_engine.rb +1 -0
- data/spec/board_spec.rb +70 -0
- data/spec/game_helper.rb +5 -0
- data/spec/game_spec.rb +79 -0
- data/spec/spec_helper.rb +100 -0
- data/spec/validator_spec.rb +26 -0
- data/vendor/bundle/bin/coderay +27 -0
- data/vendor/bundle/bin/pry +27 -0
- data/vendor/bundle/cache/coderay-1.1.2.gem +0 -0
- data/vendor/bundle/cache/colorize-0.8.1.gem +0 -0
- data/vendor/bundle/cache/method_source-0.9.2.gem +0 -0
- data/vendor/bundle/cache/pry-0.12.2.gem +0 -0
- data/vendor/bundle/cache/rb-readline-0.5.5.gem +0 -0
- data/vendor/bundle/gems/coderay-1.1.2/MIT-LICENSE +22 -0
- data/vendor/bundle/gems/coderay-1.1.2/README_INDEX.rdoc +123 -0
- data/vendor/bundle/gems/coderay-1.1.2/bin/coderay +215 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/duo.rb +81 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/_map.rb +17 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/comment_filter.rb +25 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/count.rb +39 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/debug.rb +49 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/debug_lint.rb +63 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/div.rb +23 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/encoder.rb +190 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/filter.rb +58 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html/css.rb +65 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html/numbering.rb +108 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html/output.rb +166 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html.rb +333 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/json.rb +83 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/lines_of_code.rb +45 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/lint.rb +59 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/null.rb +18 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/page.rb +24 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/span.rb +23 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/statistic.rb +95 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/terminal.rb +195 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/text.rb +46 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/token_kind_filter.rb +111 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/xml.rb +72 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/yaml.rb +50 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders.rb +18 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/for_redcloth.rb +95 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/file_type.rb +151 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/plugin.rb +55 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/plugin_host.rb +221 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/word_list.rb +72 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/_map.rb +24 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/c.rb +189 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/clojure.rb +217 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/cpp.rb +217 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/css.rb +196 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/debug.rb +75 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/delphi.rb +144 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/diff.rb +221 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/erb.rb +81 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/go.rb +208 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/groovy.rb +268 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/haml.rb +168 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/html.rb +275 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/java/builtin_types.rb +421 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/java.rb +174 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/java_script.rb +237 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/json.rb +98 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/lua.rb +280 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/php.rb +527 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/python.rb +287 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/raydebug.rb +75 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/ruby/patterns.rb +178 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/ruby/string_state.rb +79 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/ruby.rb +477 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/sass.rb +232 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/scanner.rb +337 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/sql.rb +169 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/taskpaper.rb +36 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/text.rb +26 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/xml.rb +17 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/yaml.rb +140 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners.rb +27 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles/_map.rb +7 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles/alpha.rb +153 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles/style.rb +18 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles.rb +15 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/token_kinds.rb +85 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/tokens.rb +161 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/tokens_proxy.rb +55 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/version.rb +3 -0
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay.rb +284 -0
- data/vendor/bundle/gems/colorize-0.8.1/CHANGELOG +65 -0
- data/vendor/bundle/gems/colorize-0.8.1/LICENSE +339 -0
- data/vendor/bundle/gems/colorize-0.8.1/README.md +105 -0
- data/vendor/bundle/gems/colorize-0.8.1/Rakefile +13 -0
- data/vendor/bundle/gems/colorize-0.8.1/colorize.gemspec +36 -0
- data/vendor/bundle/gems/colorize-0.8.1/lib/colorize/class_methods.rb +120 -0
- data/vendor/bundle/gems/colorize-0.8.1/lib/colorize/instance_methods.rb +132 -0
- data/vendor/bundle/gems/colorize-0.8.1/lib/colorize.rb +12 -0
- data/vendor/bundle/gems/colorize-0.8.1/lib/colorized_string.rb +19 -0
- data/vendor/bundle/gems/colorize-0.8.1/test/test_colorize.rb +164 -0
- data/vendor/bundle/gems/method_source-0.9.2/Gemfile +2 -0
- data/vendor/bundle/gems/method_source-0.9.2/LICENSE +25 -0
- data/vendor/bundle/gems/method_source-0.9.2/README.markdown +91 -0
- data/vendor/bundle/gems/method_source-0.9.2/Rakefile +81 -0
- data/vendor/bundle/gems/method_source-0.9.2/lib/method_source/code_helpers.rb +154 -0
- data/vendor/bundle/gems/method_source-0.9.2/lib/method_source/source_location.rb +138 -0
- data/vendor/bundle/gems/method_source-0.9.2/lib/method_source/version.rb +3 -0
- data/vendor/bundle/gems/method_source-0.9.2/lib/method_source.rb +141 -0
- data/vendor/bundle/gems/method_source-0.9.2/method_source.gemspec +35 -0
- data/vendor/bundle/gems/method_source-0.9.2/spec/method_source/code_helpers_spec.rb +43 -0
- data/vendor/bundle/gems/method_source-0.9.2/spec/method_source_spec.rb +143 -0
- data/vendor/bundle/gems/method_source-0.9.2/spec/spec_helper.rb +101 -0
- data/vendor/bundle/gems/pry-0.12.2/CHANGELOG.md +953 -0
- data/vendor/bundle/gems/pry-0.12.2/LICENSE +25 -0
- data/vendor/bundle/gems/pry-0.12.2/README.md +390 -0
- data/vendor/bundle/gems/pry-0.12.2/bin/pry +8 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/basic_object.rb +6 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/cli.rb +218 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/code/code_file.rb +110 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/code/code_range.rb +71 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/code/loc.rb +98 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/code.rb +353 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/code_object.rb +195 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/color_printer.rb +65 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/command.rb +723 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/command_set.rb +415 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/amend_line.rb +98 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/bang.rb +20 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/bang_pry.rb +17 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/abstract_formatter.rb +27 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/exception_formatter.rb +79 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/file_formatter.rb +71 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/input_expression_formatter.rb +43 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat.rb +63 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cd.rb +41 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/change_inspector.rb +27 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/change_prompt.rb +46 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/clear_screen.rb +14 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/code_collector.rb +167 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/disable_pry.rb +27 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/disabled_commands.rb +2 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/easter_eggs.rb +112 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/edit/exception_patcher.rb +25 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/edit/file_and_line_locator.rb +36 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/edit.rb +200 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/exit.rb +43 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/exit_all.rb +29 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/exit_program.rb +23 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/find_method.rb +191 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/fix_indent.rb +19 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_cd.rb +26 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_install.rb +32 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_list.rb +33 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_open.rb +29 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_readme.rb +25 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_search.rb +40 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_stats.rb +83 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gist.rb +102 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/help.rb +164 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/hist.rb +181 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/import_set.rb +23 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/install_command.rb +54 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/jump_to.rb +29 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb +35 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/constants.rb +58 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/formatter.rb +51 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/globals.rb +46 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/grep.rb +19 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/instance_vars.rb +38 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/interrogatable.rb +18 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/jruby_hacks.rb +49 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/local_names.rb +33 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/local_vars.rb +37 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/ls_entity.rb +69 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/methods.rb +54 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/methods_helper.rb +46 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/self_methods.rb +33 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls.rb +113 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/nesting.rb +25 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/play.rb +102 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/pry_backtrace.rb +25 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/pry_version.rb +17 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/raise_up.rb +33 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/reload_code.rb +62 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/reset.rb +18 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ri.rb +65 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/save_file.rb +61 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/shell_command.rb +75 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/shell_mode.rb +25 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_doc.rb +81 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_info.rb +216 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_input.rb +17 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_source.rb +53 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/stat.rb +40 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/switch_to.rb +23 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/toggle_color.rb +24 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/watch_expression/expression.rb +38 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/watch_expression.rb +107 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/whereami.rb +197 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/wtf.rb +70 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands.rb +6 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/behavior.rb +255 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/convenience.rb +28 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/default.rb +159 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/memoization.rb +48 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/config.rb +35 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/core_extensions.rb +142 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/editor.rb +128 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/exceptions.rb +76 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/forwardable.rb +23 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/base_helpers.rb +200 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/command_helpers.rb +157 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/documentation_helpers.rb +76 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/options_helpers.rb +27 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/platform.rb +58 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/table.rb +114 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/text.rb +115 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers.rb +6 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/history.rb +161 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/hooks.rb +171 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/indent.rb +408 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/input_completer.rb +265 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/input_lock.rb +130 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/inspector.rb +27 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/last_exception.rb +61 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/method/disowned.rb +55 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/method/patcher.rb +122 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/method/weird_method_locator.rb +198 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/method.rb +552 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/object_path.rb +83 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/output.rb +50 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/pager.rb +250 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/platform.rb +91 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/plugins.rb +122 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/prompt.rb +145 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/pry_class.rb +425 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/pry_instance.rb +699 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/repl.rb +261 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/repl_file_loader.rb +73 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/ring.rb +84 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/rubygem.rb +84 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop/LICENSE +20 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop/commands.rb +195 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop/option.rb +206 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop.rb +661 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/terminal.rb +91 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/evalable.rb +15 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/mockable.rb +14 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/pry_tester.rb +73 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/utility.rb +26 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/variables.rb +46 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable.rb +70 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/version.rb +3 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/wrapped_module/candidate.rb +131 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/wrapped_module.rb +378 -0
- data/vendor/bundle/gems/pry-0.12.2/lib/pry.rb +132 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/CHANGES +94 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/LICENSE +25 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/README.md +81 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/Rakefile +25 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/bench/_rl_adjust_point.rb +26 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/examples/example_readline.rb +8 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/examples/example_readline_with_completion.rb +18 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/examples/tinyirb.rb +11 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/lib/rb-readline.rb +18 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/lib/rbreadline/version.rb +3 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/lib/rbreadline.rb +8920 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/lib/readline.rb +539 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/rb-readline.gemspec +51 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/setup.rb +1585 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/test/support/filesystem_completion_helper.rb +53 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/test/test_completion.rb +100 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/test/test_filename_completion_proc.rb +88 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/test/test_history.rb +29 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/test/test_rbreadline.rb +23 -0
- data/vendor/bundle/gems/rb-readline-0.5.5/test/test_readline.rb +221 -0
- data/vendor/bundle/specifications/coderay-1.1.2.gemspec +26 -0
- data/vendor/bundle/specifications/colorize-0.8.1.gemspec +38 -0
- data/vendor/bundle/specifications/method_source-0.9.2.gemspec +35 -0
- data/vendor/bundle/specifications/pry-0.12.2.gemspec +38 -0
- data/vendor/bundle/specifications/rb-readline-0.5.5.gemspec +39 -0
- metadata +363 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::Exit < Pry::ClassCommand
|
3
|
+
match 'exit'
|
4
|
+
group 'Navigating Pry'
|
5
|
+
description 'Pop the previous binding.'
|
6
|
+
command_options keep_retval: true
|
7
|
+
|
8
|
+
banner <<-'BANNER'
|
9
|
+
Usage: exit [OPTIONS] [--help]
|
10
|
+
Aliases: quit
|
11
|
+
|
12
|
+
Pop the previous binding (does NOT exit program). It can be useful to exit a
|
13
|
+
context with a user-provided value. For instance an exit value can be used to
|
14
|
+
determine program flow.
|
15
|
+
|
16
|
+
exit "pry this"
|
17
|
+
exit
|
18
|
+
|
19
|
+
https://github.com/pry/pry/wiki/State-navigation#wiki-Exit_with_value
|
20
|
+
BANNER
|
21
|
+
|
22
|
+
def process
|
23
|
+
if _pry_.binding_stack.one?
|
24
|
+
_pry_.run_command "exit-all #{arg_string}"
|
25
|
+
else
|
26
|
+
# otherwise just pop a binding and return user supplied value
|
27
|
+
process_pop_and_return
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def process_pop_and_return
|
32
|
+
popped_object = _pry_.binding_stack.pop.eval('self')
|
33
|
+
|
34
|
+
# return a user-specified value if given otherwise return the object
|
35
|
+
return target.eval(arg_string) unless arg_string.empty?
|
36
|
+
|
37
|
+
popped_object
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
Pry::Commands.add_command(Pry::Command::Exit)
|
42
|
+
Pry::Commands.alias_command 'quit', 'exit'
|
43
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::ExitAll < Pry::ClassCommand
|
3
|
+
match 'exit-all'
|
4
|
+
group 'Navigating Pry'
|
5
|
+
description 'End the current Pry session.'
|
6
|
+
|
7
|
+
banner <<-'BANNER'
|
8
|
+
Usage: exit-all [--help]
|
9
|
+
Aliases: !!@
|
10
|
+
|
11
|
+
End the current Pry session (popping all bindings and returning to caller).
|
12
|
+
Accepts optional return value.
|
13
|
+
BANNER
|
14
|
+
|
15
|
+
def process
|
16
|
+
# calculate user-given value
|
17
|
+
exit_value = target.eval(arg_string)
|
18
|
+
|
19
|
+
# clear the binding stack
|
20
|
+
_pry_.binding_stack.clear
|
21
|
+
|
22
|
+
# break out of the repl loop
|
23
|
+
throw(:breakout, exit_value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
Pry::Commands.add_command(Pry::Command::ExitAll)
|
28
|
+
Pry::Commands.alias_command '!!@', 'exit-all'
|
29
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::ExitProgram < Pry::ClassCommand
|
3
|
+
match 'exit-program'
|
4
|
+
group 'Navigating Pry'
|
5
|
+
description 'End the current program.'
|
6
|
+
|
7
|
+
banner <<-'BANNER'
|
8
|
+
Usage: exit-program [--help]
|
9
|
+
Aliases: quit-program
|
10
|
+
!!!
|
11
|
+
|
12
|
+
End the current program.
|
13
|
+
BANNER
|
14
|
+
|
15
|
+
def process
|
16
|
+
Kernel.exit target.eval(arg_string).to_i
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
Pry::Commands.add_command(Pry::Command::ExitProgram)
|
21
|
+
Pry::Commands.alias_command 'quit-program', 'exit-program'
|
22
|
+
Pry::Commands.alias_command '!!!', 'exit-program'
|
23
|
+
end
|
@@ -0,0 +1,191 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::FindMethod < Pry::ClassCommand
|
3
|
+
extend Pry::Helpers::BaseHelpers
|
4
|
+
|
5
|
+
match 'find-method'
|
6
|
+
group 'Context'
|
7
|
+
description 'Recursively search for a method within a Class/Module or the current namespace.'
|
8
|
+
command_options shellwords: false
|
9
|
+
|
10
|
+
banner <<-'BANNER'
|
11
|
+
Usage: find-method [-n|-c] METHOD [NAMESPACE]
|
12
|
+
|
13
|
+
Recursively search for a method within a Class/Module or the current namespace.
|
14
|
+
Use the `-n` switch (the default) to search for methods whose name matches the
|
15
|
+
given regex. Use the `-c` switch to search for methods that contain the given
|
16
|
+
code.
|
17
|
+
|
18
|
+
# Find all methods whose name match /re/ inside
|
19
|
+
# the Pry namespace. Matches Pry#repl, etc.
|
20
|
+
find-method re Pry
|
21
|
+
|
22
|
+
# Find all methods that contain the code:
|
23
|
+
# output.puts inside the Pry namespace.
|
24
|
+
find-method -c 'output.puts' Pry
|
25
|
+
BANNER
|
26
|
+
|
27
|
+
def options(opt)
|
28
|
+
opt.on :n, :name, "Search for a method by name"
|
29
|
+
opt.on :c, :content, "Search for a method based on content in Regex form"
|
30
|
+
end
|
31
|
+
|
32
|
+
def process
|
33
|
+
return if args.size < 1
|
34
|
+
|
35
|
+
klass = search_class
|
36
|
+
|
37
|
+
matches = opts.content? ? content_search(klass) : name_search(klass)
|
38
|
+
show_search_results(matches)
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
# @return [Regexp] The pattern to search for.
|
44
|
+
def pattern
|
45
|
+
@pattern ||= ::Regexp.new args[0]
|
46
|
+
end
|
47
|
+
|
48
|
+
# Output the result of the search.
|
49
|
+
#
|
50
|
+
# @param [Array] matches
|
51
|
+
def show_search_results(matches)
|
52
|
+
if matches.empty?
|
53
|
+
output.puts bold("No Methods Matched")
|
54
|
+
else
|
55
|
+
print_matches(matches)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# The class to search for methods.
|
60
|
+
# We only search classes, so if the search object is an
|
61
|
+
# instance, return its class. If no search object is given
|
62
|
+
# search `target_self`.
|
63
|
+
def search_class
|
64
|
+
klass = if args[1]
|
65
|
+
target.eval(args[1])
|
66
|
+
else
|
67
|
+
target_self
|
68
|
+
end
|
69
|
+
|
70
|
+
klass.is_a?(Module) ? klass : klass.class
|
71
|
+
end
|
72
|
+
|
73
|
+
# pretty-print a list of matching methods.
|
74
|
+
#
|
75
|
+
# @param [Array<Method>] matches
|
76
|
+
def print_matches(matches)
|
77
|
+
grouped = matches.group_by(&:owner)
|
78
|
+
order = grouped.keys.sort_by { |x| x.name || x.to_s }
|
79
|
+
|
80
|
+
order.each do |klass|
|
81
|
+
print_matches_for_class(klass, grouped)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Print matched methods for a class
|
86
|
+
def print_matches_for_class(klass, grouped)
|
87
|
+
output.puts bold(klass.name)
|
88
|
+
grouped[klass].each do |method|
|
89
|
+
header = method.name_with_owner
|
90
|
+
output.puts header + additional_info(header, method)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# Return the matched lines of method source if `-c` is given or ""
|
95
|
+
# if `-c` was not given
|
96
|
+
def additional_info(header, method)
|
97
|
+
if opts.content?
|
98
|
+
": " << colorize_code(matched_method_lines(header, method))
|
99
|
+
else
|
100
|
+
""
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def matched_method_lines(header, method)
|
105
|
+
method.source.split(/\n/).select { |x| x =~ pattern }.join("\n#{' ' * header.length}")
|
106
|
+
end
|
107
|
+
|
108
|
+
# Run the given block against every constant in the provided namespace.
|
109
|
+
#
|
110
|
+
# @param [Module] klass The namespace in which to start the search.
|
111
|
+
# @param [Hash<Module,Boolean>] done The namespaces we've already visited (private)
|
112
|
+
# @yieldparam klass Each class/module in the namespace.
|
113
|
+
#
|
114
|
+
def recurse_namespace(klass, done = {}, &block)
|
115
|
+
return if !(Module === klass) || done[klass]
|
116
|
+
|
117
|
+
done[klass] = true
|
118
|
+
|
119
|
+
yield klass
|
120
|
+
|
121
|
+
klass.constants.each do |name|
|
122
|
+
next if klass.autoload?(name)
|
123
|
+
|
124
|
+
begin
|
125
|
+
const = klass.const_get(name)
|
126
|
+
rescue RescuableException
|
127
|
+
# constant loading is an inexact science at the best of times,
|
128
|
+
# this often happens when a constant was .autoload? but someone
|
129
|
+
# tried to load it. It's now not .autoload? but will still raise
|
130
|
+
# a NameError when you access it.
|
131
|
+
else
|
132
|
+
recurse_namespace(const, done, &block)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
# Gather all the methods in a namespace that pass the given block.
|
138
|
+
#
|
139
|
+
# @param [Module] namespace The namespace in which to search.
|
140
|
+
# @yieldparam [Method] method The method to test
|
141
|
+
# @yieldreturn [Boolean]
|
142
|
+
# @return [Array<Method>]
|
143
|
+
#
|
144
|
+
def search_all_methods(namespace)
|
145
|
+
done = Hash.new { |h,k| h[k] = {} }
|
146
|
+
matches = []
|
147
|
+
|
148
|
+
recurse_namespace(namespace) do |klass|
|
149
|
+
(Pry::Method.all_from_class(klass) + Pry::Method.all_from_obj(klass)).each do |method|
|
150
|
+
next if done[method.owner][method.name]
|
151
|
+
|
152
|
+
done[method.owner][method.name] = true
|
153
|
+
|
154
|
+
matches << method if yield method
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
matches
|
159
|
+
end
|
160
|
+
|
161
|
+
# Search for all methods with a name that matches the given regex
|
162
|
+
# within a namespace.
|
163
|
+
#
|
164
|
+
# @param [Module] namespace The namespace to search
|
165
|
+
# @return [Array<Method>]
|
166
|
+
#
|
167
|
+
def name_search(namespace)
|
168
|
+
search_all_methods(namespace) do |meth|
|
169
|
+
meth.name =~ pattern
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Search for all methods who's implementation matches the given regex
|
174
|
+
# within a namespace.
|
175
|
+
#
|
176
|
+
# @param [Module] namespace The namespace to search
|
177
|
+
# @return [Array<Method>]
|
178
|
+
#
|
179
|
+
def content_search(namespace)
|
180
|
+
search_all_methods(namespace) do |meth|
|
181
|
+
begin
|
182
|
+
meth.source =~ pattern
|
183
|
+
rescue RescuableException
|
184
|
+
false
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
Pry::Commands.add_command(Pry::Command::FindMethod)
|
191
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::FixIndent < Pry::ClassCommand
|
3
|
+
match 'fix-indent'
|
4
|
+
group 'Input and Output'
|
5
|
+
|
6
|
+
description "Correct the indentation for contents of the input buffer"
|
7
|
+
|
8
|
+
banner <<-USAGE
|
9
|
+
Usage: fix-indent
|
10
|
+
USAGE
|
11
|
+
|
12
|
+
def process
|
13
|
+
indented_str = Pry::Indent.indent(eval_string)
|
14
|
+
eval_string.replace indented_str
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
Pry::Commands.add_command(Pry::Command::FixIndent)
|
19
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::GemCd < Pry::ClassCommand
|
3
|
+
match 'gem-cd'
|
4
|
+
group 'Gems'
|
5
|
+
description "Change working directory to specified gem's directory."
|
6
|
+
command_options argument_required: true
|
7
|
+
|
8
|
+
banner <<-'BANNER'
|
9
|
+
Usage: gem-cd GEM_NAME
|
10
|
+
|
11
|
+
Change the current working directory to that in which the given gem is
|
12
|
+
installed.
|
13
|
+
BANNER
|
14
|
+
|
15
|
+
def process(gem)
|
16
|
+
Dir.chdir(Rubygem.spec(gem).full_gem_path)
|
17
|
+
output.puts(Dir.pwd)
|
18
|
+
end
|
19
|
+
|
20
|
+
def complete(str)
|
21
|
+
Rubygem.complete(str)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
Pry::Commands.add_command(Pry::Command::GemCd)
|
26
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::GemInstall < Pry::ClassCommand
|
3
|
+
match 'gem-install'
|
4
|
+
group 'Gems'
|
5
|
+
description 'Install a gem and refresh the gem cache.'
|
6
|
+
command_options argument_required: true
|
7
|
+
|
8
|
+
banner <<-'BANNER'
|
9
|
+
Usage: gem-install GEM_NAME
|
10
|
+
|
11
|
+
Installs the given gem, refreshes the gem cache, and requires the gem for you
|
12
|
+
based on a best guess from the gem name.
|
13
|
+
|
14
|
+
gem-install pry-stack_explorer
|
15
|
+
BANNER
|
16
|
+
|
17
|
+
def setup
|
18
|
+
require 'rubygems/dependency_installer' unless defined? Gem::DependencyInstaller
|
19
|
+
end
|
20
|
+
|
21
|
+
def process(gem)
|
22
|
+
Rubygem.install(gem)
|
23
|
+
output.puts "Gem `#{ green(gem) }` installed."
|
24
|
+
require gem
|
25
|
+
rescue LoadError
|
26
|
+
require_path = gem.split('-').join('/')
|
27
|
+
require require_path
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
Pry::Commands.add_command(Pry::Command::GemInstall)
|
32
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::GemList < Pry::ClassCommand
|
3
|
+
match 'gem-list'
|
4
|
+
group 'Gems'
|
5
|
+
description 'List and search installed gems.'
|
6
|
+
|
7
|
+
banner <<-'BANNER'
|
8
|
+
Usage: gem-list [REGEX]
|
9
|
+
|
10
|
+
List all installed gems, when a regex is provided, limit the output to those
|
11
|
+
that match the regex.
|
12
|
+
BANNER
|
13
|
+
|
14
|
+
def process(pattern = nil)
|
15
|
+
pattern = Regexp.compile(pattern || '')
|
16
|
+
gems = Rubygem.list(pattern).group_by(&:name)
|
17
|
+
|
18
|
+
gems.each do |gem, specs|
|
19
|
+
specs.sort! do |a,b|
|
20
|
+
Gem::Version.new(b.version) <=> Gem::Version.new(a.version)
|
21
|
+
end
|
22
|
+
|
23
|
+
versions = specs.each_with_index.map do |spec, index|
|
24
|
+
index == 0 ? bright_green(spec.version.to_s) : green(spec.version.to_s)
|
25
|
+
end
|
26
|
+
|
27
|
+
output.puts "#{default gem} (#{versions.join ', '})"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
Pry::Commands.add_command(Pry::Command::GemList)
|
33
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::GemOpen < Pry::ClassCommand
|
3
|
+
match 'gem-open'
|
4
|
+
group 'Gems'
|
5
|
+
description 'Opens the working directory of the gem in your editor.'
|
6
|
+
command_options argument_required: true
|
7
|
+
|
8
|
+
banner <<-'BANNER'
|
9
|
+
Usage: gem-open GEM_NAME
|
10
|
+
|
11
|
+
Change the current working directory to that in which the given gem is
|
12
|
+
installed, and then opens your text editor.
|
13
|
+
|
14
|
+
gem-open pry-exception_explorer
|
15
|
+
BANNER
|
16
|
+
|
17
|
+
def process(gem)
|
18
|
+
Dir.chdir(Rubygem.spec(gem).full_gem_path) do
|
19
|
+
Pry::Editor.new(_pry_).invoke_editor(".", 0, false)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def complete(str)
|
24
|
+
Rubygem.complete(str)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
Pry::Commands.add_command(Pry::Command::GemOpen)
|
29
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Pry::Command::GemReadme < Pry::ClassCommand
|
2
|
+
match 'gem-readme'
|
3
|
+
description 'Show the readme bundled with a rubygem'
|
4
|
+
group 'Gems'
|
5
|
+
command_options argument_required: true
|
6
|
+
banner <<-BANNER
|
7
|
+
gem-readme gem
|
8
|
+
Show the readme bundled with a rubygem
|
9
|
+
BANNER
|
10
|
+
|
11
|
+
def process(name)
|
12
|
+
spec = Gem::Specification.find_by_name(name)
|
13
|
+
glob = File.join(spec.full_gem_path, 'README*')
|
14
|
+
readme = Dir[glob][0]
|
15
|
+
if File.exist?(readme.to_s)
|
16
|
+
_pry_.pager.page File.read(readme)
|
17
|
+
else
|
18
|
+
raise Pry::CommandError, "Gem '#{name}' doesn't appear to have a README"
|
19
|
+
end
|
20
|
+
rescue Gem::LoadError
|
21
|
+
raise Pry::CommandError, "Gem '#{name}' wasn't found. Are you sure it is installed?"
|
22
|
+
end
|
23
|
+
|
24
|
+
Pry::Commands.add_command(self)
|
25
|
+
end
|