Class: Application

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApplication



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

def initialize
  reset
end

Instance Attribute Details

#config_pathObject

Returns the value of attribute config_path.



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

def config_path
  @config_path
end

#defaultObject (readonly)

Returns the value of attribute default.



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

def default
  @default
end

#globalObject

Global configuration params



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

def global
  @global
end

#ialiasObject

Internal alias



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

def ialias
  @ialias
end

#letterObject (readonly)

Returns the value of attribute letter.



7
8
9
# File 'lib/teuton/deprecated/application.rb', line 7

def letter
  @letter
end

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

#output_basedirObject (readonly)

Returns the value of attribute output_basedir.



8
9
10
# File 'lib/teuton/deprecated/application.rb', line 8

def output_basedir
  @output_basedir
end

#project_pathObject

Returns the value of attribute project_path.



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

def project_path
  @project_path
end

#running_basedirObject (readonly)

Returns the value of attribute running_basedir.



8
9
10
# File 'lib/teuton/deprecated/application.rb', line 8

def running_basedir
  @running_basedir
end

#script_pathObject

Returns the value of attribute script_path.



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

def script_path
  @script_path
end

#test_nameObject

Returns the value of attribute test_name.



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

def test_name
  @test_name
end

#usesObject

Array of uses



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

def uses
  @uses
end

#verboseObject

Returns the value of attribute verbose.



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

def verbose
  @verbose
end

Instance Method Details

#add_input_params(projectpath, options) ⇒ Object

Preprocess input options:

  • Convert input case options String to an Array of integers

  • Read color input option



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/teuton/deprecated/application.rb', line 64

def add_input_params(projectpath, options)
  @options.merge! options
  Rainbow.enabled = @options["color"]

  finder = NameFileFinder.new(@options)
  finder.find_filenames_for(projectpath)
  @project_path = finder.project_path
  @script_path = finder.script_path
  @config_path = finder.config_path
  @test_name = finder.test_name

  unless @options["case"].nil?
    numbers = @options["case"].split(",")
    @options["case"] = numbers.collect!(&:to_i)
  end
end

#debugObject



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

def debug
  @default[:debug]
end

#nameObject



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

def name
  @default[:name]
end

#quiet?Boolean



53
54
55
56
57
58
# File 'lib/teuton/deprecated/application.rb', line 53

def quiet?
  return true if Application.instance.options["quiet"]
  return true unless Application.instance.verbose

  false
end

#resetObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/teuton/deprecated/application.rb', line 21

def reset
  @letter = {
    good: ".",
    bad: "F",
    error: "?",
    none: " ",
    ok: "\u{2714}",
    cross: "\u{2716}"
  }
  @running_basedir = Dir.getwd
  @output_basedir = "var"
  @default = {name: "teuton", format: :txt, debug: false}
  @options = {
    "lang" => "en",
    "color" => true,
    "panel" => false
  }
  @verbose = true

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