Sha256: 10cf5e882a04234725e868226d9ec197ba1dfcd508e219dbb044bbd3292a7c65

Contents?: true

Size: 811 Bytes

Versions: 4

Compression:

Stored size: 811 Bytes

Contents

# Accepts a parameter name and value and registers it as a default within Capistrano.
# Params:
# +name+
# +args+
# +block+
def _cset(name, *args, &block)
  unless exists?(name)
    set(name, *args, &block)
  end
end

# Prompts user entry
# Params:
# +prompt+
def text_prompt(prompt="Value: ")
  Capistrano::CLI.ui.ask(prompt) { |q| q.echo = true }
end

# Test to see if a file exists by providing 
# the full path to the expected file location
def remote_file_exists?(full_path)
  'true' ==  capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
end

# Test to see if a directory exists on a remote
# server by providing the full path to the expected
# directory
#
# Params:
#   +dir_path+
def remote_dir_exists?(dir_path)
  'true' == capture("if [[ -d #{dir_path} ]]; then echo 'true'; fi").strip
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
capistrano-ash-1.1.15 lib/ash/common.rb
capistrano-ash-1.1.14 lib/ash/common.rb
capistrano-ash-1.1.13 lib/ash/common.rb
capistrano-ash-1.1.12 lib/ash/common.rb