class Downspout::Config

Public Class Methods

add_credential( options = nil ) click to toggle source
# File lib/downspout/config.rb, line 85
def self.add_credential( options = nil )
  return nil unless options

  if (options.class == Downspout::Credential) then
    c = options
  else
    return nil unless options.respond_to?(:keys)

    options = {:scheme => 'ftp'}.merge!( options ) # defaults to FTP

    c = Credential.new( options )
  end
  
  $logger.debug("downspout | config | add_credential | #{c.host}, #{c.user_name}, #{c.scheme} ")

  @@credentials << c

  return c
end
credentials() click to toggle source
# File lib/downspout/config.rb, line 30
def self.credentials
  return @@credentials
end
curb_available?() click to toggle source
# File lib/downspout/config.rb, line 59
def self.curb_available?
  begin
    require 'curb'
    return true
  rescue LoadError
    return false
  end
end
default_prefix() click to toggle source
# File lib/downspout/config.rb, line 22
def self.default_prefix
  @@prefix
end
default_prefix=( name ) click to toggle source
# File lib/downspout/config.rb, line 26
def self.default_prefix=( name )
  @@prefix = name
end
disable_curb!() click to toggle source
# File lib/downspout/config.rb, line 80
def self.disable_curb!
  $logger.debug("downspout | config | disable_curb! | will fall back to Net/HTTP.")
  @@curb_enabled = false
end
disable_networking!() click to toggle source
# File lib/downspout/config.rb, line 46
def self.disable_networking!
  @@network_enabled = false
  return !(@@network_enabled)
end
enable_curb!() click to toggle source
# File lib/downspout/config.rb, line 72
def self.enable_curb!
  if self.curb_available? then
    @@curb_enabled = true
  else
    @@curb_enabled = false
  end
end
enable_networking!() click to toggle source
# File lib/downspout/config.rb, line 51
def self.enable_networking!
  @@network_enabled = true
end
max_redirects() click to toggle source
# File lib/downspout/config.rb, line 34
def self.max_redirects
  @@max_redirects
end
max_redirects=( num ) click to toggle source
# File lib/downspout/config.rb, line 38
def self.max_redirects=( num )
  @@max_redirects = num
end
network_enabled?() click to toggle source
# File lib/downspout/config.rb, line 42
def self.network_enabled?
  return @@network_enabled
end
ssl_verification?() click to toggle source
# File lib/downspout/config.rb, line 55
def self.ssl_verification?
  @@ssl_verification
end
tmp_dir() click to toggle source
# File lib/downspout/config.rb, line 14
def self.tmp_dir
  return @@tmp_dir
end
tmp_dir=( some_path ) click to toggle source
# File lib/downspout/config.rb, line 18
def self.tmp_dir=( some_path )
  @@tmp_dir = some_path
end
use_curb?() click to toggle source
# File lib/downspout/config.rb, line 68
def self.use_curb?
  @@curb_enabled unless !(self.curb_available?)
end