takelage 0.30.1 → 0.30.5

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: 692df780c364ffae6d6b8fda96b8afc12eeadf7e15dd4276f2e9a64294a86922
4
- data.tar.gz: 5e78a8e8aa6df34ab7f0a2cf7404ecf504f5ea0396518a79448e0acb354b3a58
3
+ metadata.gz: 3798431602738ebd91bf124034fec693982e0524328416c7424796e6548ecb66
4
+ data.tar.gz: fe31c05991ca3be5598b3b9baaadd0e3cce9d1decb74b5eccfebbc0cc2bb735b
5
5
  SHA512:
6
- metadata.gz: c1a251c7b85c8e575e2b619010b73eb02a6ccdab47ed9a71e343456bbbbe327a4d3889c7a8e7fa72f8439282cb59514b342da34cec4dac344a2307650afdf9db
7
- data.tar.gz: e9c5faccc90daff8261f1dbc1facfffa618eea2425d389a2d456eeaf490bfe2c95a356b465946d01813b9acc679d9c36d4226f4a4300f70c2c2ab8a0c2bcb041
6
+ metadata.gz: 0e6f571cc06aa007f0e5f05fe42a369716f61042b2d237f8e40ba6ec805df7ff704e05841020d4db14bc9013457300b36d9298544ead4c4c245be18ee7436b6d
7
+ data.tar.gz: 522dc2cf64c9e1051d165a5744a33bc6a7431f9d849ce2ca4ff30f4441dec84bfbd2cfd5afa96ed510ed0842e2d7ca811c0da3b34dc05eeea197d7af2689d8c5
@@ -8,7 +8,7 @@ module DockerCheckDaemon
8
8
  def docker_check_daemon
9
9
  return true if @docker_daemon_running
10
10
 
11
- return false unless command_available? 'docker'
11
+ return false unless command_available_else_error? 'docker'
12
12
 
13
13
  log.debug 'Check if the docker daemon is running'
14
14
 
@@ -7,22 +7,26 @@ require 'yaml'
7
7
  # Interaction with the operating system
8
8
  # rubocop:disable Metrics/ModuleLength
9
9
  module SystemModule
10
- # Check if a command is available
10
+ # Check if a command is available else log error message
11
11
  # @return [Boolean] is the command available?
12
- def command_available?(command)
13
- return true if instance_variable_get("@command_available_#{command}")
14
-
15
- log.debug "Check if the command \"#{command}\" is available"
12
+ def command_available_else_error?(command)
13
+ unless _command_available? command
14
+ log.error "The command \"#{command}\" is not available"
15
+ return false
16
+ end
16
17
 
17
- status = try "which #{command}"
18
+ command_available command
19
+ end
18
20
 
19
- unless status.exitstatus.zero?
20
- log.debug "The command \"#{command}\" is not available"
21
+ # Check if a command is available else log warning message
22
+ # @return [Boolean] is the command available?
23
+ def command_available_else_warning?(command)
24
+ unless _command_available? command
25
+ log.warning "The command \"#{command}\" is not available"
21
26
  return false
22
27
  end
23
28
 
24
- log.debug "The command \"#{command}\" is available"
25
- instance_variable_set("@command_available_#{command}", true)
29
+ command_available command
26
30
  end
27
31
 
28
32
  # Convert hash to yaml.
@@ -118,6 +122,23 @@ module SystemModule
118
122
 
119
123
  private
120
124
 
125
+ # Check if command is available
126
+ def _command_available?(command)
127
+ return true if instance_variable_get("@command_available_#{command}")
128
+
129
+ log.debug "Check if the command \"#{command}\" is available"
130
+ status = try "which #{command}"
131
+ return false unless status.exitstatus.zero?
132
+
133
+ true
134
+ end
135
+
136
+ # Command is available
137
+ def command_available(command)
138
+ log.debug "The command \"#{command}\" is available"
139
+ instance_variable_set("@command_available_#{command}", true)
140
+ end
141
+
121
142
  # Check if file exists.
122
143
  def _file_exists?(file)
123
144
  unless File.exist? File.expand_path(file)
@@ -9,7 +9,7 @@ module MutagenCheckDaemon
9
9
  def mutagen_check_daemon
10
10
  return true if @mutagen_daemon_available
11
11
 
12
- return false unless command_available? 'mutagen'
12
+ return false unless command_available_else_warning? 'mutagen'
13
13
 
14
14
  log.debug 'Check mutagen status'
15
15
 
data/lib/takelage/version CHANGED
@@ -1 +1 @@
1
- 0.30.1
1
+ 0.30.5
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takelage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.1
4
+ version: 0.30.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geospin