Class: Allure::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
allure-ruby-commons/lib/allure_ruby_commons/config.rb

Overview

Allure configuration class

Constant Summary collapse

LOGLEVELS =

Returns valid log levels.

Returns:

  • (Array<String>)

    valid log levels

%w[DEBUG INFO WARN ERROR FATAL UNKNOWN].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



24
25
26
27
# File 'allure-ruby-commons/lib/allure_ruby_commons/config.rb', line 24

def initialize
  @results_directory = "reports/allure-results"
  @logging_level = LOGLEVELS.index(ENV.fetch("ALLURE_LOG_LEVEL", "INFO")) || Logger::INFO
end

Instance Attribute Details

#categoriesObject

Returns the value of attribute categories.



16
17
18
# File 'allure-ruby-commons/lib/allure_ruby_commons/config.rb', line 16

def categories
  @categories
end

#clean_results_directoryObject

Returns the value of attribute clean_results_directory.



16
17
18
# File 'allure-ruby-commons/lib/allure_ruby_commons/config.rb', line 16

def clean_results_directory
  @clean_results_directory
end

#environmentString

Allure environment

Returns:

  • (String)


32
33
34
35
36
# File 'allure-ruby-commons/lib/allure_ruby_commons/config.rb', line 32

def environment
  return(@environment) if defined?(@environment)

  @environment ||= ENV["ALLURE_ENVIRONMENT"]
end

#environment_propertiesObject

Returns the value of attribute environment_properties.



16
17
18
# File 'allure-ruby-commons/lib/allure_ruby_commons/config.rb', line 16

def environment_properties
  @environment_properties
end

Returns the value of attribute link_issue_pattern.



16
17
18
# File 'allure-ruby-commons/lib/allure_ruby_commons/config.rb', line 16

def link_issue_pattern
  @link_issue_pattern
end

Returns the value of attribute link_tms_pattern.



16
17
18
# File 'allure-ruby-commons/lib/allure_ruby_commons/config.rb', line 16

def link_tms_pattern
  @link_tms_pattern
end

#loggerLogger

Logger instance

Returns:

  • (Logger)


41
42
43
# File 'allure-ruby-commons/lib/allure_ruby_commons/config.rb', line 41

def logger
  @logger ||= Logger.new($stdout, level: logging_level)
end

#logging_levelObject

Returns the value of attribute logging_level.



16
17
18
# File 'allure-ruby-commons/lib/allure_ruby_commons/config.rb', line 16

def logging_level
  @logging_level
end

#results_directoryObject

Returns the value of attribute results_directory.



16
17
18
# File 'allure-ruby-commons/lib/allure_ruby_commons/config.rb', line 16

def results_directory
  @results_directory
end