ops_team 0.10.0 → 0.10.1

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: 047c3860b15eb79d392d3616d822530752746acee221a309b3ad0fbe35a7c4fa
4
- data.tar.gz: db149bdce3d9777ec2416ba7489a0cea00bb268d8d82ce3c22ec4326b6a9c7e9
3
+ metadata.gz: 802441d64eb1dc1403011f6b912898ba1caebcfada19bb1241928ad879c1f086
4
+ data.tar.gz: 47fa8c46b9114dfe577dcf8a9f43525abaf01ad76c809ffb239449400a866202
5
5
  SHA512:
6
- metadata.gz: 3ee633e1ba692622711b0d9b6d2a5e4357dd0dbcfdad22567b858616328d2548a0ee8be45c9aa90517f17f15451dad2ff720cb02314829c0feab41164a4d5e4b
7
- data.tar.gz: 7b03cdd354652f5c68ca1b430a1540136e08f33498a29021e4ed6fa9147779b82104c6ece6878d16b5c7530af1491f75aad23b7fe2c4db6ae0bf669f17276e5f
6
+ metadata.gz: f107e6877affa1afc72481239e9e3d7e3a7e6e8b4722ee2e8e5f21af789e200ab271ef974904ced2e0e06931485c62ceeb67c5b3435efc376e8229e2d61535c0
7
+ data.tar.gz: 06e406cdbde8295490977e552bd7cef0f2a53652a1d818d6892ec68c749d4788d2079a9916c1bf6619a583b3bc500bb0f7cf28a3773bf3f3ce702e5b9a23378e
@@ -52,6 +52,8 @@ module Builtins
52
52
  end
53
53
 
54
54
  def actions
55
+ return [] unless @config["actions"]
56
+
55
57
  @config["actions"].map do |name, value|
56
58
  format("%<name>-35s %<desc>s",
57
59
  name: name.yellow,
@@ -20,7 +20,7 @@ module Dependencies
20
20
  end
21
21
 
22
22
  def should_meet?
23
- `uname`.chomp == "Linux" && system("which apk &>/dev/null")
23
+ `uname`.chomp == "Linux" && system("which apk")
24
24
  end
25
25
  end
26
26
  end
@@ -23,7 +23,7 @@ module Dependencies
23
23
  end
24
24
 
25
25
  def should_meet?
26
- `uname`.chomp == "Linux" && system("which apt-get &>/dev/null")
26
+ `uname`.chomp == "Linux" && system("which apt-get")
27
27
  end
28
28
 
29
29
  private
@@ -45,7 +45,7 @@ module Dependencies
45
45
  end
46
46
 
47
47
  def sudo_string
48
- return "" if ENV['USER'] == "root" || Options.get("apt.use_sudo") == false
48
+ return "" if ENV['USER'] == "root" || `whoami` == "root" || Options.get("apt.use_sudo") == false
49
49
 
50
50
  "sudo "
51
51
  end
@@ -35,18 +35,6 @@ module Dependencies
35
35
  match.nil? ? nil : match[1]
36
36
  end
37
37
 
38
- def version_lines
39
- @version_lines ||= begin
40
- version_table_index = apt_cache_lines.find_index { |line| line.match?(/Version table:/) }
41
-
42
- apt_cache_lines[version_table_index..-1].each_with_object([]) do |line, versions|
43
- next unless line.match(/ *(\*\*\*)? .*/)
44
-
45
- versions << line
46
- end
47
- end
48
- end
49
-
50
38
  def apt_cache_lines
51
39
  @apt_cache_lines ||= `apt-cache policy #{name}`.split("\n")
52
40
  end
data/lib/ops.rb CHANGED
@@ -94,7 +94,8 @@ class Ops
94
94
  @config ||= begin
95
95
  Output.warn("File '#{CONFIG_FILE}' does not exist.") unless File.exist?(CONFIG_FILE)
96
96
  YAML.load_file(CONFIG_FILE)
97
- rescue StandardError
97
+ rescue StandardError => e
98
+ Output.warn("Error parsing '#{CONFIG_FILE}': #{e}")
98
99
  {}
99
100
  end
100
101
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ops_team'
5
- s.version = '0.10.0'
5
+ s.version = '0.10.1'
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.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com