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.



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

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

Instance Method Details

#authObject



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

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

#handle_exception(e) ⇒ Object



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

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