Class: FTPMVC::Application

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Logger
Defined in:
lib/ftpmvc/application.rb

Instance Method Summary collapse

Methods included from Logger

#logger

Constructor Details

#initialize(&block) ⇒ Application

Returns a new instance of Application.



14
15
16
17
18
# File 'lib/ftpmvc/application.rb', line 14

def initialize(&block)
  @fs = Directory.new
  @filter_chain = Filter::FilesystemAccess.new(@fs, nil)
  instance_eval(&block) if block_given?
end

Instance Method Details

#authObject



20
21
22
# File 'lib/ftpmvc/application.rb', line 20

def auth
  @authenticator ||= Authenticator::Promiscuous.new
end

#handle_exception(e) ⇒ Object



24
25
26
27
# File 'lib/ftpmvc/application.rb', line 24

def handle_exception(e)
  logger.error %Q[#{e.class}: #{e.message}\n#{e.backtrace.join("\n")}]
  @exception_handler.call(e) unless @exception_handler.nil?
end