ops_team 0.2.9 → 0.3.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: e5c2fa7f06155a753554402aa2063aec1bf192aa171a6c2e601619ee6f80e148
4
- data.tar.gz: ca9c1bcde247a55ad469e423f5bde3a1ba3a85ad51694b519622e6a572304afc
3
+ metadata.gz: ff1832331084939d3f2b4d0b58fa2e50715051bdff1c82e984dfb289aee64a15
4
+ data.tar.gz: e2ecb1f387ce50d5c81500c29f0c67e727d105c66007dc090f67400c1617a4a5
5
5
  SHA512:
6
- metadata.gz: 7baea51515c766fd4409382b91560dd21948b95470d62fad73a6f23c3b58d92a0a0030d55c95dd7de6dfeb0fed73f6b35f7728419da1ca9962598873440cccf3
7
- data.tar.gz: c544f035850f131ff02882cf88196f4fc62ab91dc4142ce292cf10531f685415ad349aeaabd52e26f988932eba9fc02888a820502e7efff6fde8478cecfc1941
6
+ metadata.gz: cac44a0b4576375fac4210493292537c84b7ef0be6d3c38a16cf17f854058026184f0e96d3a61d4d6a54c226db4b90256844980f5d746120b5e0c3530610c0c0
7
+ data.tar.gz: b9d1c6be114864c3890b9a391f0f82f481c1bd556349500e8787fbfe960c30604ce04d8f5f5d94f5445c0912cf941798b414343e3f6a55d56c13ff14c0df8488
@@ -14,7 +14,7 @@ module Builtins
14
14
  end
15
15
  end
16
16
 
17
- def run
17
+ def run
18
18
  unless gemspec
19
19
  Output.error("Unable to load gemspec at '#{GEMSPEC_FILE}")
20
20
  return false
@@ -9,7 +9,7 @@ module Dependencies
9
9
  end
10
10
 
11
11
  def meet
12
- execute("apt-get install -y #{name}")
12
+ execute("#{sudo_string}#{meet_command}")
13
13
  end
14
14
 
15
15
  def unmeet
@@ -20,5 +20,17 @@ module Dependencies
20
20
  def should_meet?
21
21
  `uname`.chomp == "Linux"
22
22
  end
23
+
24
+ private
25
+
26
+ def sudo_string
27
+ return "" if ENV['USER'] == "root" || Options.get("apt.use_sudo") == false
28
+
29
+ "sudo "
30
+ end
31
+
32
+ def meet_command
33
+ "apt-get install -y #{name}"
34
+ end
23
35
  end
24
36
  end
@@ -3,7 +3,7 @@
3
3
  class Options
4
4
  class << self
5
5
  def get(path)
6
- @options.dig(*path.split('.'))
6
+ @options&.dig(*path.split('.'))
7
7
  end
8
8
 
9
9
  def set(options)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ops_team'
5
- s.version = '0.2.9'
5
+ s.version = '0.3.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: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com