jgrep 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.markdown +3 -0
  3. data/bin/jgrep +5 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 711064ad1e5b72d951cd8d049d289a58576224be
4
- data.tar.gz: 2d44d135f26ce88962e4d8bdf9620b7fee13d0c6
3
+ metadata.gz: 6f1b59d081b76f0692d89d7d99d40cb361215ed5
4
+ data.tar.gz: e173dbd8230dedcfb2a77c9bdb355d7293a67f66
5
5
  SHA512:
6
- metadata.gz: d32d99fe10154f48e699a5074af1fd6c0a26af7d9df839b200a7f4dfc0c4003b7806ba6fde87d893c151245c34fd7217663b365bb1796b546401f9357d7286d6
7
- data.tar.gz: 1feb21dd1c0e1efc87431ff4be35e197a3e0c604f19f3d6e49bec2a6de665af3e45500ce8839d77e272c0e3b301ecc216ed226b4fa5039a01beb88d11ea01602
6
+ metadata.gz: bac482d335720345795310014895a0188b1458e7c87fd2ec062ca2cdf0a6aa5a1cecc1eded73680e4632635acb9e2eca5b75f71363e701be015b514eb20906eb
7
+ data.tar.gz: 8624259c860b573792437681645991f3fd86a9fdc27530cd838c5988a8d1573c033eba23c632872ab1779b0226bd3eec7caa47488a187a96de14fd09b26baaa2
data/CHANGELOG.markdown CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.1
4
+ * Fix binary exit code to be 1 when no matches are found (Mickaël Canévet)
5
+
3
6
  ## 1.4.0
4
7
  * Expressions support matching true/false booleans (Boyan Tabakov)
5
8
  * `--slice` option added to jgrep to get array elements (Jon McKenzie)
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
- unless result == [] or @options[:quiet] == true
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
- unless result == [] or @options[:quiet] == true
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.0
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: 2015-11-25 00:00:00.000000000 Z
12
+ date: 2016-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json