jgrep 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +3 -0
- data/bin/jgrep +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f1b59d081b76f0692d89d7d99d40cb361215ed5
|
4
|
+
data.tar.gz: e173dbd8230dedcfb2a77c9bdb355d7293a67f66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bac482d335720345795310014895a0188b1458e7c87fd2ec062ca2cdf0a6aa5a1cecc1eded73680e4632635acb9e2eca5b75f71363e701be015b514eb20906eb
|
7
|
+
data.tar.gz: 8624259c860b573792437681645991f3fd86a9fdc27530cd838c5988a8d1573c033eba23c632872ab1779b0226bd3eec7caa47488a187a96de14fd09b26baaa2
|
data/CHANGELOG.markdown
CHANGED
data/bin/jgrep
CHANGED
@@ -18,7 +18,8 @@ def do_grep(json, expression)
|
|
18
18
|
if @options[:field].empty?
|
19
19
|
result = JGrep::jgrep((json), expression, nil, @options[:start])
|
20
20
|
result = result.slice(@options[:slice]) if @options[:slice]
|
21
|
-
|
21
|
+
exit 1 if result == []
|
22
|
+
unless @options[:quiet] == true
|
22
23
|
print_json(result)
|
23
24
|
end
|
24
25
|
else
|
@@ -26,7 +27,8 @@ def do_grep(json, expression)
|
|
26
27
|
JGrep::validate_filters(@options[:field])
|
27
28
|
result = JGrep::jgrep((json), expression, @options[:field], @options[:start])
|
28
29
|
result = result.slice(@options[:slice]) if @options[:slice]
|
29
|
-
|
30
|
+
exit 1 if result == []
|
31
|
+
unless @options[:quiet] == true
|
30
32
|
print_json(result)
|
31
33
|
end
|
32
34
|
|
@@ -34,6 +36,7 @@ def do_grep(json, expression)
|
|
34
36
|
JGrep::validate_filters(@options[:field][0])
|
35
37
|
result = JGrep::jgrep((json), expression, @options[:field][0], @options[:start])
|
36
38
|
result = result.slice(@options[:slice]) if @options[:slice]
|
39
|
+
exit 1 if result == []
|
37
40
|
if result.is_a?(Array) && !(result.first.is_a?(Hash) || result.flatten.first.is_a?(Hash))
|
38
41
|
unless @options[:quiet] == true
|
39
42
|
result.map{|x| puts x unless x.nil?}
|
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.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- P Loubser
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|