ops_team 1.10.0 → 1.11.0.pre.rc

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: 21ea800cf1d407a6b9e372b422ac29ae6e7ace9597e55181aaef981290382dca
4
- data.tar.gz: 37f00565ecdcfa789df0022a83352966e2c54080979321d82baaa2a0e99868aa
3
+ metadata.gz: 296e5dabea491580c6f1673cc4f07ab010a3e914fa949532101afe23f5ef2a90
4
+ data.tar.gz: a14f9e7d5b38a9a752f6682a9558c641448344802a993af32a9aad98122acbc8
5
5
  SHA512:
6
- metadata.gz: 6f5a443b2cc90a6d390a4f8f8805e1ab7236af5a04921177569ae8f64d7288295a83823606cbbc4402be419152a1ae2072e7704b846ee2653191d86bcb2be4ef
7
- data.tar.gz: af770963d44d9eca6140d033626751143de5561625fb4180906350eeb0b6c36391c0193267e7ed32c37ce0f47ccc70a332561ed011ccf126538c04badc543146
6
+ metadata.gz: 6654ec92375f8270ddb85f9a9fbc4dcc114b858ac7672fa86d4bcec92cac5fc163157feb4bdfee6a0a73ad15c673ac8337e336f53dd7fc8a85e943d3c2dbfd75
7
+ data.tar.gz: 8f1266dfdf10a8b1da48ae7fc37a1baa07c7bcc86b420338e8a5ef962a5f9b6033c1bbdea233df36137fc4e2c09cfb3bfb7f61863dceaa5220d5769eaad46e5d
data/bin/ops CHANGED
@@ -28,4 +28,4 @@ end
28
28
  require_relative "../loader"
29
29
  require 'ops'
30
30
 
31
- Ops.new(ARGV, config_file: options[:file]).run
31
+ exit Ops.new(ARGV, config_file: options[:file]).run
@@ -25,6 +25,8 @@ module Builtins
25
25
  timer_task.shutdown if task_complete?
26
26
  end
27
27
  Output.out("\rCountdown complete after #{sleep_seconds}s.")
28
+
29
+ true
28
30
  end
29
31
 
30
32
  private
data/lib/builtins/up.rb CHANGED
@@ -16,21 +16,17 @@ module Builtins
16
16
  end
17
17
 
18
18
  def run
19
- # TODO: return a success/failure status to the caller
20
19
  meet_dependencies
21
- end
22
20
 
23
- private
21
+ return true unless fail_on_error?
24
22
 
25
- def dependency_handler
26
- Helpers::DependencyHandler.new(deps_to_meet)
23
+ deps_to_meet.all?(&:success?)
27
24
  end
28
25
 
29
- def meet_dependencies
30
- dependency_handler.dependencies.each do |dependency|
31
- # don't even output anything for dependencies that shouldn't be considered on this machine
32
- next unless dependency&.should_meet?
26
+ private
33
27
 
28
+ def meet_dependencies
29
+ deps_to_meet.each do |dependency|
34
30
  Output.status("[#{dependency.type}] #{dependency.name}")
35
31
 
36
32
  meet_dependency(dependency)
@@ -38,7 +34,6 @@ module Builtins
38
34
  end
39
35
 
40
36
  def meet_dependency(dependency)
41
- # TODO: make this simpler, and factor in `should_meet?` above, too
42
37
  dependency.meet if !dependency.met? || dependency.always_act?
43
38
 
44
39
  if dependency.success?
@@ -51,9 +46,21 @@ module Builtins
51
46
  end
52
47
 
53
48
  def deps_to_meet
49
+ @deps_to_meet ||= dependency_handler.dependencies.select(&:should_meet?)
50
+ end
51
+
52
+ def dependency_handler
53
+ Helpers::DependencyHandler.new(dependencies)
54
+ end
55
+
56
+ def dependencies
54
57
  return @config["dependencies"] if @args.empty?
55
58
 
56
- return @config["dependencies"].select { |dep, names| @args.include?(dep) }
59
+ @config["dependencies"].select { |dep, _names| @args.include?(dep) }
60
+ end
61
+
62
+ def fail_on_error?
63
+ Options.get("up.fail_on_error") || false
57
64
  end
58
65
  end
59
66
  end
@@ -39,11 +39,9 @@ module Dependencies
39
39
  end
40
40
 
41
41
  def parse_definition
42
- return @definition, {} if @definition.is_a?(String)
43
42
  return @definition.first if @definition.is_a?(Hash)
44
43
 
45
- raise CustomConfigError, "Expected custom dependency @definition '#{@definition}' " \
46
- "to be a String or a Hash; received #{@definition.class}."
44
+ [@definition.to_s, {}]
47
45
  end
48
46
  end
49
47
  end
data/lib/runner.rb CHANGED
@@ -9,7 +9,9 @@ require 'environment'
9
9
 
10
10
  class Runner
11
11
  class UnknownActionError < StandardError; end
12
+
12
13
  class ActionConfigError < StandardError; end
14
+
13
15
  class NotAllowedInEnvError < StandardError; end
14
16
 
15
17
  def initialize(action_name, args, config, config_path)
data/ops_team.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ops_team'
5
- s.version = '1.10.0'
5
+ s.version = '1.11.0-rc'
6
6
  s.authors = [
7
7
  'nickthecook@gmail.com'
8
8
  ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_team
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0.pre.rc
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com
@@ -223,9 +223,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
223
223
  version: '2.5'
224
224
  required_rubygems_version: !ruby/object:Gem::Requirement
225
225
  requirements:
226
- - - ">="
226
+ - - ">"
227
227
  - !ruby/object:Gem::Version
228
- version: '0'
228
+ version: 1.3.1
229
229
  requirements: []
230
230
  rubygems_version: 3.0.3.1
231
231
  signing_key: