Class: Simp::Rake::Helpers
- Inherits:
-
Object
- Object
- Simp::Rake::Helpers
- Defined in:
- lib/simp/rake/helpers.rb,
lib/simp/rake/helpers/version.rb,
lib/simp/rake/helpers/rpm_spec.rb
Defined Under Namespace
Modules: RPMSpec
Constant Summary collapse
- VERSION =
'6.0.0'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dir = Dir.pwd) ⇒ Helpers
constructor
dir = top-level of project,.
Constructor Details
Class Method Details
.check_required_commands(required_commands) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/simp/rake/helpers.rb', line 19 def self.check_required_commands(required_commands) require 'facter' invalid_commands = [] Array(required_commands).each do |command| unless Array(command).find { |x| Facter::Core::Execution.which(x) } invalid_commands << Array(command).join(' or ') end end return if invalid_commands.empty? errmsg = <<-EOM Error: The following required commands were not found on your system: * #{invalid_commands.join("\n * ")} Please update your system and try again. EOM raise(errmsg) end |