Class: Application

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/teuton/application.rb

Overview

This Singleton contains application params

Constant Summary collapse

VERSION =

Application version

'2.1.3'
NAME =

Application name

'teuton'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApplication

Returns a new instance of Application.



20
21
22
# File 'lib/teuton/application.rb', line 20

def initialize
  reset
end

Instance Attribute Details

#checksObject

Returns the value of attribute checks.



16
17
18
# File 'lib/teuton/application.rb', line 16

def checks
  @checks
end

#config_pathObject

Returns the value of attribute config_path.



18
19
20
# File 'lib/teuton/application.rb', line 18

def config_path
  @config_path
end

#defaultObject (readonly)

Returns the value of attribute default.



12
13
14
# File 'lib/teuton/application.rb', line 12

def default
  @default
end

#globalObject

Returns the value of attribute global.



15
16
17
# File 'lib/teuton/application.rb', line 15

def global
  @global
end

#groupsObject

Returns the value of attribute groups.



16
17
18
# File 'lib/teuton/application.rb', line 16

def groups
  @groups
end

#hall_of_fameObject

Returns the value of attribute hall_of_fame.



17
18
19
# File 'lib/teuton/application.rb', line 17

def hall_of_fame
  @hall_of_fame
end

#ialiasObject

Returns the value of attribute ialias.



15
16
17
# File 'lib/teuton/application.rb', line 15

def ialias
  @ialias
end

#letterObject (readonly)

Returns the value of attribute letter.



10
11
12
# File 'lib/teuton/application.rb', line 10

def letter
  @letter
end

#optionsObject

Returns the value of attribute options.



13
14
15
# File 'lib/teuton/application.rb', line 13

def options
  @options
end

#output_basedirObject (readonly)

Returns the value of attribute output_basedir.



11
12
13
# File 'lib/teuton/application.rb', line 11

def output_basedir
  @output_basedir
end

#project_pathObject

Returns the value of attribute project_path.



18
19
20
# File 'lib/teuton/application.rb', line 18

def project_path
  @project_path
end

#running_basedirObject (readonly)

Returns the value of attribute running_basedir.



11
12
13
# File 'lib/teuton/application.rb', line 11

def running_basedir
  @running_basedir
end

#script_pathObject

Returns the value of attribute script_path.



18
19
20
# File 'lib/teuton/application.rb', line 18

def script_path
  @script_path
end

#test_nameObject

Returns the value of attribute test_name.



18
19
20
# File 'lib/teuton/application.rb', line 18

def test_name
  @test_name
end

#usesObject

Returns the value of attribute uses.



16
17
18
# File 'lib/teuton/application.rb', line 16

def uses
  @uses
end

#verboseObject

Returns the value of attribute verbose.



14
15
16
# File 'lib/teuton/application.rb', line 14

def verbose
  @verbose
end

Instance Method Details

#debugObject



40
41
42
# File 'lib/teuton/application.rb', line 40

def debug
  @default[:debug]
end

#nameObject



44
45
46
# File 'lib/teuton/application.rb', line 44

def name
  @default[:name]
end

#quiet?Boolean

Returns:

  • (Boolean)


48
49
50
51
52
# File 'lib/teuton/application.rb', line 48

def quiet?
  return true if Application.instance.options['quiet']
  return true unless Application.instance.verbose
  false
end

#resetObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/teuton/application.rb', line 24

def reset
  @letter = { good: '.', bad: 'F', error: '?', none: ' ' }
  @running_basedir = Dir.getwd
  @output_basedir = 'var'
  @default = { name: 'teuton', format: :txt, debug: false }
  @options = { 'lang' => 'en' }
  @verbose = true

  @global = {}
  @ialias = {}
  @checks = {}
  @groups = []
  @uses = [] # TODO
  @hall_of_fame = []
end