Class: Carioca::Configuration

Inherits:
Object
  • Object
show all
Includes:
Constants, Helpers
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

Instance Method Summary collapse

Methods included from Helpers

#i18n, #log, #search_file_in_gem

Constructor Details

#initializeConfiguration

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.expand_path(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

#builtinsObject

Returns the value of attribute builtins.



7
8
9
# File 'lib/carioca/configuration.rb', line 7

def builtins
  @builtins
end

#config_fileObject

Returns the value of attribute config_file.



7
8
9
# File 'lib/carioca/configuration.rb', line 7

def config_file
  @config_file
end

#config_rootObject

Returns the value of attribute config_root.



7
8
9
# File 'lib/carioca/configuration.rb', line 7

def config_root
  @config_root
end

#debugObject

Returns the value of attribute debug.



11
12
13
# File 'lib/carioca/configuration.rb', line 11

def debug
  @debug
end

#debugger_tracerObject

Returns the value of attribute debugger_tracer.



7
8
9
# File 'lib/carioca/configuration.rb', line 7

def debugger_tracer
  @debugger_tracer
end

#default_localeObject

Returns the value of attribute default_locale.



7
8
9
# File 'lib/carioca/configuration.rb', line 7

def default_locale
  @default_locale
end

#environmentObject

Returns the value of attribute environment.



7
8
9
# File 'lib/carioca/configuration.rb', line 7

def environment
  @environment
end

#filenameObject

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

Parameters:

  • value

    the value to set the attribute init_from_file to.



10
11
12
# File 'lib/carioca/configuration.rb', line 10

def init_from_file=(value)
  @init_from_file = value
end

#locales_availablesObject (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_pathObject

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_fileObject

Returns the value of attribute log_file.



11
12
13
# File 'lib/carioca/configuration.rb', line 11

def log_file
  @log_file
end

#log_levelObject

Returns the value of attribute log_level.



7
8
9
# File 'lib/carioca/configuration.rb', line 7

def log_level
  @log_level
end

#log_targetObject

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_fileObject

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

#nameObject

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

Parameters:

  • value

    the value to set the attribute output_colors to.



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

Parameters:

  • value

    the value to set the attribute output_emoji to.



10
11
12
# File 'lib/carioca/configuration.rb', line 10

def output_emoji=(value)
  @output_emoji = value
end

#output_modeObject

Returns the value of attribute output_mode.



7
8
9
# File 'lib/carioca/configuration.rb', line 7

def output_mode
  @output_mode
end

#output_targetObject

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_fileObject

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_environmentsObject

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_pathObject

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

Returns:

  • (Boolean)


49
50
51
# File 'lib/carioca/configuration.rb', line 49

def debug?
  @debug
end

#init_from_file?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/carioca/configuration.rb', line 61

def init_from_file?
  @init_from_file
end

#log_file?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/carioca/configuration.rb', line 65

def log_file?
  !@log_file.empty?
end

#output_colors?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/carioca/configuration.rb', line 53

def output_colors?
  @output_colors
end

#output_emoji?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/carioca/configuration.rb', line 57

def output_emoji?
  @output_emoji
end