assert 2.19.4 → 2.19.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffa19cd67672156c36573b10b2e25b2b18ffa6b291b763ee25aca8a36d10b5bb
4
- data.tar.gz: 12ed7729dae14a838f02780ba66da65cd097a705d6746ce898525c9cffd5a7b4
3
+ metadata.gz: 35f8f95e4407b3f78d1f7f1c764bb22c0287bbdb8cf44574c50c43bb9f30732c
4
+ data.tar.gz: 1c1ab4b120c4b8e006971b492ec5ac776d5cd4e55ac9df85f387d5065801d7fc
5
5
  SHA512:
6
- metadata.gz: d6be9346bf38ff9421f5663a18f4f3d2c020aa970245364db4df78100851feedaefae17fd2bc14bf21a2dc9d668efa5372fb1432402a587b6d79723e15e45179
7
- data.tar.gz: 69b152a7ec1f5fcbf738246477d7d8085aae7805e064536f3134e7b4aca0c2d22f0f4ea03c65e78488ba426c1db0b05c1b74adafd979f73f23d7c78349293667
6
+ metadata.gz: 77ffacb188ba7c3accba0ece4702a8695dd6735a09e2c86183c0e0a4106946b28d7e18bf8e4ead82046bd9376697fc45886b1e6bc43098f6c5eeaf4e78350037
7
+ data.tar.gz: 633e0ca4b3e75f7a653ff301cfebe98b76cd55a0665c3082dfb3cbd9b24e0d582e4f5aa752ec42a76e0c7035b61502f03cb4eddfd94662e9f797c04e093f4dd4
@@ -8,6 +8,9 @@ require "assert/version"
8
8
 
9
9
  module Assert
10
10
  class CLI
11
+ SUCCESS_EXIT_STATUS = 0
12
+ ERROR_EXIT_STATUS = 1
13
+
11
14
  def self.debug?(args)
12
15
  args.include?("-d") || args.include?("--debug")
13
16
  end
@@ -68,25 +71,31 @@ module Assert
68
71
  end
69
72
 
70
73
  def run
74
+ fails_plus_errors_count = 0
71
75
  begin
72
76
  @cli.parse!(@args)
73
77
  catch(:halt) do
74
- Assert::AssertRunner.new(Assert.config, @cli.args, @cli.opts).run
78
+ fails_plus_errors_count =
79
+ Assert::AssertRunner.new(Assert.config, @cli.args, @cli.opts).run
75
80
  end
76
81
  rescue CLIRB::HelpExit
77
82
  puts help
83
+ exit(SUCCESS_EXIT_STATUS)
78
84
  rescue CLIRB::VersionExit
79
85
  puts Assert::VERSION
86
+ exit(SUCCESS_EXIT_STATUS)
80
87
  rescue CLIRB::Error => ex
81
88
  puts "#{ex.message}\n\n"
82
89
  puts Assert.config.debug ? ex.backtrace.join("\n") : help
83
- exit(1)
90
+ exit(ERROR_EXIT_STATUS)
84
91
  rescue => ex
85
92
  puts "#{ex.class}: #{ex.message}"
86
93
  puts ex.backtrace.join("\n")
87
- exit(1)
94
+ exit(ERROR_EXIT_STATUS)
88
95
  end
89
- exit(0)
96
+ exit(
97
+ fails_plus_errors_count == 0 ? SUCCESS_EXIT_STATUS : ERROR_EXIT_STATUS,
98
+ )
90
99
  end
91
100
 
92
101
  def help
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Assert
4
- VERSION = "2.19.4"
4
+ VERSION = "2.19.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assert
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.4
4
+ version: 2.19.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-11 00:00:00.000000000 Z
12
+ date: 2021-01-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: much-style-guide