Class: Capistrano::Cron::Output::Redirection

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/cron/output/redirection.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ Redirection

Returns a new instance of Redirection.



4
5
6
# File 'lib/capistrano/cron/output/redirection.rb', line 4

def initialize(output)
  @output = output
end

Instance Method Details

#to_s ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/capistrano/cron/output/redirection.rb', line 8

def to_s
  return "" unless defined?(@output)
  case @output
  when String then redirect_from_string
  when Hash then redirect_from_hash
  when NilClass then ">> /dev/null 2>&1"
  when Proc then @output.call
  else ""
  end
end