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,23 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::ImportSet < Pry::ClassCommand
|
3
|
+
match 'import-set'
|
4
|
+
group 'Commands'
|
5
|
+
# TODO: Provide a better description with examples and a general conception
|
6
|
+
# of this command.
|
7
|
+
description 'Import a Pry command set.'
|
8
|
+
|
9
|
+
banner <<-'BANNER'
|
10
|
+
Import a Pry command set.
|
11
|
+
BANNER
|
12
|
+
|
13
|
+
# TODO: resolve unused parameter.
|
14
|
+
def process(_command_set_name)
|
15
|
+
raise CommandError, "Provide a command set name" if command_set.nil?
|
16
|
+
|
17
|
+
set = target.eval(arg_string)
|
18
|
+
_pry_.commands.import set
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
Pry::Commands.add_command(Pry::Command::ImportSet)
|
23
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::InstallCommand < Pry::ClassCommand
|
3
|
+
match 'install-command'
|
4
|
+
group 'Commands'
|
5
|
+
description 'Install a disabled command.'
|
6
|
+
|
7
|
+
banner <<-'BANNER'
|
8
|
+
Usage: install-command COMMAND
|
9
|
+
|
10
|
+
Installs the gems necessary to run the given COMMAND. You will generally not
|
11
|
+
need to run this unless told to by an error message.
|
12
|
+
BANNER
|
13
|
+
|
14
|
+
def process(name)
|
15
|
+
require 'rubygems/dependency_installer' unless defined? Gem::DependencyInstaller
|
16
|
+
command = find_command(name)
|
17
|
+
|
18
|
+
unless command
|
19
|
+
output.puts "Command #{ green(name) } is not found"
|
20
|
+
return
|
21
|
+
end
|
22
|
+
|
23
|
+
if command_dependencies_met?(command.options)
|
24
|
+
output.puts "Dependencies for #{ green(name) } are met. Nothing to do"
|
25
|
+
return
|
26
|
+
end
|
27
|
+
|
28
|
+
output.puts "Attempting to install #{ green(name) } command..."
|
29
|
+
gems_to_install = Array(command.options[:requires_gem])
|
30
|
+
|
31
|
+
gems_to_install.each do |g|
|
32
|
+
next if Rubygem.installed?(g)
|
33
|
+
|
34
|
+
output.puts "Installing #{ green(g) } gem..."
|
35
|
+
Rubygem.install(g)
|
36
|
+
end
|
37
|
+
|
38
|
+
gems_to_install.each do |g|
|
39
|
+
begin
|
40
|
+
require g
|
41
|
+
rescue LoadError
|
42
|
+
fail_msg = "Required gem #{ green(g) } installed but not found."
|
43
|
+
fail_msg += " Aborting command installation\n"
|
44
|
+
fail_msg += 'Tips: 1. Check your PATH; 2. Run `bundle update`'
|
45
|
+
raise CommandError, fail_msg
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
output.puts "Installation of #{ green(name) } successful! Type `help #{name}` for information"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
Pry::Commands.add_command(Pry::Command::InstallCommand)
|
54
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::JumpTo < Pry::ClassCommand
|
3
|
+
match 'jump-to'
|
4
|
+
group 'Navigating Pry'
|
5
|
+
description 'Jump to a binding further up the stack.'
|
6
|
+
|
7
|
+
banner <<-'BANNER'
|
8
|
+
Jump to a binding further up the stack, popping all bindings below.
|
9
|
+
BANNER
|
10
|
+
|
11
|
+
def process(break_level)
|
12
|
+
break_level = break_level.to_i
|
13
|
+
nesting_level = _pry_.binding_stack.size - 1
|
14
|
+
max_nest_level = nesting_level - 1
|
15
|
+
|
16
|
+
case break_level
|
17
|
+
when nesting_level
|
18
|
+
output.puts "Already at nesting level #{nesting_level}"
|
19
|
+
when 0..max_nest_level
|
20
|
+
_pry_.binding_stack = _pry_.binding_stack[0..break_level]
|
21
|
+
else
|
22
|
+
output.puts "Invalid nest level. Must be between 0 and " \
|
23
|
+
"#{max_nest_level}. Got #{break_level}."
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
Pry::Commands.add_command(Pry::Command::JumpTo)
|
29
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class Pry::Command::ListInspectors < Pry::ClassCommand
|
2
|
+
match 'list-inspectors'
|
3
|
+
group 'Input and Output'
|
4
|
+
description 'List the inspector procs available for use.'
|
5
|
+
banner <<-BANNER
|
6
|
+
Usage: list-inspectors
|
7
|
+
|
8
|
+
List the inspector procs available to print return values. You can use
|
9
|
+
change-inspector to switch between them.
|
10
|
+
BANNER
|
11
|
+
|
12
|
+
def process
|
13
|
+
output.puts heading("Available inspectors") + "\n"
|
14
|
+
inspector_map.each do |name, inspector|
|
15
|
+
output.write "Name: #{bold(name)}"
|
16
|
+
output.puts selected_inspector?(inspector) ? selected_text : ""
|
17
|
+
output.puts inspector[:description]
|
18
|
+
output.puts
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
def inspector_map
|
24
|
+
Pry::Inspector::MAP
|
25
|
+
end
|
26
|
+
|
27
|
+
def selected_text
|
28
|
+
red " (selected) "
|
29
|
+
end
|
30
|
+
|
31
|
+
def selected_inspector?(inspector)
|
32
|
+
_pry_.print == inspector[:value]
|
33
|
+
end
|
34
|
+
Pry::Commands.add_command(self)
|
35
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'pry/commands/ls/interrogatable'
|
2
|
+
|
3
|
+
class Pry
|
4
|
+
class Command::Ls < Pry::ClassCommand
|
5
|
+
class Constants < Pry::Command::Ls::Formatter
|
6
|
+
DEPRECATED_CONSTANTS = [:Data, :Fixnum, :Bignum, :TimeoutError, :NIL, :FALSE, :TRUE]
|
7
|
+
DEPRECATED_CONSTANTS << :JavaPackageModuleTemplate if Helpers::Platform.jruby?
|
8
|
+
include Pry::Command::Ls::Interrogatable
|
9
|
+
|
10
|
+
def initialize(interrogatee, no_user_opts, opts, _pry_)
|
11
|
+
super(_pry_)
|
12
|
+
@interrogatee = interrogatee
|
13
|
+
@no_user_opts = no_user_opts
|
14
|
+
@default_switch = opts[:constants]
|
15
|
+
@verbose_switch = opts[:verbose]
|
16
|
+
@dconstants = opts.dconstants?
|
17
|
+
end
|
18
|
+
|
19
|
+
def correct_opts?
|
20
|
+
super || (@no_user_opts && interrogating_a_module?)
|
21
|
+
end
|
22
|
+
|
23
|
+
def output_self
|
24
|
+
mod = interrogatee_mod
|
25
|
+
constants = WrappedModule.new(mod).constants(@verbose_switch)
|
26
|
+
output_section('constants', grep.regexp[format(mod, constants)])
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def show_deprecated_constants?
|
32
|
+
@dconstants == true
|
33
|
+
end
|
34
|
+
|
35
|
+
def format(mod, constants)
|
36
|
+
constants.sort_by(&:downcase).map do |name|
|
37
|
+
if Object.respond_to?(:deprecate_constant) and
|
38
|
+
DEPRECATED_CONSTANTS.include?(name) and
|
39
|
+
!show_deprecated_constants?
|
40
|
+
next
|
41
|
+
end
|
42
|
+
|
43
|
+
if (const = (!mod.autoload?(name) && (mod.const_get(name) || true) rescue nil))
|
44
|
+
if (const < Exception rescue false)
|
45
|
+
color(:exception_constant, name)
|
46
|
+
elsif (Module === mod.const_get(name) rescue false)
|
47
|
+
color(:class_constant, name)
|
48
|
+
else
|
49
|
+
color(:constant, name)
|
50
|
+
end
|
51
|
+
else
|
52
|
+
color(:unloaded_constant, name)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::Ls < Pry::ClassCommand
|
3
|
+
class Formatter
|
4
|
+
attr_writer :grep
|
5
|
+
attr_reader :_pry_
|
6
|
+
|
7
|
+
def initialize(_pry_)
|
8
|
+
@_pry_ = _pry_
|
9
|
+
@target = _pry_.current_context
|
10
|
+
@default_switch = nil
|
11
|
+
end
|
12
|
+
|
13
|
+
def write_out
|
14
|
+
return false unless correct_opts?
|
15
|
+
|
16
|
+
output_self
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def color(type, str)
|
22
|
+
Pry::Helpers::Text.send _pry_.config.ls["#{type}_color"], str
|
23
|
+
end
|
24
|
+
|
25
|
+
# Add a new section to the output.
|
26
|
+
# Outputs nothing if the section would be empty.
|
27
|
+
def output_section(heading, body)
|
28
|
+
return '' if body.compact.empty?
|
29
|
+
|
30
|
+
fancy_heading = Pry::Helpers::Text.bold(color(:heading, heading))
|
31
|
+
Pry::Helpers.tablify_or_one_line(fancy_heading, body, @_pry_.config)
|
32
|
+
end
|
33
|
+
|
34
|
+
def format_value(value)
|
35
|
+
Pry::ColorPrinter.pp(value, '')
|
36
|
+
end
|
37
|
+
|
38
|
+
def correct_opts?
|
39
|
+
@default_switch
|
40
|
+
end
|
41
|
+
|
42
|
+
def output_self
|
43
|
+
raise NotImplementedError
|
44
|
+
end
|
45
|
+
|
46
|
+
def grep
|
47
|
+
@grep || proc { |x| x }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::Ls < Pry::ClassCommand
|
3
|
+
class Globals < Pry::Command::Ls::Formatter
|
4
|
+
# Taken from "puts global_variables.inspect".
|
5
|
+
BUILTIN_GLOBALS =
|
6
|
+
%w($" $$ $* $, $-0 $-F $-I $-K $-W $-a $-d $-i $-l $-p $-v $-w $. $/ $\\
|
7
|
+
$: $; $< $= $> $0 $ARGV $CONSOLE $DEBUG $DEFAULT_INPUT $DEFAULT_OUTPUT
|
8
|
+
$FIELD_SEPARATOR $FILENAME $FS $IGNORECASE $INPUT_LINE_NUMBER
|
9
|
+
$INPUT_RECORD_SEPARATOR $KCODE $LOADED_FEATURES $LOAD_PATH $NR $OFS
|
10
|
+
$ORS $OUTPUT_FIELD_SEPARATOR $OUTPUT_RECORD_SEPARATOR $PID $PROCESS_ID
|
11
|
+
$PROGRAM_NAME $RS $VERBOSE $deferr $defout $stderr $stdin $stdout)
|
12
|
+
|
13
|
+
# `$SAFE` and `$?` are thread-local, the exception stuff only works in a
|
14
|
+
# rescue clause, everything else is basically a local variable with a `$`
|
15
|
+
# in its name.
|
16
|
+
PSEUDO_GLOBALS =
|
17
|
+
%w($! $' $& $` $@ $? $+ $_ $~ $1 $2 $3 $4 $5 $6 $7 $8 $9
|
18
|
+
$CHILD_STATUS $SAFE $ERROR_INFO $ERROR_POSITION $LAST_MATCH_INFO
|
19
|
+
$LAST_PAREN_MATCH $LAST_READ_LINE $MATCH $POSTMATCH $PREMATCH)
|
20
|
+
|
21
|
+
def initialize(opts, _pry_)
|
22
|
+
super(_pry_)
|
23
|
+
@default_switch = opts[:globals]
|
24
|
+
end
|
25
|
+
|
26
|
+
def output_self
|
27
|
+
variables = format(@target.eval('global_variables'))
|
28
|
+
output_section('global variables', grep.regexp[variables])
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def format(globals)
|
34
|
+
globals.map(&:to_s).sort_by(&:downcase).map do |name|
|
35
|
+
if PSEUDO_GLOBALS.include?(name)
|
36
|
+
color(:pseudo_global, name)
|
37
|
+
elsif BUILTIN_GLOBALS.include?(name)
|
38
|
+
color(:builtin_global, name)
|
39
|
+
else
|
40
|
+
color(:global_var, name)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::Ls < Pry::ClassCommand
|
3
|
+
class Grep
|
4
|
+
def initialize(grep_regexp)
|
5
|
+
@grep_regexp = grep_regexp
|
6
|
+
end
|
7
|
+
|
8
|
+
def regexp
|
9
|
+
proc { |x|
|
10
|
+
if x.instance_of?(Array)
|
11
|
+
x.grep(@grep_regexp)
|
12
|
+
else
|
13
|
+
x =~ @grep_regexp
|
14
|
+
end
|
15
|
+
}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'pry/commands/ls/interrogatable'
|
2
|
+
|
3
|
+
class Pry
|
4
|
+
class Command::Ls < Pry::ClassCommand
|
5
|
+
class InstanceVars < Pry::Command::Ls::Formatter
|
6
|
+
include Pry::Command::Ls::Interrogatable
|
7
|
+
|
8
|
+
def initialize(interrogatee, no_user_opts, opts, _pry_)
|
9
|
+
super(_pry_)
|
10
|
+
@interrogatee = interrogatee
|
11
|
+
@no_user_opts = no_user_opts
|
12
|
+
@default_switch = opts[:ivars]
|
13
|
+
end
|
14
|
+
|
15
|
+
def correct_opts?
|
16
|
+
super || @no_user_opts
|
17
|
+
end
|
18
|
+
|
19
|
+
def output_self
|
20
|
+
ivars = if Object === @interrogatee
|
21
|
+
Pry::Method.safe_send(@interrogatee, :instance_variables)
|
22
|
+
else
|
23
|
+
[] #TODO: BasicObject support
|
24
|
+
end
|
25
|
+
kvars = Pry::Method.safe_send(interrogatee_mod, :class_variables)
|
26
|
+
ivars_out = output_section('instance variables', format(:instance_var, ivars))
|
27
|
+
kvars_out = output_section('class variables', format(:class_var, kvars))
|
28
|
+
ivars_out + kvars_out
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def format(type, vars)
|
34
|
+
vars.sort_by { |var| var.to_s.downcase }.map { |var| color(type, var) }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Pry::Command::Ls::Interrogatable
|
2
|
+
|
3
|
+
private
|
4
|
+
|
5
|
+
def interrogating_a_module?
|
6
|
+
Module === @interrogatee
|
7
|
+
end
|
8
|
+
|
9
|
+
def interrogatee_mod
|
10
|
+
if interrogating_a_module?
|
11
|
+
@interrogatee
|
12
|
+
else
|
13
|
+
singleton = Pry::Method.singleton_class_of(@interrogatee)
|
14
|
+
singleton.ancestors.grep(::Class).reject { |c| c == singleton }.first
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Pry::Command::Ls::JRubyHacks
|
2
|
+
|
3
|
+
private
|
4
|
+
|
5
|
+
# JRuby creates lots of aliases for methods imported from java in an attempt
|
6
|
+
# to make life easier for ruby programmers. (e.g. getFooBar becomes
|
7
|
+
# get_foo_bar and foo_bar, and maybe foo_bar? if it returns a Boolean). The
|
8
|
+
# full transformations are in the assignAliases method of:
|
9
|
+
# https://github.com/jruby/jruby/blob/master/src/org/jruby/javasupport/JavaClass.java
|
10
|
+
#
|
11
|
+
# This has the unfortunate side-effect of making the output of ls even more
|
12
|
+
# incredibly verbose than it normally would be for these objects; and so we
|
13
|
+
# filter out all but the nicest of these aliases here.
|
14
|
+
#
|
15
|
+
# TODO: This is a little bit vague, better heuristics could be used.
|
16
|
+
# JRuby also has a lot of scala-specific logic, which we don't copy.
|
17
|
+
def trim_jruby_aliases(methods)
|
18
|
+
grouped = methods.group_by do |m|
|
19
|
+
m.name.sub(/\A(is|get|set)(?=[A-Z_])/, '').gsub(/[_?=]/, '').downcase
|
20
|
+
end
|
21
|
+
|
22
|
+
grouped.flat_map do |key, values|
|
23
|
+
values = values.sort_by do |m|
|
24
|
+
rubbishness(m.name)
|
25
|
+
end
|
26
|
+
|
27
|
+
found = []
|
28
|
+
values.select do |x|
|
29
|
+
(!found.any? { |y| x == y }) && found << x
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# When removing jruby aliases, we want to keep the alias that is
|
35
|
+
# "least rubbish" according to this metric.
|
36
|
+
def rubbishness(name)
|
37
|
+
name.each_char.map { |x|
|
38
|
+
case x
|
39
|
+
when /[A-Z]/
|
40
|
+
1
|
41
|
+
when '?', '=', '!'
|
42
|
+
-2
|
43
|
+
else
|
44
|
+
0
|
45
|
+
end
|
46
|
+
}.inject(&:+) + (name.size / 100.0)
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class Pry
|
2
|
+
class Command::Ls < Pry::ClassCommand
|
3
|
+
class LocalNames < Pry::Command::Ls::Formatter
|
4
|
+
def initialize(no_user_opts, args, _pry_)
|
5
|
+
super(_pry_)
|
6
|
+
@no_user_opts = no_user_opts
|
7
|
+
@args = args
|
8
|
+
@sticky_locals = _pry_.sticky_locals
|
9
|
+
end
|
10
|
+
|
11
|
+
def correct_opts?
|
12
|
+
super || (@no_user_opts && @args.empty?)
|
13
|
+
end
|
14
|
+
|
15
|
+
def output_self
|
16
|
+
local_vars = grep.regexp[@target.eval('local_variables')]
|
17
|
+
output_section('locals', format(local_vars))
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def format(locals)
|
23
|
+
locals.sort_by(&:downcase).map do |name|
|
24
|
+
if @sticky_locals.include?(name.to_sym)
|
25
|
+
color(:pry_var, name)
|
26
|
+
else
|
27
|
+
color(:local_var, name)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|