module PasswordChanger
Main module
Main
Constants
- VERSION
Attributes
config[R]
debug_mode[RW]
logger[R]
plugin_manager[R]
plugin_prefix[R]
Public Class Methods
configure_i18n()
click to toggle source
# File lib/password_changer/main.rb, line 25 def configure_i18n I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks) I18n.load_path = Dir[::File.join(PasswordChanger.root_path, 'locales', '*.yml')] I18n.backend.load_translations I18n.available_locales = [:en, :de] I18n.enforce_available_locales = false end
debug_mode?()
click to toggle source
# File lib/password_changer/main.rb, line 17 def debug_mode? @debug_mode == true end
enable_debug_mode()
click to toggle source
# File lib/password_changer/main.rb, line 39 def enable_debug_mode self.logger.info "Activating debug mode." self.logger.mode = :debug self.debug_mode = true require 'pry' if RUBY_VERSION < '2.0.0' require 'debugger' else require 'byebug' end rescue LoadError PasswordChanger.logger.error "You tried to enable debug-mode, but either 'pry'- or 'byebug (ruby > 2)/debugger (ruby < 2)'-gem are not installed. Please fix that before using the debug-switch again." end
enable_verbose_mode()
click to toggle source
# File lib/password_changer/main.rb, line 33 def enable_verbose_mode self.logger.info "Activating verbose mode." PasswordChanger.logger.mode = :debug end
load_plugins()
click to toggle source
# File lib/password_changer/main.rb, line 21 def load_plugins self.plugin_manager.load_plugins end
root_path()
click to toggle source
# File lib/password_changer/main.rb, line 13 def root_path File.expand_path '../../../', __FILE__ end