Class: Synvert::Core::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/synvert/core/configuration.rb

Overview

Synvert global configuration.

Class Attribute Summary collapse

Class Attribute Details

.number_of_workersInteger

Number of workers

Returns:

  • (Integer)

    default is 1



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

def number_of_workers
  @number_of_workers || 1
end

.only_pathsArray<String>

Get a list of only paths.

Returns:

  • (Array<String>)

    default is [].



43
44
45
# File 'lib/synvert/core/configuration.rb', line 43

def only_paths
  @only_paths || []
end

.root_pathString

Get the path.

Returns:

  • (String)

    default is '.'



29
30
31
# File 'lib/synvert/core/configuration.rb', line 29

def root_path
  @root_path || '.'
end

.show_run_processBoolean

Check if show run process.

Returns:

  • (Boolean)

    default is false



50
51
52
# File 'lib/synvert/core/configuration.rb', line 50

def show_run_process
  @show_run_process || false
end

.single_quoteBoolean

Use single quote or double quote.

Returns:

  • (Boolean)

    true if use single quote, default is true



64
65
66
# File 'lib/synvert/core/configuration.rb', line 64

def single_quote
  @single_quote.nil? ? true : @single_quote
end

.skip_pathsArray<String>

Get a list of skip paths.

Returns:

  • (Array<String>)

    default is [].



36
37
38
# File 'lib/synvert/core/configuration.rb', line 36

def skip_paths
  @skip_paths || []
end

.strictBoolean

Returns the value of the strict flag.

If the strict flag is not set, it returns true by default.

Returns:

  • (Boolean)

    the value of the strict flag



82
83
84
# File 'lib/synvert/core/configuration.rb', line 82

def strict
  @strict.nil? ? true : @strict
end

.strict, if strict is false, it will ignore ruby version and gem version check.=(value) ⇒ Object (writeonly)



16
17
18
19
20
21
22
23
24
# File 'lib/synvert/core/configuration.rb', line 16

attr_writer :root_path,
:skip_paths,
:only_paths,
:show_run_process,
:number_of_workers,
:single_quote,
:tab_width,
:strict,
:test_result

.tab_widthInteger

Returns the tab width used for indentation.

If the tab width is not explicitly set, it defaults to 2.

Returns:

  • (Integer)

    The tab width.



73
74
75
# File 'lib/synvert/core/configuration.rb', line 73

def tab_width
  @tab_width || 2
end

.test_resultString

Returns the value of the test_result flag.

If the test_result flag is not set, it returns 'actions' by default.

Returns:

  • (String)

    the value of the test_result flag



91
92
93
# File 'lib/synvert/core/configuration.rb', line 91

def test_result
  @test_result || 'actions'
end

.test_result, default is 'actions', it can be 'actions' or 'new_source'.=(value) ⇒ Object (writeonly)



16
17
18
19
20
21
22
23
24
# File 'lib/synvert/core/configuration.rb', line 16

attr_writer :root_path,
:skip_paths,
:only_paths,
:show_run_process,
:number_of_workers,
:single_quote,
:tab_width,
:strict,
:test_result