Parent

Class Index [+]

Quicksearch

Capistrano::Deploy::LocalDependency

Attributes

configuration[R]
message[R]

Public Class Methods

new(configuration) click to toggle source
    # File lib/capistrano/recipes/deploy/local_dependency.rb, line 7
 7:       def initialize(configuration)
 8:         @configuration = configuration
 9:         @success = true
10:       end

Private Class Methods

on_windows?() click to toggle source
    # File lib/capistrano/recipes/deploy/local_dependency.rb, line 45
45:       def self.on_windows?
46:         RUBY_PLATFORM =~ /mswin|mingw/
47:       end
windows_executable_extensions() click to toggle source
    # File lib/capistrano/recipes/deploy/local_dependency.rb, line 49
49:       def self.windows_executable_extensions
50:         %(.exe .bat .com .cmd)
51:       end

Public Instance Methods

command(command) click to toggle source
    # File lib/capistrano/recipes/deploy/local_dependency.rb, line 12
12:       def command(command)
13:         @message ||= "`#{command}' could not be found in the path on the local host"
14:         @success = find_in_path(command)
15:         self
16:       end
or(message) click to toggle source
    # File lib/capistrano/recipes/deploy/local_dependency.rb, line 18
18:       def or(message)
19:         @message = message
20:         self
21:       end
pass?() click to toggle source
    # File lib/capistrano/recipes/deploy/local_dependency.rb, line 23
23:       def pass?
24:         @success
25:       end

Private Instance Methods

find_in_path(utility) click to toggle source

Searches the path, looking for the given utility. If an executable file is found that matches the parameter, this returns true.

    # File lib/capistrano/recipes/deploy/local_dependency.rb, line 31
31:       def find_in_path(utility)
32:         path = (ENV['PATH'] || "").split(File::PATH_SEPARATOR)
33:         suffixes = self.class.on_windows? ? self.class.windows_executable_extensions : [""]
34: 
35:         path.each do |dir|
36:           suffixes.each do |sfx|
37:             file = File.join(dir, utility + sfx)
38:             return true if File.executable?(file)
39:           end
40:         end
41: 
42:         false
43:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.