jgrep 1.5.0 → 1.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc2ae50ca974a9033f6bca65254c009705305587
4
- data.tar.gz: 36c22db07d3980bd372071c537bde74c846ccfed
3
+ metadata.gz: 57c0c7aac45db47a45a116501a93b8a9a3a8b349
4
+ data.tar.gz: f6e34ed045fb964b555661e9916b1a9d230eaef5
5
5
  SHA512:
6
- metadata.gz: 85342e07b0e672f19cebda3b426271736b02097df611b98171f54d297e5f2d394c9a2b83fe3a42ce4936f281bdd26806ff89659a2bd52fc3ee54d05b2772b3cd
7
- data.tar.gz: 86ac2ba2a35df8aa5a7884f3b223a1e82a2d4b2980b69e86b84cdfde19227a3fd541f522d427b63891f1f482ce5d4b47a689798123bdfb5e142f28fc2a437798
6
+ metadata.gz: 0134994e93444e3c7b95d8e35c17b5bd96f668fa85c96572d7183aa3fcbf87477cd29d3fb542c03d3e669d5be0ed4955659c36d29fc159f79f9e03ac29747402
7
+ data.tar.gz: b2a6e8dd40133264b5b00d8bcd59be794650a96bcdd46719251ddc0552804f5d0f188db8ff7e942f65935d1bc778aed455f7dc4012bac9552c67575c96d12ddb
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.1
4
+ * Now handles escaped parens when tokenising statements
5
+
3
6
  ## 1.5.0
4
7
  * Dropped support for Ruby 1.8.3
5
8
  * Added support for modern Ruby versions (Tested up to 2.4.0)
@@ -141,7 +141,7 @@ module JGrep
141
141
  j += 1
142
142
  end until (j >= @arguments.size) || (chr(@arguments[j]) =~ /'|"/)
143
143
  end
144
- end until (j >= @arguments.size) || (chr(@arguments[j]) =~ /\s|\)|\]/)
144
+ end until (j >= @arguments.size) || (chr(@arguments[j]) =~ /\s|\)|\]/ && chr(@arguments[j - 1]) != '\\')
145
145
  end
146
146
  rescue
147
147
  raise "Invalid token found - '#{current_token_value}'"
@@ -57,6 +57,12 @@ module JGrep
57
57
  expect(token).to eq(["statement", "foo.bar=bar"])
58
58
  end
59
59
 
60
+ it "should identify a statement token with escaped parentheses" do
61
+ scanner = Scanner.new("foo.bar=/baz\\(gronk\\)quux/")
62
+ token = scanner.get_token
63
+ expect(token).to eq(["statement", "foo.bar=/baz\\(gronk\\)quux/"])
64
+ end
65
+
60
66
  it "should identify a complex array statement" do
61
67
  scanner = Scanner.new("[foo=bar and bar=foo]")
62
68
  token = scanner.get_token
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jgrep
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - P Loubser
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-08-09 00:00:00.000000000 Z
13
+ date: 2019-10-30 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Compare a list of json documents to a simple logical language and returns
16
16
  matches as output