Class: Carioca::Configuration
- Inherits:
-
Object
- Object
- Carioca::Configuration
- Defined in:
- lib/carioca/configuration.rb
Constant Summary
Constants included from Constants
Carioca::Constants::BUILTINS, Carioca::Constants::DEFAULT_COLORS_STATUS, Carioca::Constants::DEFAULT_CONFIG_FILE, Carioca::Constants::DEFAULT_CONFIG_ROOT, Carioca::Constants::DEFAULT_DEBUGGER_TRACER, Carioca::Constants::DEFAULT_EMOJI_STATUS, Carioca::Constants::DEFAULT_ENVIRONMENT, Carioca::Constants::DEFAULT_ENVIRONMENTS_LIST, Carioca::Constants::DEFAULT_LOCALE, Carioca::Constants::DEFAULT_LOG_LEVEL, Carioca::Constants::DEFAULT_MASTER_KEY_FILE, Carioca::Constants::DEFAULT_OUTPUT_MODE, Carioca::Constants::DEFAULT_OUTPUT_TARGET, Carioca::Constants::DEFAULT_REGISTRY_FILE, Carioca::Constants::DEFAULT_SECURE_STORE_FILE, Carioca::Constants::DEFAULT_USER_CONFIG_PATH, Carioca::Constants::SERVICES_FULL_LIST_SPECS, Carioca::Constants::SERVICES_MANDATORY_SPECS, Carioca::Constants::SERVICES_SPECS_DETAIL
Instance Attribute Summary collapse
-
#builtins ⇒ Object
Returns the value of attribute builtins.
-
#config_file ⇒ Object
Returns the value of attribute config_file.
-
#config_root ⇒ Object
Returns the value of attribute config_root.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#debugger_tracer ⇒ Object
Returns the value of attribute debugger_tracer.
-
#default_locale ⇒ Object
Returns the value of attribute default_locale.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#init_from_file ⇒ Object
writeonly
Sets the attribute init_from_file.
-
#locales_availables ⇒ Object
readonly
Returns the value of attribute locales_availables.
-
#locales_load_path ⇒ Object
Returns the value of attribute locales_load_path.
-
#log_file ⇒ Object
Returns the value of attribute log_file.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#log_target ⇒ Object
Returns the value of attribute log_target.
-
#master_key_file ⇒ Object
Returns the value of attribute master_key_file.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output_colors ⇒ Object
writeonly
Sets the attribute output_colors.
-
#output_emoji ⇒ Object
writeonly
Sets the attribute output_emoji.
-
#output_mode ⇒ Object
Returns the value of attribute output_mode.
-
#output_target ⇒ Object
Returns the value of attribute output_target.
-
#secure_store_file ⇒ Object
Returns the value of attribute secure_store_file.
-
#supported_environments ⇒ Object
Returns the value of attribute supported_environments.
-
#user_config_path ⇒ Object
Returns the value of attribute user_config_path.
Instance Method Summary collapse
- #debug? ⇒ Boolean
- #init_from_file? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #log_file? ⇒ Boolean
- #output_colors? ⇒ Boolean
- #output_emoji? ⇒ Boolean
Methods included from Helpers
#i18n, #log, #search_file_in_gem
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/carioca/configuration.rb', line 13 def initialize @init_from_file = true @filename = DEFAULT_REGISTRY_FILE.dup @debug = false @name = 'Carioca' @builtins = BUILTINS @log_file = '' @log_level = DEFAULT_LOG_LEVEL.dup @config_file = DEFAULT_CONFIG_FILE.dup @environment = DEFAULT_ENVIRONMENT.dup @config_root = DEFAULT_CONFIG_ROOT.dup @log_target = '::Logger::new(STDOUT)' @supported_environments = DEFAULT_ENVIRONMENTS_LIST.dup @default_locale = DEFAULT_LOCALE @locales_availables = [] @output_mode = DEFAULT_OUTPUT_MODE.dup @output_colors = DEFAULT_COLORS_STATUS.dup @output_emoji = DEFAULT_EMOJI_STATUS.dup @output_target = DEFAULT_OUTPUT_TARGET.dup @user_config_path = DEFAULT_USER_CONFIG_PATH.dup @master_key_file = DEFAULT_MASTER_KEY_FILE.dup @secure_store_file = DEFAULT_SECURE_STORE_FILE.dup path = search_file_in_gem('carioca', 'config/locales') @locales_load_path = Dir["#{File.(path)}/*.yml"] Dir["#{path}/*.yml"].each do |file| @locales_availables.push File.basename(file, '.yml').to_sym end @debugger_tracer = DEFAULT_DEBUGGER_TRACER.dup end |
Instance Attribute Details
#builtins ⇒ Object
Returns the value of attribute builtins.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def builtins @builtins end |
#config_file ⇒ Object
Returns the value of attribute config_file.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def config_file @config_file end |
#config_root ⇒ Object
Returns the value of attribute config_root.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def config_root @config_root end |
#debug ⇒ Object
Returns the value of attribute debug.
11 12 13 |
# File 'lib/carioca/configuration.rb', line 11 def debug @debug end |
#debugger_tracer ⇒ Object
Returns the value of attribute debugger_tracer.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def debugger_tracer @debugger_tracer end |
#default_locale ⇒ Object
Returns the value of attribute default_locale.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def default_locale @default_locale end |
#environment ⇒ Object
Returns the value of attribute environment.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def environment @environment end |
#filename ⇒ Object
Returns the value of attribute filename.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def filename @filename end |
#init_from_file=(value) ⇒ Object (writeonly)
Sets the attribute init_from_file
10 11 12 |
# File 'lib/carioca/configuration.rb', line 10 def init_from_file=(value) @init_from_file = value end |
#locales_availables ⇒ Object (readonly)
Returns the value of attribute locales_availables.
11 12 13 |
# File 'lib/carioca/configuration.rb', line 11 def locales_availables @locales_availables end |
#locales_load_path ⇒ Object
Returns the value of attribute locales_load_path.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def locales_load_path @locales_load_path end |
#log_file ⇒ Object
Returns the value of attribute log_file.
11 12 13 |
# File 'lib/carioca/configuration.rb', line 11 def log_file @log_file end |
#log_level ⇒ Object
Returns the value of attribute log_level.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def log_level @log_level end |
#log_target ⇒ Object
Returns the value of attribute log_target.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def log_target @log_target end |
#master_key_file ⇒ Object
Returns the value of attribute master_key_file.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def master_key_file @master_key_file end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def name @name end |
#output_colors=(value) ⇒ Object (writeonly)
Sets the attribute output_colors
10 11 12 |
# File 'lib/carioca/configuration.rb', line 10 def output_colors=(value) @output_colors = value end |
#output_emoji=(value) ⇒ Object (writeonly)
Sets the attribute output_emoji
10 11 12 |
# File 'lib/carioca/configuration.rb', line 10 def output_emoji=(value) @output_emoji = value end |
#output_mode ⇒ Object
Returns the value of attribute output_mode.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def output_mode @output_mode end |
#output_target ⇒ Object
Returns the value of attribute output_target.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def output_target @output_target end |
#secure_store_file ⇒ Object
Returns the value of attribute secure_store_file.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def secure_store_file @secure_store_file end |
#supported_environments ⇒ Object
Returns the value of attribute supported_environments.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def supported_environments @supported_environments end |
#user_config_path ⇒ Object
Returns the value of attribute user_config_path.
7 8 9 |
# File 'lib/carioca/configuration.rb', line 7 def user_config_path @user_config_path end |
Instance Method Details
#debug? ⇒ Boolean
49 50 51 |
# File 'lib/carioca/configuration.rb', line 49 def debug? @debug end |
#init_from_file? ⇒ Boolean
61 62 63 |
# File 'lib/carioca/configuration.rb', line 61 def init_from_file? @init_from_file end |
#log_file? ⇒ Boolean
65 66 67 |
# File 'lib/carioca/configuration.rb', line 65 def log_file? !@log_file.empty? end |
#output_colors? ⇒ Boolean
53 54 55 |
# File 'lib/carioca/configuration.rb', line 53 def output_colors? @output_colors end |
#output_emoji? ⇒ Boolean
57 58 59 |
# File 'lib/carioca/configuration.rb', line 57 def output_emoji? @output_emoji end |