Class: CapUtil::SharedPath

Inherits:
Object
  • Object
show all
Includes:
CapUtil
Defined in:
lib/cap-util/shared_path.rb

Overview

SharedPath models the path to the set of shared deployed code. named after cap’s ‘shared_path` method b/c they point at similar locations.

Constant Summary

Constants included from CapUtil

VERSION

Instance Method Summary collapse

Methods included from CapUtil

color, #get, halt, #hostname, included, run_locally, run_locally_with_stdin, say, say_bulleted, say_error, say_raw, say_warning, time

Constructor Details

#initialize(cap, path = nil) ⇒ SharedPath

Returns a new instance of SharedPath.



11
12
13
14
# File 'lib/cap-util/shared_path.rb', line 11

def initialize(cap, path = nil)
  @cap = cap
  @shared_path = File.expand_path(path || cap.shared_path)
end

Instance Method Details

#rm_rf(rel_path) ⇒ Object



16
17
18
# File 'lib/cap-util/shared_path.rb', line 16

def rm_rf(rel_path)
  run "rm -rf #{@shared_path}/#{rel_path}"
end