summaryrefslogtreecommitdiff
path: root/lib/coderay/tokens.rb
diff options
context:
space:
mode:
authorJun Aruga <jaruga@redhat.com>2019-02-14 15:17:56 +0100
committerJun Aruga <jaruga@redhat.com>2019-02-14 16:45:15 +0100
commitdc767fca8ae78cf5760d3bf1d7e7150fde6c5951 (patch)
tree91fd0352c98985277e8fed3b4f2517ae11d55b24 /lib/coderay/tokens.rb
parentd38502167541a1cd1b505a0e468e0098e3ae7538 (diff)
downloadcoderay-dc767fca8ae78cf5760d3bf1d7e7150fde6c5951.tar.gz
Add Ruby 2.6 fixing issues
* Remove existing Tokens#filter (Array#filter) for Ruby 2.6 compatibility. * Install proper version's rdoc considering installed Ruby version.
Diffstat (limited to 'lib/coderay/tokens.rb')
-rw-r--r--lib/coderay/tokens.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/coderay/tokens.rb b/lib/coderay/tokens.rb
index e7bffce..b5f78e7 100644
--- a/lib/coderay/tokens.rb
+++ b/lib/coderay/tokens.rb
@@ -39,6 +39,9 @@ module CodeRay
# You can serialize it to a JSON string and store it in a database, pass it
# around to encode it more than once, send it to other algorithms...
class Tokens < Array
+ # Remove Array#filter that is a new alias for Array#select on Ruby 2.6,
+ # for method_missing called with filter method.
+ undef_method :filter if instance_methods.include?(:filter)
# The Scanner instance that created the tokens.
attr_accessor :scanner