ops_team 1.16.2 → 1.18.0

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: 10a9221dda4f8c0f68a5b7d16cdd3f4b659e1fffa34a5791c950ce13a3555cef
4
- data.tar.gz: 8ccff2e6feaedcd4263cc426b78263eefe52e0a934070b55d5726a3e4e9933b8
3
+ metadata.gz: d9bca1162d5d436bd7e24bdbf758b7731e79dad8c06cfa79918362d521b8ef0a
4
+ data.tar.gz: 747a089e7902466280c1098f3fb7a3ce57bd25cc71eb55d71c6588219839388e
5
5
  SHA512:
6
- metadata.gz: a314cbc22275e56b5bf94fe346219e054a6b666c726a33606bc5559cd8e1ccc5844b0cec5fd2c812bb2f55e1204b0ca3e29b03653c93bb5e4b77261a02f9385d
7
- data.tar.gz: a3874f0db5ce4d8e77dd9b8aa23ed2bc3b01051e43c723c7c515b630eebead194486318b83b5f0b6f887301eaeeed8af87844c8484edaa646a35da780ba93726
6
+ metadata.gz: 81b79efa6791af858d44106957e42ab476486fa92b2709001ec9e54e7b23ad5b5d7df29673d788c4e2c0d3f73252447997b5238aa60d45fb6aa25df08d9dcb80
7
+ data.tar.gz: 5b00fc9529f48ddcc39705fbf122e7321bcdcd8383a9b1f1f9b08859e4ccc395ec2216aae1c34181f504daa37a461c6956de2ffeec679814f526edc7ca2025c9
data/lib/action.rb CHANGED
@@ -36,6 +36,8 @@ class Action
36
36
  end
37
37
 
38
38
  def command
39
+ return @config if @config.is_a?(String)
40
+
39
41
  @config["command"]
40
42
  end
41
43
 
@@ -55,7 +57,7 @@ class Action
55
57
  @config_errors ||= begin
56
58
  errors = []
57
59
 
58
- errors << "No 'command' specified in 'action'." unless @config['command']
60
+ errors << "No 'command' specified in 'action'." unless command
59
61
 
60
62
  errors
61
63
  end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dependencies
4
+ class Snap < VersionedDependency
5
+ def met?
6
+ system("snap list | grep -q \"^name \"")
7
+ end
8
+
9
+ def meet
10
+ execute("#{sudo_string}snap install #{name}")
11
+ end
12
+
13
+ def unmeet
14
+ # do nothing; we don't want to uninstall packages and reinstall them every time
15
+ true
16
+ end
17
+
18
+ def should_meet?
19
+ return false unless Options.get("snap.install")
20
+ return false unless `uname`.chomp == "Linux"
21
+ return false unless system("which snap", out: File::NULL, err: File::NULL)
22
+
23
+ true
24
+ end
25
+
26
+ private
27
+
28
+ def sudo_string
29
+ return "sudo " unless Options.get("snap.use_sudo") == false
30
+ end
31
+ end
32
+ 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.16.2'
5
+ s.version = '1.18.0'
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.16.2
4
+ version: 1.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com
@@ -215,6 +215,7 @@ files:
215
215
  - lib/dependencies/gem.rb
216
216
  - lib/dependencies/helpers/apt_cache_policy.rb
217
217
  - lib/dependencies/pip.rb
218
+ - lib/dependencies/snap.rb
218
219
  - lib/dependencies/sshkey.rb
219
220
  - lib/dependencies/versioned_dependency.rb
220
221
  - lib/dependency.rb
@@ -251,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
252
  - !ruby/object:Gem::Version
252
253
  version: '0'
253
254
  requirements: []
254
- rubygems_version: 3.1.6
255
+ rubygems_version: 3.3.7
255
256
  signing_key:
256
257
  specification_version: 4
257
258
  summary: ops_team handles basic automation for your project, driven by self-documenting