Sha256: 49e58b0b89ab431531fd46cc9d0f1d62f0bb82362913add6c7109924fa784aa7

Contents?: true

Size: 863 Bytes

Versions: 5

Compression:

Stored size: 863 Bytes

Contents

# encoding: utf-8
module LocalPac
  @config    = LocalPac::Config.new
  @ui_logger = LocalPac::UiLogger.new

  class << self
    attr_accessor :debug_mode, :config, :ui_logger

    def enable_debug_mode
      LocalPac.ui_logger.info "Activating debug mode."

      require 'pry'
      require 'debugger'
    rescue LoadError
      LocalPac.ui_logger.error "You tried to enable debug-mode, but either 'pry'- or 'debugger'-gem are not installed. Please fix that before using the debug-switch again."
    end

    def error_id
      SecureRandom.hex
    end

    def root_path
      ::File.expand_path('../../..', __FILE__)
    end
  end

  I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
  I18n.load_path = Dir[::File.join(LocalPac.root_path, 'app', 'locales', '*.yml')]
  I18n.backend.load_translations

  I18n.enforce_available_locales = true
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
local_pac-0.10.2 lib/local_pac/main.rb
local_pac-0.10.1 lib/local_pac/main.rb
local_pac-0.10.0 lib/local_pac/main.rb
local_pac-0.9.0 lib/local_pac/main.rb
local_pac-0.7.0 lib/local_pac/main.rb