Skip to content

Commit

Permalink
In Ruby 2.4, Set#=== is harmonized with Ruby 2.5+ to call include?
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Aug 11, 2020
1 parent 96b0656 commit ce9e14e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,10 @@
* [#89](https://github.com/rubocop-hq/rubocop-ast/pull/89): Support right hand assignment for Ruby 2.8 (3.0) parser. ([@koic][])
* [#93](https://github.com/rubocop-hq/rubocop-ast/pull/93): Add `Node#{left|right}_sibling{s}` ([@marcandre][])

### Changes

* [#x](https://github.com/rubocop-hq/rubocop-ast/issue/x): In Ruby 2.4, `Set#===` is harmonized with Ruby 2.5+ to call `include?`. ([@marcandre][])

## 0.3.0 (2020-08-01)

### New features
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/ast.rb
Expand Up @@ -5,6 +5,7 @@
require 'set'

require_relative 'ast/ext/range'
require_relative 'ast/ext/set'
require_relative 'ast/node_pattern'
require_relative 'ast/sexp'
require_relative 'ast/node'
Expand Down
8 changes: 8 additions & 0 deletions lib/rubocop/ast/ext/set.rb
@@ -0,0 +1,8 @@
# frozen_string_literal: true

# Harmonize `Set#===`
unless Set[:foo] === :foo # typically RUBY_VERSION <= 2.4
class Set
alias === include?
end
end

0 comments on commit ce9e14e

Please sign in to comment.