ops_team 1.8.0 → 1.9.0

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: bf24d85630158410b50202a7ccae33b7faecdd649a4a259aa3a69e5b4d245d1a
4
- data.tar.gz: 494af1f1ba4e0e75544be49cb0adba5b8178dcb17aaeb9fae878cb67b2ac7b92
3
+ metadata.gz: 6748a5f3f6c8e89731bd41488a8173dff6d2198dbd4498f02311b50aafa762e9
4
+ data.tar.gz: eb846d4e60073e8c575d11d51cca4f2d1de64cdae84698a5ef432d3723b7f0bf
5
5
  SHA512:
6
- metadata.gz: 31e68329d30149ce528c43f12a1eca82312dc9032b8a4c55d7321cbac32f093b193f87505bbd56f1d09e08e02b93aa274e3b6c7f880293cae70d33c4289e8e09
7
- data.tar.gz: 3d0c41e1a1dd6f36d53a5d020cfd318abfc50405bea0ae9781e82a264d82bc6c2a3e64a4b9abf952e20485b57e9a45e0a417abaceab14adad9c3ef1ed836196d
6
+ metadata.gz: ad9dd5ec65d37be0852049d68d73e98e7469dbc06db976b9c76b1cad39a0c1b65ccbc67dcc43d57453b0ab15061ba27ee5b655955394e4406eb4e73955ee0ea4
7
+ data.tar.gz: f05344a3215f9b015ec0d3890b7fd378263205908fb357e10cdd13a8c2489e40cb77b59b0c963b0f6ae8d3061380915153dd4405765c4535cdd0f8e966538dff
@@ -4,18 +4,46 @@ require 'dependency'
4
4
 
5
5
  module Dependencies
6
6
  class Custom < Dependency
7
+ class CustomConfigError < StandardError; end
8
+
9
+ def initialize(definition)
10
+ super
11
+ @definition = definition
12
+ @name, @config = parse_definition
13
+ end
14
+
7
15
  def met?
8
- # we always want to try to meet this dependency
9
16
  false
10
17
  end
11
18
 
19
+ def always_act?
20
+ true
21
+ end
22
+
12
23
  def meet
13
- # this dependency is just a custom, idempotent command
14
- execute(name)
24
+ execute(up_command) if up_command
15
25
  end
16
26
 
17
27
  def unmeet
18
- true
28
+ execute(down_command) if down_command
29
+ end
30
+
31
+ private
32
+
33
+ def up_command
34
+ @up_command ||= @definition.is_a?(Hash) ? @config["up"] : name
35
+ end
36
+
37
+ def down_command
38
+ @down_command ||= @config["down"]
39
+ end
40
+
41
+ def parse_definition
42
+ return @definition, {} if @definition.is_a?(String)
43
+ return @definition.first if @definition.is_a?(Hash)
44
+
45
+ raise CustomConfigError, "Expected custom dependency @definition '#{@definition}' " \
46
+ "to be a String or a Hash; received #{@definition.class}."
19
47
  end
20
48
  end
21
49
  end
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.8.0'
5
+ s.version = '1.9.0'
6
6
  s.authors = [
7
7
  'nickthecook@gmail.com'
8
8
  ]
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_team
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2021-05-05 00:00:00.000000000 Z
@@ -114,22 +114,22 @@ dependencies:
114
114
  name: net-ssh
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - "~>"
118
- - !ruby/object:Gem::Version
119
- version: '6.1'
120
117
  - - ">="
121
118
  - !ruby/object:Gem::Version
122
119
  version: 6.1.0
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: '6.1'
123
123
  type: :runtime
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
126
126
  requirements:
127
- - - "~>"
128
- - !ruby/object:Gem::Version
129
- version: '6.1'
130
127
  - - ">="
131
128
  - !ruby/object:Gem::Version
132
129
  version: 6.1.0
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: '6.1'
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: require_all
135
135
  requirement: !ruby/object:Gem::Requirement
@@ -150,8 +150,8 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: 1.1.6
153
- description:
154
- email:
153
+ description:
154
+ email:
155
155
  executables:
156
156
  - ops
157
157
  extensions: []
@@ -212,7 +212,7 @@ homepage: https://github.com/nickthecook/ops
212
212
  licenses:
213
213
  - GPL-3.0-only
214
214
  metadata: {}
215
- post_install_message:
215
+ post_install_message:
216
216
  rdoc_options: []
217
217
  require_paths:
218
218
  - lib
@@ -227,8 +227,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
229
  requirements: []
230
- rubygems_version: 3.2.22
231
- signing_key:
230
+ rubygems_version: 3.0.3.1
231
+ signing_key:
232
232
  specification_version: 4
233
233
  summary: ops_team handles basic automation for your project, driven by self-documenting
234
234
  YAML config