Implement `has_executable' condition keyword
This commit is contained in:
@@ -13,10 +13,11 @@ module Producer
|
||||
end
|
||||
end
|
||||
|
||||
define_test :file_contains, Tests::FileContains
|
||||
define_test :has_env, Tests::HasEnv
|
||||
define_test :has_dir, Tests::HasDir
|
||||
define_test :has_file, Tests::HasFile
|
||||
define_test :file_contains, Tests::FileContains
|
||||
define_test :has_env, Tests::HasEnv
|
||||
define_test :has_executable, Tests::HasExecutable
|
||||
define_test :has_dir, Tests::HasDir
|
||||
define_test :has_file, Tests::HasFile
|
||||
|
||||
attr_reader :block, :env, :tests
|
||||
|
||||
|
14
lib/producer/core/tests/has_executable.rb
Normal file
14
lib/producer/core/tests/has_executable.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
module Producer
|
||||
module Core
|
||||
module Tests
|
||||
class HasExecutable < Test
|
||||
def verify
|
||||
remote.execute("type #{arguments.first}")
|
||||
true
|
||||
rescue RemoteCommandExecutionError
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user