querly 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +28 -0
- data/.travis.yml +4 -3
- data/CHANGELOG.md +5 -0
- data/bin/setup +1 -2
- data/lib/querly/pattern/expr.rb +8 -6
- data/lib/querly/version.rb +1 -1
- data/querly.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c59512018b5efff3d07b7be91d84f27bdbcb03ab0c3c85d753776defae7f1465
|
4
|
+
data.tar.gz: 2d3a28676a671d80378c67e26bd2afd6bf047243a775da6db990dad97e0b0495
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b72388f4e4cd1d73c6b5942fcbe5897ffa7f1aac5fd4cfa40c644a5a2ac21f36809531847d10a455c97d6f5b9f4d1a580715f390b98f92352bcc9819949c4bca
|
7
|
+
data.tar.gz: 12116f61a8ae822d6a95560d4acdde918579e312702f402b51bb5a9244cca1f5c4b69b0d47e02a88a6b35fa4f37de90ed0727919eede1dce2362c95e3eb4b2da
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request: {}
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: "ubuntu-latest"
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
container_tag:
|
15
|
+
- 2.6-bionic
|
16
|
+
- 2.7-bionic
|
17
|
+
- master-nightly-bionic
|
18
|
+
container:
|
19
|
+
image: rubylang/ruby:${{ matrix.container_tag }}
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v1
|
22
|
+
- name: Run test
|
23
|
+
run: |
|
24
|
+
ruby -v
|
25
|
+
gem install bundler
|
26
|
+
bundle install --jobs 4 --retry 3
|
27
|
+
bin/setup
|
28
|
+
bundle exec rake build test
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.1.0 (2020-05-17)
|
6
|
+
|
7
|
+
* Fix invalid bytes sequence in UTF-8 error by @mallowlabs [#75](https://github.com/soutaro/querly/pull/75)
|
8
|
+
* Detect safe navigation operator as a method call by @pocke [#71](https://github.com/soutaro/querly/pull/71)
|
9
|
+
|
5
10
|
## 1.0.0 (2019-7-19)
|
6
11
|
|
7
12
|
* Add `--config` option for `find` and `console` [#67](https://github.com/soutaro/querly/pull/67)
|
data/bin/setup
CHANGED
data/lib/querly/pattern/expr.rb
CHANGED
@@ -118,7 +118,7 @@ module Querly
|
|
118
118
|
|
119
119
|
when :str
|
120
120
|
return false unless type == :string
|
121
|
-
test_value(node.children.first)
|
121
|
+
test_value(node.children.first.scrub)
|
122
122
|
|
123
123
|
when :sym
|
124
124
|
return false unless type == :symbol
|
@@ -147,7 +147,8 @@ module Querly
|
|
147
147
|
|
148
148
|
def =~(pair)
|
149
149
|
# Skip send node with block
|
150
|
-
|
150
|
+
type = pair.node.type
|
151
|
+
if (type == :send || type == :csend) && pair.parent
|
151
152
|
if pair.parent.node.type == :block
|
152
153
|
if pair.parent.node.children.first.equal? pair.node
|
153
154
|
return false
|
@@ -176,7 +177,7 @@ module Querly
|
|
176
177
|
node = node.children.first if node&.type == :block
|
177
178
|
|
178
179
|
case node&.type
|
179
|
-
when :send
|
180
|
+
when :send, :csend
|
180
181
|
return false unless test_name(node)
|
181
182
|
return false unless test_receiver(node.children[0])
|
182
183
|
return false unless test_args(node.children.drop(2), args)
|
@@ -290,7 +291,8 @@ module Querly
|
|
290
291
|
if receiver.test_node(node)
|
291
292
|
true
|
292
293
|
else
|
293
|
-
|
294
|
+
type = node&.type
|
295
|
+
(type == :send || type == :csend) && test_node(node.children[0])
|
294
296
|
end
|
295
297
|
end
|
296
298
|
end
|
@@ -315,7 +317,7 @@ module Querly
|
|
315
317
|
# We don't want lvar without method call
|
316
318
|
# Skips when the node is not receiver of :send
|
317
319
|
parent_node = pair.parent&.node
|
318
|
-
if parent_node && parent_node.type == :send && parent_node.children.first.equal?(node)
|
320
|
+
if parent_node && (parent_node.type == :send || parent_node.type == :csend) && parent_node.children.first.equal?(node)
|
319
321
|
test_node(node)
|
320
322
|
end
|
321
323
|
else
|
@@ -325,7 +327,7 @@ module Querly
|
|
325
327
|
|
326
328
|
def test_node(node)
|
327
329
|
case node&.type
|
328
|
-
when :send
|
330
|
+
when :send, :csend
|
329
331
|
node.children[1] == name
|
330
332
|
when :lvar
|
331
333
|
node.children.first == name
|
data/lib/querly/version.rb
CHANGED
data/querly.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", ">= 1.12"
|
26
|
-
spec.add_development_dependency "rake", "~>
|
26
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
27
27
|
spec.add_development_dependency "minitest", "~> 5.0"
|
28
28
|
spec.add_development_dependency "racc", ">= 1.4.14"
|
29
29
|
spec.add_development_dependency "unification_assertion", "0.0.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: querly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,6 +209,7 @@ executables:
|
|
209
209
|
extensions: []
|
210
210
|
extra_rdoc_files: []
|
211
211
|
files:
|
212
|
+
- ".github/workflows/ruby.yml"
|
212
213
|
- ".gitignore"
|
213
214
|
- ".travis.yml"
|
214
215
|
- CHANGELOG.md
|
@@ -275,8 +276,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
275
276
|
- !ruby/object:Gem::Version
|
276
277
|
version: '0'
|
277
278
|
requirements: []
|
278
|
-
|
279
|
-
rubygems_version: 2.7.6
|
279
|
+
rubygems_version: 3.1.2
|
280
280
|
signing_key:
|
281
281
|
specification_version: 4
|
282
282
|
summary: Pattern Based Checking Tool for Ruby
|