brut 0.19.1 → 0.19.2

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
  SHA256:
3
- metadata.gz: '059f35e310df94f8c66d6c947b18921635e0718401777718f1f4918fa98a5074'
4
- data.tar.gz: e9801d43543124933a32424a0a2d3e0d7224c8fb81b30869ee59bf51f12a52df
3
+ metadata.gz: 765659b6fbd1258a4b5615cfea8e7d273fbebd4336ceb6518367bc5ad329bcb8
4
+ data.tar.gz: 35777088ab7cc473a3ef5459087349846586798154e9f699e52b3b5be22c64db
5
5
  SHA512:
6
- metadata.gz: 3b26481d9ae1c0d8c664c350a9963dc4c924f5ae2941052460241831e017ee68725e84959408e3880978fcfe5ef95efd303bd04316019da9b4953869ddba48c4
7
- data.tar.gz: 3dab0120bd0ddb97ff4405606285cc4cff24a896cc01be74914173fda0f412e334d3bc8f1f88d363aefccfa43c8001b860beb158c4a4e26fbb4fdb0f21a4d635
6
+ metadata.gz: 946899aa325e088a414c88e63b6bd58c7278380e90929f886905b9cd100c2a98d672d570a036e0edf66953719dccb4b6bd1dd5525f885fcc2421ea82da142ece
7
+ data.tar.gz: 9bfe8cef4bd6e4effbca418ab446796fed352999f21b404d6904ec5ccd048bff9ed18de6f9fd47e8d45ad7045b73bf782375ca7bed13a1022d2af0e1e976bde5
@@ -19,9 +19,14 @@ class Brut::CLI::Apps::Deploy < Brut::CLI::Commands::BaseCommand
19
19
  def default_rack_env = "development"
20
20
 
21
21
  def run
22
- if delegate_to_command(Brut::CLI::Apps::Deploy::Build.new) != 0
23
- error "<== Build failed."
24
- return 1
22
+ execute_result = Brut::CLI::ExecuteResult.new do
23
+ delegate_to_command(Brut::CLI::Apps::Deploy::Build.new)
24
+ end
25
+ if execute_result.failed?
26
+ puts theme.error.render("Build failed.")
27
+ return execute_result.exit_status do |error_message|
28
+ puts theme.error.render("Error message from build: #{error_message}")
29
+ end
25
30
  end
26
31
  options.set_default(:deploy, true)
27
32
  version = ""
@@ -152,9 +157,14 @@ class Brut::CLI::Apps::Deploy < Brut::CLI::Commands::BaseCommand
152
157
 
153
158
  def run
154
159
  if !options.skip_checks?
155
- if delegate_to_command(Brut::CLI::Apps::Deploy::Check.new) != 0
160
+ execute_result = Brut::CLI::ExecuteResult.new do
161
+ delegate_to_command(Brut::CLI::Apps::Deploy::Check.new)
162
+ end
163
+ if execute_result.failed?
156
164
  puts theme.error.render("Pre-build checks failed.")
157
- return 1
165
+ return execute_result.exit_status do |error_message|
166
+ puts theme.error.render("Error message from checks: #{error_message}")
167
+ end
158
168
  end
159
169
  end
160
170
  version = ""
@@ -19,6 +19,10 @@ class Brut::CLI::Commands::BaseCommand
19
19
  self.run
20
20
  end
21
21
 
22
+ # Delegates control to another command. This is most useful for aliasing one command
23
+ # to another. If you want to run another command as part of yoru command, you can use
24
+ # this, however you must use `Brut::CLI::ExecuteResult` to examine the return value, so you know if
25
+ # the command succeeded or not.
22
26
  def delegate_to_command(command,execution_context=:use_ivar)
23
27
  execution_context = if execution_context == :use_ivar
24
28
  @execution_context
data/lib/brut/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Brut
2
2
  # @!visibility private
3
- VERSION = "0.19.1"
3
+ VERSION = "0.19.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brut
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.1
4
+ version: 0.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Bryant Copeland