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,81 @@
|
|
1
|
+
module CodeRay
|
2
|
+
|
3
|
+
# = Duo
|
4
|
+
#
|
5
|
+
# A Duo is a convenient way to use CodeRay. You just create a Duo,
|
6
|
+
# giving it a lang (language of the input code) and a format (desired
|
7
|
+
# output format), and call Duo#highlight with the code.
|
8
|
+
#
|
9
|
+
# Duo makes it easy to re-use both scanner and encoder for a repetitive
|
10
|
+
# task. It also provides a very easy interface syntax:
|
11
|
+
#
|
12
|
+
# require 'coderay'
|
13
|
+
# CodeRay::Duo[:python, :div].highlight 'import this'
|
14
|
+
#
|
15
|
+
# Until you want to do uncommon things with CodeRay, I recommend to use
|
16
|
+
# this method, since it takes care of everything.
|
17
|
+
class Duo
|
18
|
+
|
19
|
+
attr_accessor :lang, :format, :options
|
20
|
+
|
21
|
+
# Create a new Duo, holding a lang and a format to highlight code.
|
22
|
+
#
|
23
|
+
# simple:
|
24
|
+
# CodeRay::Duo[:ruby, :html].highlight 'bla 42'
|
25
|
+
#
|
26
|
+
# with options:
|
27
|
+
# CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??'
|
28
|
+
#
|
29
|
+
# alternative syntax without options:
|
30
|
+
# CodeRay::Duo[:ruby => :statistic].encode 'class << self; end'
|
31
|
+
#
|
32
|
+
# alternative syntax with options:
|
33
|
+
# CodeRay::Duo[{ :ruby => :statistic }, :do => :something].encode 'abc'
|
34
|
+
#
|
35
|
+
# The options are forwarded to scanner and encoder
|
36
|
+
# (see CodeRay.get_scanner_options).
|
37
|
+
def initialize lang = nil, format = nil, options = {}
|
38
|
+
if format.nil? && lang.is_a?(Hash) && lang.size == 1
|
39
|
+
@lang = lang.keys.first
|
40
|
+
@format = lang[@lang]
|
41
|
+
else
|
42
|
+
@lang = lang
|
43
|
+
@format = format
|
44
|
+
end
|
45
|
+
@options = options
|
46
|
+
end
|
47
|
+
|
48
|
+
class << self
|
49
|
+
# To allow calls like Duo[:ruby, :html].highlight.
|
50
|
+
alias [] new
|
51
|
+
end
|
52
|
+
|
53
|
+
# The scanner of the duo. Only created once.
|
54
|
+
def scanner
|
55
|
+
@scanner ||= CodeRay.scanner @lang, CodeRay.get_scanner_options(@options)
|
56
|
+
end
|
57
|
+
|
58
|
+
# The encoder of the duo. Only created once.
|
59
|
+
def encoder
|
60
|
+
@encoder ||= CodeRay.encoder @format, @options
|
61
|
+
end
|
62
|
+
|
63
|
+
# Tokenize and highlight the code using +scanner+ and +encoder+.
|
64
|
+
def encode code, options = {}
|
65
|
+
options = @options.merge options
|
66
|
+
encoder.encode(code, @lang, options)
|
67
|
+
end
|
68
|
+
alias highlight encode
|
69
|
+
|
70
|
+
# Allows to use Duo like a proc object:
|
71
|
+
#
|
72
|
+
# CodeRay::Duo[:python => :yaml].call(code)
|
73
|
+
#
|
74
|
+
# or, in Ruby 1.9 and later:
|
75
|
+
#
|
76
|
+
# CodeRay::Duo[:python => :yaml].(code)
|
77
|
+
alias call encode
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module CodeRay
|
2
|
+
module Encoders
|
3
|
+
|
4
|
+
map \
|
5
|
+
:loc => :lines_of_code,
|
6
|
+
:plain => :text,
|
7
|
+
:plaintext => :text,
|
8
|
+
:remove_comments => :comment_filter,
|
9
|
+
:stats => :statistic,
|
10
|
+
:term => :terminal,
|
11
|
+
:tty => :terminal,
|
12
|
+
:yml => :yaml
|
13
|
+
|
14
|
+
# No default because Tokens#nonsense should raise NoMethodError.
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module CodeRay
|
2
|
+
module Encoders
|
3
|
+
|
4
|
+
load :token_kind_filter
|
5
|
+
|
6
|
+
# A simple Filter that removes all tokens of the :comment kind.
|
7
|
+
#
|
8
|
+
# Alias: +remove_comments+
|
9
|
+
#
|
10
|
+
# Usage:
|
11
|
+
# CodeRay.scan('print # foo', :ruby).comment_filter.text
|
12
|
+
# #-> "print "
|
13
|
+
#
|
14
|
+
# See also: TokenKindFilter, LinesOfCode
|
15
|
+
class CommentFilter < TokenKindFilter
|
16
|
+
|
17
|
+
register_for :comment_filter
|
18
|
+
|
19
|
+
DEFAULT_OPTIONS = superclass::DEFAULT_OPTIONS.merge \
|
20
|
+
:exclude => [:comment, :docstring]
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module CodeRay
|
2
|
+
module Encoders
|
3
|
+
|
4
|
+
# Returns the number of tokens.
|
5
|
+
#
|
6
|
+
# Text and block tokens are counted.
|
7
|
+
class Count < Encoder
|
8
|
+
|
9
|
+
register_for :count
|
10
|
+
|
11
|
+
protected
|
12
|
+
|
13
|
+
def setup options
|
14
|
+
super
|
15
|
+
|
16
|
+
@count = 0
|
17
|
+
end
|
18
|
+
|
19
|
+
def finish options
|
20
|
+
output @count
|
21
|
+
end
|
22
|
+
|
23
|
+
public
|
24
|
+
|
25
|
+
def text_token text, kind
|
26
|
+
@count += 1
|
27
|
+
end
|
28
|
+
|
29
|
+
def begin_group kind
|
30
|
+
@count += 1
|
31
|
+
end
|
32
|
+
alias end_group begin_group
|
33
|
+
alias begin_line begin_group
|
34
|
+
alias end_line begin_group
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module CodeRay
|
2
|
+
module Encoders
|
3
|
+
|
4
|
+
# = Debug Encoder
|
5
|
+
#
|
6
|
+
# Fast encoder producing simple debug output.
|
7
|
+
#
|
8
|
+
# It is readable and diff-able and is used for testing.
|
9
|
+
#
|
10
|
+
# You cannot fully restore the tokens information from the
|
11
|
+
# output, because consecutive :space tokens are merged.
|
12
|
+
#
|
13
|
+
# See also: Scanners::Debug
|
14
|
+
class Debug < Encoder
|
15
|
+
|
16
|
+
register_for :debug
|
17
|
+
|
18
|
+
FILE_EXTENSION = 'raydebug'
|
19
|
+
|
20
|
+
def text_token text, kind
|
21
|
+
if kind == :space
|
22
|
+
@out << text
|
23
|
+
else
|
24
|
+
text = text.gsub('\\', '\\\\\\\\') if text.index('\\')
|
25
|
+
text = text.gsub(')', '\\\\)') if text.index(')')
|
26
|
+
@out << "#{kind}(#{text})"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def begin_group kind
|
31
|
+
@out << "#{kind}<"
|
32
|
+
end
|
33
|
+
|
34
|
+
def end_group kind
|
35
|
+
@out << '>'
|
36
|
+
end
|
37
|
+
|
38
|
+
def begin_line kind
|
39
|
+
@out << "#{kind}["
|
40
|
+
end
|
41
|
+
|
42
|
+
def end_line kind
|
43
|
+
@out << ']'
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module CodeRay
|
2
|
+
module Encoders
|
3
|
+
|
4
|
+
load :lint
|
5
|
+
|
6
|
+
# = Debug Lint Encoder
|
7
|
+
#
|
8
|
+
# Debug encoder with additional checks for:
|
9
|
+
#
|
10
|
+
# - empty tokens
|
11
|
+
# - incorrect nesting
|
12
|
+
#
|
13
|
+
# It will raise an InvalidTokenStream exception when any of the above occurs.
|
14
|
+
#
|
15
|
+
# See also: Encoders::Debug
|
16
|
+
class DebugLint < Debug
|
17
|
+
|
18
|
+
register_for :debug_lint
|
19
|
+
|
20
|
+
def text_token text, kind
|
21
|
+
raise Lint::EmptyToken, 'empty token for %p' % [kind] if text.empty?
|
22
|
+
raise Lint::UnknownTokenKind, 'unknown token kind %p (text was %p)' % [kind, text] unless TokenKinds.has_key? kind
|
23
|
+
super
|
24
|
+
end
|
25
|
+
|
26
|
+
def begin_group kind
|
27
|
+
@opened << kind
|
28
|
+
super
|
29
|
+
end
|
30
|
+
|
31
|
+
def end_group kind
|
32
|
+
raise Lint::IncorrectTokenGroupNesting, 'We are inside %s, not %p (end_group)' % [@opened.reverse.map(&:inspect).join(' < '), kind] if @opened.last != kind
|
33
|
+
@opened.pop
|
34
|
+
super
|
35
|
+
end
|
36
|
+
|
37
|
+
def begin_line kind
|
38
|
+
@opened << kind
|
39
|
+
super
|
40
|
+
end
|
41
|
+
|
42
|
+
def end_line kind
|
43
|
+
raise Lint::IncorrectTokenGroupNesting, 'We are inside %s, not %p (end_line)' % [@opened.reverse.map(&:inspect).join(' < '), kind] if @opened.last != kind
|
44
|
+
@opened.pop
|
45
|
+
super
|
46
|
+
end
|
47
|
+
|
48
|
+
protected
|
49
|
+
|
50
|
+
def setup options
|
51
|
+
super
|
52
|
+
@opened = []
|
53
|
+
end
|
54
|
+
|
55
|
+
def finish options
|
56
|
+
raise 'Some tokens still open at end of token stream: %p' % [@opened] unless @opened.empty?
|
57
|
+
super
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module CodeRay
|
2
|
+
module Encoders
|
3
|
+
|
4
|
+
load :html
|
5
|
+
|
6
|
+
# Wraps HTML output into a DIV element, using inline styles by default.
|
7
|
+
#
|
8
|
+
# See Encoders::HTML for available options.
|
9
|
+
class Div < HTML
|
10
|
+
|
11
|
+
FILE_EXTENSION = 'div.html'
|
12
|
+
|
13
|
+
register_for :div
|
14
|
+
|
15
|
+
DEFAULT_OPTIONS = HTML::DEFAULT_OPTIONS.merge \
|
16
|
+
:css => :style,
|
17
|
+
:wrap => :div,
|
18
|
+
:line_numbers => false
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,190 @@
|
|
1
|
+
module CodeRay
|
2
|
+
module Encoders
|
3
|
+
|
4
|
+
# = Encoder
|
5
|
+
#
|
6
|
+
# The Encoder base class. Together with Scanner and
|
7
|
+
# Tokens, it forms the highlighting triad.
|
8
|
+
#
|
9
|
+
# Encoder instances take a Tokens object and do something with it.
|
10
|
+
#
|
11
|
+
# The most common Encoder is surely the HTML encoder
|
12
|
+
# (CodeRay::Encoders::HTML). It highlights the code in a colorful
|
13
|
+
# html page.
|
14
|
+
# If you want the highlighted code in a div or a span instead,
|
15
|
+
# use its subclasses Div and Span.
|
16
|
+
class Encoder
|
17
|
+
extend Plugin
|
18
|
+
plugin_host Encoders
|
19
|
+
|
20
|
+
class << self
|
21
|
+
|
22
|
+
# If FILE_EXTENSION isn't defined, this method returns the
|
23
|
+
# downcase class name instead.
|
24
|
+
def const_missing sym
|
25
|
+
if sym == :FILE_EXTENSION
|
26
|
+
(defined?(@plugin_id) && @plugin_id || name[/\w+$/].downcase).to_s
|
27
|
+
else
|
28
|
+
super
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# The default file extension for output file of this encoder class.
|
33
|
+
def file_extension
|
34
|
+
self::FILE_EXTENSION
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
# Subclasses are to store their default options in this constant.
|
40
|
+
DEFAULT_OPTIONS = { }
|
41
|
+
|
42
|
+
# The options you gave the Encoder at creating.
|
43
|
+
attr_accessor :options, :scanner
|
44
|
+
|
45
|
+
# Creates a new Encoder.
|
46
|
+
# +options+ is saved and used for all encode operations, as long
|
47
|
+
# as you don't overwrite it there by passing additional options.
|
48
|
+
#
|
49
|
+
# Encoder objects provide three encode methods:
|
50
|
+
# - encode simply takes a +code+ string and a +lang+
|
51
|
+
# - encode_tokens expects a +tokens+ object instead
|
52
|
+
#
|
53
|
+
# Each method has an optional +options+ parameter. These are
|
54
|
+
# added to the options you passed at creation.
|
55
|
+
def initialize options = {}
|
56
|
+
@options = self.class::DEFAULT_OPTIONS.merge options
|
57
|
+
@@CODERAY_TOKEN_INTERFACE_DEPRECATION_WARNING_GIVEN = false
|
58
|
+
end
|
59
|
+
|
60
|
+
# Encode a Tokens object.
|
61
|
+
def encode_tokens tokens, options = {}
|
62
|
+
options = @options.merge options
|
63
|
+
@scanner = tokens.scanner if tokens.respond_to? :scanner
|
64
|
+
setup options
|
65
|
+
compile tokens, options
|
66
|
+
finish options
|
67
|
+
end
|
68
|
+
|
69
|
+
# Encode the given +code+ using the Scanner for +lang+.
|
70
|
+
def encode code, lang, options = {}
|
71
|
+
options = @options.merge options
|
72
|
+
@scanner = Scanners[lang].new code, CodeRay.get_scanner_options(options).update(:tokens => self)
|
73
|
+
setup options
|
74
|
+
@scanner.tokenize
|
75
|
+
finish options
|
76
|
+
end
|
77
|
+
|
78
|
+
# You can use highlight instead of encode, if that seems
|
79
|
+
# more clear to you.
|
80
|
+
alias highlight encode
|
81
|
+
|
82
|
+
# The default file extension for this encoder.
|
83
|
+
def file_extension
|
84
|
+
self.class.file_extension
|
85
|
+
end
|
86
|
+
|
87
|
+
def << token
|
88
|
+
unless @@CODERAY_TOKEN_INTERFACE_DEPRECATION_WARNING_GIVEN
|
89
|
+
warn 'Using old Tokens#<< interface.'
|
90
|
+
@@CODERAY_TOKEN_INTERFACE_DEPRECATION_WARNING_GIVEN = true
|
91
|
+
end
|
92
|
+
self.token(*token)
|
93
|
+
end
|
94
|
+
|
95
|
+
# Called with +content+ and +kind+ of the currently scanned token.
|
96
|
+
# For simple scanners, it's enougth to implement this method.
|
97
|
+
#
|
98
|
+
# By default, it calls text_token, begin_group, end_group, begin_line,
|
99
|
+
# or end_line, depending on the +content+.
|
100
|
+
def token content, kind
|
101
|
+
case content
|
102
|
+
when String
|
103
|
+
text_token content, kind
|
104
|
+
when :begin_group
|
105
|
+
begin_group kind
|
106
|
+
when :end_group
|
107
|
+
end_group kind
|
108
|
+
when :begin_line
|
109
|
+
begin_line kind
|
110
|
+
when :end_line
|
111
|
+
end_line kind
|
112
|
+
else
|
113
|
+
raise ArgumentError, 'Unknown token content type: %p, kind = %p' % [content, kind]
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# Called for each text token ([text, kind]), where text is a String.
|
118
|
+
def text_token text, kind
|
119
|
+
@out << text
|
120
|
+
end
|
121
|
+
|
122
|
+
# Starts a token group with the given +kind+.
|
123
|
+
def begin_group kind
|
124
|
+
end
|
125
|
+
|
126
|
+
# Ends a token group with the given +kind+.
|
127
|
+
def end_group kind
|
128
|
+
end
|
129
|
+
|
130
|
+
# Starts a new line token group with the given +kind+.
|
131
|
+
def begin_line kind
|
132
|
+
end
|
133
|
+
|
134
|
+
# Ends a new line token group with the given +kind+.
|
135
|
+
def end_line kind
|
136
|
+
end
|
137
|
+
|
138
|
+
protected
|
139
|
+
|
140
|
+
# Called with merged options before encoding starts.
|
141
|
+
# Sets @out to an empty string.
|
142
|
+
#
|
143
|
+
# See the HTML Encoder for an example of option caching.
|
144
|
+
def setup options
|
145
|
+
@out = get_output(options)
|
146
|
+
end
|
147
|
+
|
148
|
+
def get_output options
|
149
|
+
options[:out] || ''.dup
|
150
|
+
end
|
151
|
+
|
152
|
+
# Append data.to_s to the output. Returns the argument.
|
153
|
+
def output data
|
154
|
+
@out << data.to_s
|
155
|
+
data
|
156
|
+
end
|
157
|
+
|
158
|
+
# Called with merged options after encoding starts.
|
159
|
+
# The return value is the result of encoding, typically @out.
|
160
|
+
def finish options
|
161
|
+
@out
|
162
|
+
end
|
163
|
+
|
164
|
+
# Do the encoding.
|
165
|
+
#
|
166
|
+
# The already created +tokens+ object must be used; it must be a
|
167
|
+
# Tokens object.
|
168
|
+
def compile tokens, options = {}
|
169
|
+
content = nil
|
170
|
+
for item in tokens
|
171
|
+
if item.is_a? Array
|
172
|
+
raise ArgumentError, 'Two-element array tokens are no longer supported.'
|
173
|
+
end
|
174
|
+
if content
|
175
|
+
token content, item
|
176
|
+
content = nil
|
177
|
+
else
|
178
|
+
content = item
|
179
|
+
end
|
180
|
+
end
|
181
|
+
raise 'odd number list for Tokens' if content
|
182
|
+
end
|
183
|
+
|
184
|
+
alias tokens compile
|
185
|
+
public :tokens
|
186
|
+
|
187
|
+
end
|
188
|
+
|
189
|
+
end
|
190
|
+
end
|