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



66
67
68
# File 'lib/synvert/core/configuration.rb', line 66

def number_of_workers
  @number_of_workers || 1
end

.only_pathsArray<String>

Get a list of only paths.

Returns:

  • (Array<String>)

    default is [].



45
46
47
# File 'lib/synvert/core/configuration.rb', line 45

def only_paths
  @only_paths || []
end

.respect_gitignoreBoolean

Check if respect .gitignore

Returns:

  • (Boolean)

    default is true



52
53
54
# File 'lib/synvert/core/configuration.rb', line 52

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

.root_pathString

Get the path.

Returns:

  • (String)

    default is '.'



31
32
33
# File 'lib/synvert/core/configuration.rb', line 31

def root_path
  @root_path || '.'
end

.show_run_processBoolean

Check if show run process.

Returns:

  • (Boolean)

    default is false



59
60
61
# File 'lib/synvert/core/configuration.rb', line 59

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



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

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

.skip_pathsArray<String>

Get a list of skip paths.

Returns:

  • (Array<String>)

    default is [].



38
39
40
# File 'lib/synvert/core/configuration.rb', line 38

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



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

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

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



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

attr_writer :root_path,
:skip_paths,
:only_paths,
:respect_gitignore,
: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.



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

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



100
101
102
# File 'lib/synvert/core/configuration.rb', line 100

def test_result
  @test_result || 'actions'
end

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



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

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