rubocop-ast 0.0.1 → 0.0.2
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/README.md +4 -2
- data/lib/rubocop/ast.rb +1 -0
- data/lib/rubocop/ast/node/regexp_node.rb +5 -2
- data/lib/rubocop/ast/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0750c7434a863460f8b900080b40ed7515c6e1eb415d0b91ce612f6bcac7a67
|
4
|
+
data.tar.gz: 0b08bbe1e7ed4612351d4296264f18bbe0e3af5d069410d46e017f4826ac1bc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7259c958f33d8a754275a5c25d8b6094f2f41be2a058935dca5d689903accd0bba77bff7ac440501c35274fb00f9a9c29c4c02f8e988e2a7bb0f3fc334773cab
|
7
|
+
data.tar.gz: e28f39434e75ad138bc49646e36d9bbb39fe25011d0bd41034c4da02d5bbb801b52e5caf06a05453e9ada004b158e1c573deb4749468f126fb4cbb88bebd3a74
|
data/README.md
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
# RuboCop AST
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/rubocop-ast)
|
4
|
-
[](https://github.com/rubocop-hq/rubocop-ast/actions?query=workflow%3ACI)
|
5
5
|
|
6
6
|
Contains the classes needed by [RuboCop](https://github.com/rubocop-hq/rubocop) to deal with Ruby's AST, in particular:
|
7
7
|
* `RuboCop::AST::Node`
|
8
|
-
* `RuboCop::NodePattern`
|
8
|
+
* `RuboCop::NodePattern` ([doc](manual/node_pattern.md))
|
9
|
+
|
10
|
+
This gem may be used independently from the main RuboCop gem.
|
9
11
|
|
10
12
|
## Installation
|
11
13
|
|
data/lib/rubocop/ast.rb
CHANGED
@@ -10,12 +10,15 @@ module RuboCop
|
|
10
10
|
x: Regexp::EXTENDED,
|
11
11
|
i: Regexp::IGNORECASE,
|
12
12
|
m: Regexp::MULTILINE,
|
13
|
-
n: Regexp::NOENCODING
|
13
|
+
n: Regexp::NOENCODING,
|
14
|
+
o: 0
|
14
15
|
}.freeze
|
15
16
|
|
17
|
+
# Note: The 'o' option is ignored.
|
18
|
+
#
|
16
19
|
# @return [Regexp] a regexp of this node
|
17
20
|
def to_regexp
|
18
|
-
option = regopt.children.map { |opt| OPTIONS
|
21
|
+
option = regopt.children.map { |opt| OPTIONS.fetch(opt) }.inject(:|)
|
19
22
|
Regexp.new(content, option)
|
20
23
|
end
|
21
24
|
|
data/lib/rubocop/ast/version.rb
CHANGED