chess_engine 0.0.2 → 0.0.5
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 +4 -4
- data/bin/chess_engine +4 -0
- metadata +5 -288
- data/Gemfile +0 -5
- data/Gemfile.lock +0 -21
- data/README.md +0 -26
- data/chess_engine-0.0.1.gem +0 -0
- data/chess_engine.gemspec +0 -14
- data/lib/chess_engine/board.rb +0 -95
- data/lib/chess_engine/cli.rb +0 -105
- data/lib/chess_engine/game.rb +0 -148
- data/lib/chess_engine/input.rb +0 -19
- data/lib/chess_engine/move.rb +0 -35
- data/lib/chess_engine/piece.rb +0 -97
- data/lib/chess_engine/validator.rb +0 -87
- data/vendor/bundle/bin/coderay +0 -27
- data/vendor/bundle/bin/pry +0 -27
- 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 +0 -22
- data/vendor/bundle/gems/coderay-1.1.2/README_INDEX.rdoc +0 -123
- data/vendor/bundle/gems/coderay-1.1.2/bin/coderay +0 -215
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/duo.rb +0 -81
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/_map.rb +0 -17
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/comment_filter.rb +0 -25
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/count.rb +0 -39
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/debug.rb +0 -49
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/debug_lint.rb +0 -63
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/div.rb +0 -23
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/encoder.rb +0 -190
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/filter.rb +0 -58
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html/css.rb +0 -65
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html/numbering.rb +0 -108
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html/output.rb +0 -166
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/html.rb +0 -333
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/json.rb +0 -83
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/lines_of_code.rb +0 -45
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/lint.rb +0 -59
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/null.rb +0 -18
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/page.rb +0 -24
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/span.rb +0 -23
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/statistic.rb +0 -95
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/terminal.rb +0 -195
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/text.rb +0 -46
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/token_kind_filter.rb +0 -111
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/xml.rb +0 -72
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders/yaml.rb +0 -50
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/encoders.rb +0 -18
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/for_redcloth.rb +0 -95
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/file_type.rb +0 -151
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/plugin.rb +0 -55
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/plugin_host.rb +0 -221
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/helpers/word_list.rb +0 -72
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/_map.rb +0 -24
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/c.rb +0 -189
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/clojure.rb +0 -217
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/cpp.rb +0 -217
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/css.rb +0 -196
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/debug.rb +0 -75
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/delphi.rb +0 -144
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/diff.rb +0 -221
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/erb.rb +0 -81
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/go.rb +0 -208
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/groovy.rb +0 -268
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/haml.rb +0 -168
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/html.rb +0 -275
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/java/builtin_types.rb +0 -421
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/java.rb +0 -174
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/java_script.rb +0 -237
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/json.rb +0 -98
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/lua.rb +0 -280
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/php.rb +0 -527
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/python.rb +0 -287
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/raydebug.rb +0 -75
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/ruby/patterns.rb +0 -178
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/ruby/string_state.rb +0 -79
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/ruby.rb +0 -477
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/sass.rb +0 -232
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/scanner.rb +0 -337
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/sql.rb +0 -169
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/taskpaper.rb +0 -36
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/text.rb +0 -26
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/xml.rb +0 -17
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners/yaml.rb +0 -140
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/scanners.rb +0 -27
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles/_map.rb +0 -7
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles/alpha.rb +0 -153
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles/style.rb +0 -18
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/styles.rb +0 -15
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/token_kinds.rb +0 -85
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/tokens.rb +0 -161
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/tokens_proxy.rb +0 -55
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay/version.rb +0 -3
- data/vendor/bundle/gems/coderay-1.1.2/lib/coderay.rb +0 -284
- data/vendor/bundle/gems/colorize-0.8.1/CHANGELOG +0 -65
- data/vendor/bundle/gems/colorize-0.8.1/LICENSE +0 -339
- data/vendor/bundle/gems/colorize-0.8.1/README.md +0 -105
- data/vendor/bundle/gems/colorize-0.8.1/Rakefile +0 -13
- data/vendor/bundle/gems/colorize-0.8.1/colorize.gemspec +0 -36
- data/vendor/bundle/gems/colorize-0.8.1/lib/colorize/class_methods.rb +0 -120
- data/vendor/bundle/gems/colorize-0.8.1/lib/colorize/instance_methods.rb +0 -132
- data/vendor/bundle/gems/colorize-0.8.1/lib/colorize.rb +0 -12
- data/vendor/bundle/gems/colorize-0.8.1/lib/colorized_string.rb +0 -19
- data/vendor/bundle/gems/colorize-0.8.1/test/test_colorize.rb +0 -164
- data/vendor/bundle/gems/method_source-0.9.2/Gemfile +0 -2
- data/vendor/bundle/gems/method_source-0.9.2/LICENSE +0 -25
- data/vendor/bundle/gems/method_source-0.9.2/README.markdown +0 -91
- data/vendor/bundle/gems/method_source-0.9.2/Rakefile +0 -81
- data/vendor/bundle/gems/method_source-0.9.2/lib/method_source/code_helpers.rb +0 -154
- data/vendor/bundle/gems/method_source-0.9.2/lib/method_source/source_location.rb +0 -138
- data/vendor/bundle/gems/method_source-0.9.2/lib/method_source/version.rb +0 -3
- data/vendor/bundle/gems/method_source-0.9.2/lib/method_source.rb +0 -141
- data/vendor/bundle/gems/method_source-0.9.2/method_source.gemspec +0 -35
- data/vendor/bundle/gems/method_source-0.9.2/spec/method_source/code_helpers_spec.rb +0 -43
- data/vendor/bundle/gems/method_source-0.9.2/spec/method_source_spec.rb +0 -143
- data/vendor/bundle/gems/method_source-0.9.2/spec/spec_helper.rb +0 -101
- data/vendor/bundle/gems/pry-0.12.2/CHANGELOG.md +0 -953
- data/vendor/bundle/gems/pry-0.12.2/LICENSE +0 -25
- data/vendor/bundle/gems/pry-0.12.2/README.md +0 -390
- data/vendor/bundle/gems/pry-0.12.2/bin/pry +0 -8
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/basic_object.rb +0 -6
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/cli.rb +0 -218
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/code/code_file.rb +0 -110
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/code/code_range.rb +0 -71
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/code/loc.rb +0 -98
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/code.rb +0 -353
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/code_object.rb +0 -195
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/color_printer.rb +0 -65
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/command.rb +0 -723
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/command_set.rb +0 -415
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/amend_line.rb +0 -98
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/bang.rb +0 -20
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/bang_pry.rb +0 -17
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/abstract_formatter.rb +0 -27
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/exception_formatter.rb +0 -79
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/file_formatter.rb +0 -71
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat/input_expression_formatter.rb +0 -43
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cat.rb +0 -63
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/cd.rb +0 -41
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/change_inspector.rb +0 -27
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/change_prompt.rb +0 -46
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/clear_screen.rb +0 -14
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/code_collector.rb +0 -167
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/disable_pry.rb +0 -27
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/disabled_commands.rb +0 -2
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/easter_eggs.rb +0 -112
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/edit/exception_patcher.rb +0 -25
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/edit/file_and_line_locator.rb +0 -36
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/edit.rb +0 -200
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/exit.rb +0 -43
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/exit_all.rb +0 -29
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/exit_program.rb +0 -23
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/find_method.rb +0 -191
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/fix_indent.rb +0 -19
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_cd.rb +0 -26
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_install.rb +0 -32
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_list.rb +0 -33
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_open.rb +0 -29
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_readme.rb +0 -25
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_search.rb +0 -40
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gem_stats.rb +0 -83
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/gist.rb +0 -102
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/help.rb +0 -164
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/hist.rb +0 -181
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/import_set.rb +0 -23
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/install_command.rb +0 -54
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/jump_to.rb +0 -29
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/list_inspectors.rb +0 -35
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/constants.rb +0 -58
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/formatter.rb +0 -51
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/globals.rb +0 -46
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/grep.rb +0 -19
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/instance_vars.rb +0 -38
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/interrogatable.rb +0 -18
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/jruby_hacks.rb +0 -49
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/local_names.rb +0 -33
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/local_vars.rb +0 -37
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/ls_entity.rb +0 -69
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/methods.rb +0 -54
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/methods_helper.rb +0 -46
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls/self_methods.rb +0 -33
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ls.rb +0 -113
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/nesting.rb +0 -25
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/play.rb +0 -102
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/pry_backtrace.rb +0 -25
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/pry_version.rb +0 -17
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/raise_up.rb +0 -33
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/reload_code.rb +0 -62
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/reset.rb +0 -18
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/ri.rb +0 -65
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/save_file.rb +0 -61
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/shell_command.rb +0 -75
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/shell_mode.rb +0 -25
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_doc.rb +0 -81
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_info.rb +0 -216
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_input.rb +0 -17
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/show_source.rb +0 -53
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/stat.rb +0 -40
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/switch_to.rb +0 -23
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/toggle_color.rb +0 -24
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/watch_expression/expression.rb +0 -38
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/watch_expression.rb +0 -107
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/whereami.rb +0 -197
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands/wtf.rb +0 -70
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/commands.rb +0 -6
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/behavior.rb +0 -255
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/convenience.rb +0 -28
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/default.rb +0 -159
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/config/memoization.rb +0 -48
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/config.rb +0 -35
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/core_extensions.rb +0 -142
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/editor.rb +0 -128
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/exceptions.rb +0 -76
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/forwardable.rb +0 -23
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/base_helpers.rb +0 -200
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/command_helpers.rb +0 -157
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/documentation_helpers.rb +0 -76
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/options_helpers.rb +0 -27
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/platform.rb +0 -58
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/table.rb +0 -114
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers/text.rb +0 -115
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/helpers.rb +0 -6
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/history.rb +0 -161
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/hooks.rb +0 -171
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/indent.rb +0 -408
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/input_completer.rb +0 -265
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/input_lock.rb +0 -130
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/inspector.rb +0 -27
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/last_exception.rb +0 -61
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/method/disowned.rb +0 -55
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/method/patcher.rb +0 -122
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/method/weird_method_locator.rb +0 -198
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/method.rb +0 -552
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/object_path.rb +0 -83
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/output.rb +0 -50
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/pager.rb +0 -250
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/platform.rb +0 -91
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/plugins.rb +0 -122
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/prompt.rb +0 -145
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/pry_class.rb +0 -425
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/pry_instance.rb +0 -699
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/repl.rb +0 -261
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/repl_file_loader.rb +0 -73
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/ring.rb +0 -84
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/rubygem.rb +0 -84
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop/LICENSE +0 -20
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop/commands.rb +0 -195
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop/option.rb +0 -206
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/slop.rb +0 -661
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/terminal.rb +0 -91
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/evalable.rb +0 -15
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/mockable.rb +0 -14
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/pry_tester.rb +0 -73
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/utility.rb +0 -26
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable/variables.rb +0 -46
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/testable.rb +0 -70
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/version.rb +0 -3
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/wrapped_module/candidate.rb +0 -131
- data/vendor/bundle/gems/pry-0.12.2/lib/pry/wrapped_module.rb +0 -378
- data/vendor/bundle/gems/pry-0.12.2/lib/pry.rb +0 -132
- data/vendor/bundle/gems/rb-readline-0.5.5/CHANGES +0 -94
- data/vendor/bundle/gems/rb-readline-0.5.5/LICENSE +0 -25
- data/vendor/bundle/gems/rb-readline-0.5.5/README.md +0 -81
- data/vendor/bundle/gems/rb-readline-0.5.5/Rakefile +0 -25
- data/vendor/bundle/gems/rb-readline-0.5.5/bench/_rl_adjust_point.rb +0 -26
- data/vendor/bundle/gems/rb-readline-0.5.5/examples/example_readline.rb +0 -8
- data/vendor/bundle/gems/rb-readline-0.5.5/examples/example_readline_with_completion.rb +0 -18
- data/vendor/bundle/gems/rb-readline-0.5.5/examples/tinyirb.rb +0 -11
- data/vendor/bundle/gems/rb-readline-0.5.5/lib/rb-readline.rb +0 -18
- data/vendor/bundle/gems/rb-readline-0.5.5/lib/rbreadline/version.rb +0 -3
- data/vendor/bundle/gems/rb-readline-0.5.5/lib/rbreadline.rb +0 -8920
- data/vendor/bundle/gems/rb-readline-0.5.5/lib/readline.rb +0 -539
- data/vendor/bundle/gems/rb-readline-0.5.5/rb-readline.gemspec +0 -51
- data/vendor/bundle/gems/rb-readline-0.5.5/setup.rb +0 -1585
- data/vendor/bundle/gems/rb-readline-0.5.5/test/support/filesystem_completion_helper.rb +0 -53
- data/vendor/bundle/gems/rb-readline-0.5.5/test/test_completion.rb +0 -100
- data/vendor/bundle/gems/rb-readline-0.5.5/test/test_filename_completion_proc.rb +0 -88
- data/vendor/bundle/gems/rb-readline-0.5.5/test/test_history.rb +0 -29
- data/vendor/bundle/gems/rb-readline-0.5.5/test/test_rbreadline.rb +0 -23
- data/vendor/bundle/gems/rb-readline-0.5.5/test/test_readline.rb +0 -221
- data/vendor/bundle/specifications/coderay-1.1.2.gemspec +0 -26
- data/vendor/bundle/specifications/colorize-0.8.1.gemspec +0 -38
- data/vendor/bundle/specifications/method_source-0.9.2.gemspec +0 -35
- data/vendor/bundle/specifications/pry-0.12.2.gemspec +0 -38
- data/vendor/bundle/specifications/rb-readline-0.5.5.gemspec +0 -39
@@ -1,75 +0,0 @@
|
|
1
|
-
require 'set'
|
2
|
-
|
3
|
-
module CodeRay
|
4
|
-
module Scanners
|
5
|
-
|
6
|
-
# = Debug Scanner
|
7
|
-
#
|
8
|
-
# Interprets the output of the Encoders::Debug encoder (basically the inverse function).
|
9
|
-
class Debug < Scanner
|
10
|
-
|
11
|
-
register_for :debug
|
12
|
-
title 'CodeRay Token Dump Import'
|
13
|
-
|
14
|
-
protected
|
15
|
-
|
16
|
-
def setup
|
17
|
-
super
|
18
|
-
@known_token_kinds = TokenKinds.keys.map(&:to_s).to_set
|
19
|
-
end
|
20
|
-
|
21
|
-
def scan_tokens encoder, options
|
22
|
-
|
23
|
-
opened_tokens = []
|
24
|
-
|
25
|
-
until eos?
|
26
|
-
|
27
|
-
if match = scan(/\s+/)
|
28
|
-
encoder.text_token match, :space
|
29
|
-
|
30
|
-
elsif match = scan(/ (\w+) \( ( [^\)\\]* ( \\. [^\)\\]* )* ) \)? /x)
|
31
|
-
if @known_token_kinds.include? self[1]
|
32
|
-
encoder.text_token self[2].gsub(/\\(.)/m, '\1'), self[1].to_sym
|
33
|
-
else
|
34
|
-
encoder.text_token matched, :unknown
|
35
|
-
end
|
36
|
-
|
37
|
-
elsif match = scan(/ (\w+) ([<\[]) /x)
|
38
|
-
if @known_token_kinds.include? self[1]
|
39
|
-
kind = self[1].to_sym
|
40
|
-
else
|
41
|
-
kind = :unknown
|
42
|
-
end
|
43
|
-
|
44
|
-
opened_tokens << kind
|
45
|
-
case self[2]
|
46
|
-
when '<'
|
47
|
-
encoder.begin_group kind
|
48
|
-
when '['
|
49
|
-
encoder.begin_line kind
|
50
|
-
else
|
51
|
-
raise 'CodeRay bug: This case should not be reached.'
|
52
|
-
end
|
53
|
-
|
54
|
-
elsif !opened_tokens.empty? && match = scan(/ > /x)
|
55
|
-
encoder.end_group opened_tokens.pop
|
56
|
-
|
57
|
-
elsif !opened_tokens.empty? && match = scan(/ \] /x)
|
58
|
-
encoder.end_line opened_tokens.pop
|
59
|
-
|
60
|
-
else
|
61
|
-
encoder.text_token getch, :space
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
end
|
66
|
-
|
67
|
-
encoder.end_group opened_tokens.pop until opened_tokens.empty?
|
68
|
-
|
69
|
-
encoder
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
|
74
|
-
end
|
75
|
-
end
|
@@ -1,144 +0,0 @@
|
|
1
|
-
module CodeRay
|
2
|
-
module Scanners
|
3
|
-
|
4
|
-
# Scanner for the Delphi language (Object Pascal).
|
5
|
-
#
|
6
|
-
# Alias: +pascal+
|
7
|
-
class Delphi < Scanner
|
8
|
-
|
9
|
-
register_for :delphi
|
10
|
-
file_extension 'pas'
|
11
|
-
|
12
|
-
KEYWORDS = [
|
13
|
-
'and', 'array', 'as', 'at', 'asm', 'at', 'begin', 'case', 'class',
|
14
|
-
'const', 'constructor', 'destructor', 'dispinterface', 'div', 'do',
|
15
|
-
'downto', 'else', 'end', 'except', 'exports', 'file', 'finalization',
|
16
|
-
'finally', 'for', 'function', 'goto', 'if', 'implementation', 'in',
|
17
|
-
'inherited', 'initialization', 'inline', 'interface', 'is', 'label',
|
18
|
-
'library', 'mod', 'nil', 'not', 'object', 'of', 'or', 'out', 'packed',
|
19
|
-
'procedure', 'program', 'property', 'raise', 'record', 'repeat',
|
20
|
-
'resourcestring', 'set', 'shl', 'shr', 'string', 'then', 'threadvar',
|
21
|
-
'to', 'try', 'type', 'unit', 'until', 'uses', 'var', 'while', 'with',
|
22
|
-
'xor', 'on',
|
23
|
-
] # :nodoc:
|
24
|
-
|
25
|
-
DIRECTIVES = [
|
26
|
-
'absolute', 'abstract', 'assembler', 'at', 'automated', 'cdecl',
|
27
|
-
'contains', 'deprecated', 'dispid', 'dynamic', 'export',
|
28
|
-
'external', 'far', 'forward', 'implements', 'local',
|
29
|
-
'near', 'nodefault', 'on', 'overload', 'override',
|
30
|
-
'package', 'pascal', 'platform', 'private', 'protected', 'public',
|
31
|
-
'published', 'read', 'readonly', 'register', 'reintroduce',
|
32
|
-
'requires', 'resident', 'safecall', 'stdcall', 'stored', 'varargs',
|
33
|
-
'virtual', 'write', 'writeonly',
|
34
|
-
] # :nodoc:
|
35
|
-
|
36
|
-
IDENT_KIND = WordList::CaseIgnoring.new(:ident).
|
37
|
-
add(KEYWORDS, :keyword).
|
38
|
-
add(DIRECTIVES, :directive) # :nodoc:
|
39
|
-
|
40
|
-
NAME_FOLLOWS = WordList::CaseIgnoring.new(false).
|
41
|
-
add(%w(procedure function .)) # :nodoc:
|
42
|
-
|
43
|
-
protected
|
44
|
-
|
45
|
-
def scan_tokens encoder, options
|
46
|
-
|
47
|
-
state = :initial
|
48
|
-
last_token = ''
|
49
|
-
|
50
|
-
until eos?
|
51
|
-
|
52
|
-
if state == :initial
|
53
|
-
|
54
|
-
if match = scan(/ \s+ /x)
|
55
|
-
encoder.text_token match, :space
|
56
|
-
next
|
57
|
-
|
58
|
-
elsif match = scan(%r! \{ \$ [^}]* \}? | \(\* \$ (?: .*? \*\) | .* ) !mx)
|
59
|
-
encoder.text_token match, :preprocessor
|
60
|
-
next
|
61
|
-
|
62
|
-
elsif match = scan(%r! // [^\n]* | \{ [^}]* \}? | \(\* (?: .*? \*\) | .* ) !mx)
|
63
|
-
encoder.text_token match, :comment
|
64
|
-
next
|
65
|
-
|
66
|
-
elsif match = scan(/ <[>=]? | >=? | :=? | [-+=*\/;,@\^|\(\)\[\]] | \.\. /x)
|
67
|
-
encoder.text_token match, :operator
|
68
|
-
|
69
|
-
elsif match = scan(/\./)
|
70
|
-
encoder.text_token match, :operator
|
71
|
-
next if last_token == 'end'
|
72
|
-
|
73
|
-
elsif match = scan(/ [A-Za-z_][A-Za-z_0-9]* /x)
|
74
|
-
encoder.text_token match, NAME_FOLLOWS[last_token] ? :ident : IDENT_KIND[match]
|
75
|
-
|
76
|
-
elsif match = skip(/ ' ( [^\n']|'' ) (?:'|$) /x)
|
77
|
-
encoder.begin_group :char
|
78
|
-
encoder.text_token "'", :delimiter
|
79
|
-
encoder.text_token self[1], :content
|
80
|
-
encoder.text_token "'", :delimiter
|
81
|
-
encoder.end_group :char
|
82
|
-
next
|
83
|
-
|
84
|
-
elsif match = scan(/ ' /x)
|
85
|
-
encoder.begin_group :string
|
86
|
-
encoder.text_token match, :delimiter
|
87
|
-
state = :string
|
88
|
-
|
89
|
-
elsif match = scan(/ \# (?: \d+ | \$[0-9A-Fa-f]+ ) /x)
|
90
|
-
encoder.text_token match, :char
|
91
|
-
|
92
|
-
elsif match = scan(/ \$ [0-9A-Fa-f]+ /x)
|
93
|
-
encoder.text_token match, :hex
|
94
|
-
|
95
|
-
elsif match = scan(/ (?: \d+ ) (?![eE]|\.[^.]) /x)
|
96
|
-
encoder.text_token match, :integer
|
97
|
-
|
98
|
-
elsif match = scan(/ \d+ (?: \.\d+ (?: [eE][+-]? \d+ )? | [eE][+-]? \d+ ) /x)
|
99
|
-
encoder.text_token match, :float
|
100
|
-
|
101
|
-
else
|
102
|
-
encoder.text_token getch, :error
|
103
|
-
next
|
104
|
-
|
105
|
-
end
|
106
|
-
|
107
|
-
elsif state == :string
|
108
|
-
if match = scan(/[^\n']+/)
|
109
|
-
encoder.text_token match, :content
|
110
|
-
elsif match = scan(/''/)
|
111
|
-
encoder.text_token match, :char
|
112
|
-
elsif match = scan(/'/)
|
113
|
-
encoder.text_token match, :delimiter
|
114
|
-
encoder.end_group :string
|
115
|
-
state = :initial
|
116
|
-
next
|
117
|
-
elsif match = scan(/\n/)
|
118
|
-
encoder.end_group :string
|
119
|
-
encoder.text_token match, :space
|
120
|
-
state = :initial
|
121
|
-
else
|
122
|
-
raise "else case \' reached; %p not handled." % peek(1), encoder
|
123
|
-
end
|
124
|
-
|
125
|
-
else
|
126
|
-
raise 'else-case reached', encoder
|
127
|
-
|
128
|
-
end
|
129
|
-
|
130
|
-
last_token = match
|
131
|
-
|
132
|
-
end
|
133
|
-
|
134
|
-
if state == :string
|
135
|
-
encoder.end_group state
|
136
|
-
end
|
137
|
-
|
138
|
-
encoder
|
139
|
-
end
|
140
|
-
|
141
|
-
end
|
142
|
-
|
143
|
-
end
|
144
|
-
end
|
@@ -1,221 +0,0 @@
|
|
1
|
-
module CodeRay
|
2
|
-
module Scanners
|
3
|
-
|
4
|
-
# Scanner for output of the diff command.
|
5
|
-
#
|
6
|
-
# Alias: +patch+
|
7
|
-
class Diff < Scanner
|
8
|
-
|
9
|
-
register_for :diff
|
10
|
-
title 'diff output'
|
11
|
-
|
12
|
-
DEFAULT_OPTIONS = {
|
13
|
-
:highlight_code => true,
|
14
|
-
:inline_diff => true,
|
15
|
-
}
|
16
|
-
|
17
|
-
protected
|
18
|
-
|
19
|
-
def scan_tokens encoder, options
|
20
|
-
|
21
|
-
line_kind = nil
|
22
|
-
state = :initial
|
23
|
-
deleted_lines_count = 0
|
24
|
-
scanners = Hash.new do |h, lang|
|
25
|
-
h[lang] = Scanners[lang].new '', :keep_tokens => true, :keep_state => true
|
26
|
-
end
|
27
|
-
content_scanner = scanners[:plain]
|
28
|
-
content_scanner_entry_state = nil
|
29
|
-
|
30
|
-
until eos?
|
31
|
-
|
32
|
-
if match = scan(/\n/)
|
33
|
-
deleted_lines_count = 0 unless line_kind == :delete
|
34
|
-
if line_kind
|
35
|
-
encoder.end_line line_kind
|
36
|
-
line_kind = nil
|
37
|
-
end
|
38
|
-
encoder.text_token match, :space
|
39
|
-
next
|
40
|
-
end
|
41
|
-
|
42
|
-
case state
|
43
|
-
|
44
|
-
when :initial
|
45
|
-
if match = scan(/--- |\+\+\+ |=+|_+/)
|
46
|
-
encoder.begin_line line_kind = :head
|
47
|
-
encoder.text_token match, :head
|
48
|
-
if match = scan(/[^\x00\n]+?(?=$|[\t\n]| \(revision)/)
|
49
|
-
encoder.text_token match, :filename
|
50
|
-
if options[:highlight_code] && match != '/dev/null'
|
51
|
-
file_type = CodeRay::FileType.fetch(match, :text)
|
52
|
-
file_type = :text if file_type == :diff
|
53
|
-
content_scanner = scanners[file_type]
|
54
|
-
content_scanner_entry_state = nil
|
55
|
-
end
|
56
|
-
end
|
57
|
-
next unless match = scan(/.+/)
|
58
|
-
encoder.text_token match, :plain
|
59
|
-
elsif match = scan(/Index: |Property changes on: /)
|
60
|
-
encoder.begin_line line_kind = :head
|
61
|
-
encoder.text_token match, :head
|
62
|
-
next unless match = scan(/.+/)
|
63
|
-
encoder.text_token match, :plain
|
64
|
-
elsif match = scan(/Added: /)
|
65
|
-
encoder.begin_line line_kind = :head
|
66
|
-
encoder.text_token match, :head
|
67
|
-
next unless match = scan(/.+/)
|
68
|
-
encoder.text_token match, :plain
|
69
|
-
state = :added
|
70
|
-
elsif match = scan(/\\ .*/)
|
71
|
-
encoder.text_token match, :comment
|
72
|
-
elsif match = scan(/@@(?>[^@\n]+)@@/)
|
73
|
-
content_scanner.state = :initial unless match?(/\n\+/)
|
74
|
-
content_scanner_entry_state = nil
|
75
|
-
if check(/\n|$/)
|
76
|
-
encoder.begin_line line_kind = :change
|
77
|
-
else
|
78
|
-
encoder.begin_group :change
|
79
|
-
end
|
80
|
-
encoder.text_token match[0,2], :change
|
81
|
-
encoder.text_token match[2...-2], :plain
|
82
|
-
encoder.text_token match[-2,2], :change
|
83
|
-
encoder.end_group :change unless line_kind
|
84
|
-
next unless match = scan(/.+/)
|
85
|
-
if options[:highlight_code]
|
86
|
-
content_scanner.tokenize match, :tokens => encoder
|
87
|
-
else
|
88
|
-
encoder.text_token match, :plain
|
89
|
-
end
|
90
|
-
next
|
91
|
-
elsif match = scan(/\+/)
|
92
|
-
encoder.begin_line line_kind = :insert
|
93
|
-
encoder.text_token match, :insert
|
94
|
-
next unless match = scan(/.+/)
|
95
|
-
if options[:highlight_code]
|
96
|
-
content_scanner.tokenize match, :tokens => encoder
|
97
|
-
else
|
98
|
-
encoder.text_token match, :plain
|
99
|
-
end
|
100
|
-
next
|
101
|
-
elsif match = scan(/-/)
|
102
|
-
deleted_lines_count += 1
|
103
|
-
if options[:inline_diff] && deleted_lines_count == 1 && (changed_lines_count = 1 + check(/.*(?:\n\-.*)*/).count("\n")) && changed_lines_count <= 100_000 && match?(/(?>.*(?:\n\-.*){#{changed_lines_count - 1}}(?:\n\+.*){#{changed_lines_count}})$(?!\n\+)/)
|
104
|
-
deleted_lines = Array.new(changed_lines_count) { |i| skip(/\n\-/) if i > 0; scan(/.*/) }
|
105
|
-
inserted_lines = Array.new(changed_lines_count) { |i| skip(/\n\+/) ; scan(/.*/) }
|
106
|
-
|
107
|
-
deleted_lines_tokenized = []
|
108
|
-
inserted_lines_tokenized = []
|
109
|
-
for deleted_line, inserted_line in deleted_lines.zip(inserted_lines)
|
110
|
-
pre, deleted_part, inserted_part, post = diff deleted_line, inserted_line
|
111
|
-
content_scanner_entry_state = content_scanner.state
|
112
|
-
deleted_lines_tokenized << content_scanner.tokenize([pre, deleted_part, post], :tokens => Tokens.new)
|
113
|
-
content_scanner.state = content_scanner_entry_state || :initial
|
114
|
-
inserted_lines_tokenized << content_scanner.tokenize([pre, inserted_part, post], :tokens => Tokens.new)
|
115
|
-
end
|
116
|
-
|
117
|
-
for pre, deleted_part, post in deleted_lines_tokenized
|
118
|
-
encoder.begin_line :delete
|
119
|
-
encoder.text_token '-', :delete
|
120
|
-
encoder.tokens pre
|
121
|
-
unless deleted_part.empty?
|
122
|
-
encoder.begin_group :eyecatcher
|
123
|
-
encoder.tokens deleted_part
|
124
|
-
encoder.end_group :eyecatcher
|
125
|
-
end
|
126
|
-
encoder.tokens post
|
127
|
-
encoder.end_line :delete
|
128
|
-
encoder.text_token "\n", :space
|
129
|
-
end
|
130
|
-
|
131
|
-
for pre, inserted_part, post in inserted_lines_tokenized
|
132
|
-
encoder.begin_line :insert
|
133
|
-
encoder.text_token '+', :insert
|
134
|
-
encoder.tokens pre
|
135
|
-
unless inserted_part.empty?
|
136
|
-
encoder.begin_group :eyecatcher
|
137
|
-
encoder.tokens inserted_part
|
138
|
-
encoder.end_group :eyecatcher
|
139
|
-
end
|
140
|
-
encoder.tokens post
|
141
|
-
changed_lines_count -= 1
|
142
|
-
if changed_lines_count > 0
|
143
|
-
encoder.end_line :insert
|
144
|
-
encoder.text_token "\n", :space
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
line_kind = :insert
|
149
|
-
|
150
|
-
elsif match = scan(/.*/)
|
151
|
-
encoder.begin_line line_kind = :delete
|
152
|
-
encoder.text_token '-', :delete
|
153
|
-
if options[:highlight_code]
|
154
|
-
if deleted_lines_count == 1
|
155
|
-
content_scanner_entry_state = content_scanner.state
|
156
|
-
end
|
157
|
-
content_scanner.tokenize match, :tokens => encoder unless match.empty?
|
158
|
-
if !match?(/\n-/)
|
159
|
-
if match?(/\n\+/)
|
160
|
-
content_scanner.state = content_scanner_entry_state || :initial
|
161
|
-
end
|
162
|
-
content_scanner_entry_state = nil
|
163
|
-
end
|
164
|
-
else
|
165
|
-
encoder.text_token match, :plain
|
166
|
-
end
|
167
|
-
end
|
168
|
-
next
|
169
|
-
elsif match = scan(/ .*/)
|
170
|
-
if options[:highlight_code]
|
171
|
-
content_scanner.tokenize match, :tokens => encoder
|
172
|
-
else
|
173
|
-
encoder.text_token match, :plain
|
174
|
-
end
|
175
|
-
next
|
176
|
-
elsif match = scan(/.+/)
|
177
|
-
encoder.begin_line line_kind = :comment
|
178
|
-
encoder.text_token match, :plain
|
179
|
-
else
|
180
|
-
raise_inspect 'else case rached'
|
181
|
-
end
|
182
|
-
|
183
|
-
when :added
|
184
|
-
if match = scan(/ \+/)
|
185
|
-
encoder.begin_line line_kind = :insert
|
186
|
-
encoder.text_token match, :insert
|
187
|
-
next unless match = scan(/.+/)
|
188
|
-
encoder.text_token match, :plain
|
189
|
-
else
|
190
|
-
state = :initial
|
191
|
-
next
|
192
|
-
end
|
193
|
-
end
|
194
|
-
|
195
|
-
end
|
196
|
-
|
197
|
-
encoder.end_line line_kind if line_kind
|
198
|
-
|
199
|
-
encoder
|
200
|
-
end
|
201
|
-
|
202
|
-
private
|
203
|
-
|
204
|
-
def diff a, b
|
205
|
-
# i will be the index of the leftmost difference from the left.
|
206
|
-
i_max = [a.size, b.size].min
|
207
|
-
i = 0
|
208
|
-
i += 1 while i < i_max && a[i] == b[i]
|
209
|
-
# j_min will be the index of the leftmost difference from the right.
|
210
|
-
j_min = i - i_max
|
211
|
-
# j will be the index of the rightmost difference from the right which
|
212
|
-
# does not precede the leftmost one from the left.
|
213
|
-
j = -1
|
214
|
-
j -= 1 while j >= j_min && a[j] == b[j]
|
215
|
-
return a[0...i], a[i..j], b[i..j], (j < -1) ? a[j+1..-1] : ''
|
216
|
-
end
|
217
|
-
|
218
|
-
end
|
219
|
-
|
220
|
-
end
|
221
|
-
end
|
@@ -1,81 +0,0 @@
|
|
1
|
-
module CodeRay
|
2
|
-
module Scanners
|
3
|
-
|
4
|
-
load :html
|
5
|
-
load :ruby
|
6
|
-
|
7
|
-
# Scanner for HTML ERB templates.
|
8
|
-
class ERB < Scanner
|
9
|
-
|
10
|
-
register_for :erb
|
11
|
-
title 'HTML ERB Template'
|
12
|
-
|
13
|
-
KINDS_NOT_LOC = HTML::KINDS_NOT_LOC
|
14
|
-
|
15
|
-
ERB_RUBY_BLOCK = /
|
16
|
-
(<%(?!%)[-=\#]?)
|
17
|
-
((?>
|
18
|
-
[^\-%]* # normal*
|
19
|
-
(?> # special
|
20
|
-
(?: %(?!>) | -(?!%>) )
|
21
|
-
[^\-%]* # normal*
|
22
|
-
)*
|
23
|
-
))
|
24
|
-
((?: -?%> )?)
|
25
|
-
/x # :nodoc:
|
26
|
-
|
27
|
-
START_OF_ERB = /
|
28
|
-
<%(?!%)
|
29
|
-
/x # :nodoc:
|
30
|
-
|
31
|
-
protected
|
32
|
-
|
33
|
-
def setup
|
34
|
-
@ruby_scanner = CodeRay.scanner :ruby, :tokens => @tokens, :keep_tokens => true
|
35
|
-
@html_scanner = CodeRay.scanner :html, :tokens => @tokens, :keep_tokens => true, :keep_state => true
|
36
|
-
end
|
37
|
-
|
38
|
-
def reset_instance
|
39
|
-
super
|
40
|
-
@html_scanner.reset
|
41
|
-
end
|
42
|
-
|
43
|
-
def scan_tokens encoder, options
|
44
|
-
|
45
|
-
until eos?
|
46
|
-
|
47
|
-
if (match = scan_until(/(?=#{START_OF_ERB})/o) || scan_rest) and not match.empty?
|
48
|
-
@html_scanner.tokenize match, :tokens => encoder
|
49
|
-
|
50
|
-
elsif match = scan(/#{ERB_RUBY_BLOCK}/o)
|
51
|
-
start_tag = self[1]
|
52
|
-
code = self[2]
|
53
|
-
end_tag = self[3]
|
54
|
-
|
55
|
-
encoder.begin_group :inline
|
56
|
-
encoder.text_token start_tag, :inline_delimiter
|
57
|
-
|
58
|
-
if start_tag == '<%#'
|
59
|
-
encoder.text_token code, :comment
|
60
|
-
else
|
61
|
-
@ruby_scanner.tokenize code, :tokens => encoder
|
62
|
-
end unless code.empty?
|
63
|
-
|
64
|
-
encoder.text_token end_tag, :inline_delimiter unless end_tag.empty?
|
65
|
-
encoder.end_group :inline
|
66
|
-
|
67
|
-
else
|
68
|
-
raise_inspect 'else-case reached!', encoder
|
69
|
-
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
|
74
|
-
encoder
|
75
|
-
|
76
|
-
end
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
end
|
81
|
-
end
|