Implement `has_file' condition keyword

This commit is contained in:
Thibault Jouan
2013-08-17 17:10:48 +00:00
parent 3492382968
commit 2cbe1726f7
7 changed files with 69 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ require 'producer/core/actions/shell_command'
# condition tests (need to be defined before the condition DSL)
require 'producer/core/test'
require 'producer/core/tests/has_env'
require 'producer/core/tests/has_file'
require 'producer/core/cli'
require 'producer/core/condition'

View File

@@ -16,7 +16,8 @@ module Producer
end
end
define_test :has_env, Tests::HasEnv
define_test :has_env, Tests::HasEnv
define_test :has_file, Tests::HasFile
attr_accessor :tests

View File

@@ -0,0 +1,11 @@
module Producer
module Core
module Tests
class HasFile < Test
def success?
env.remote.fs.has_file? arguments.first
end
end
end
end
end