Sha256: 4ad3193f907d41339c0d04f12ee52c9dadda957a1eceb0c775f8bd6d2d37b0aa

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

$LOAD_PATH <<::File.expand_path('../lib/', __FILE__)

require 'local_pac'

require File.expand_path('../app/controllers/application_controller.rb', __FILE__)
Dir.glob(::File.expand_path('../app/controllers/*.rb', __FILE__)).each { |f| require f }

LocalPac.ui_logger.level = ::Logger::INFO

trap LocalPac.config.reload_config_signal do
  begin
    LocalPac.ui_logger.warn 'Reload of configuration requested'
    LocalPac::Actions::ReloadConfiguration.new.run
    LocalPac.ui_logger.info 'Reload of configuration successful'
  rescue => e
    LocalPac.ui_logger.fatal "Reload of configuration failed: #{e.message}"
  end
end

trap LocalPac.config.reload_storage_signal do
  begin
    LocalPac.ui_logger.warn 'Reload of local storage requested'
    LocalPac::Actions::ReloadLocalStorage.new([LocalPac::App::FileServeController, LocalPac::App::LookupController]).run
    LocalPac.ui_logger.info 'Reload of local storage successful'
  rescue => e
    LocalPac.ui_logger.fatal "Reload of local storage failed: #{e.message}"
  end
end

map '/' do
  run LocalPac::App::FileServeController
end

map '/v1/pac/' do
  run LocalPac::App::FileServeController
end

map '/v1/lookup/' do
  run LocalPac::App::LookupController
end

map LocalPac::App::AssetsController.assets_prefix do
  run LocalPac::App::AssetsController.assets
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
local_pac-0.3.0 config.ru
local_pac-0.2.3 config.ru
local_pac-0.2.2 config.ru
local_pac-0.2.1 config.ru
local_pac-0.2.0 config.ru