Class: Application
- Inherits:
-
Object
- Object
- Application
- Includes:
- Singleton
- Defined in:
- lib/teuton/application.rb
Instance Attribute Summary collapse
-
#config_path ⇒ Object
Returns the value of attribute config_path.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#global ⇒ Object
Global configuration params.
-
#groups ⇒ Object
Array of groups.
-
#hall_of_fame ⇒ Object
Returns the value of attribute hall_of_fame.
-
#ialias ⇒ Object
Internal alias.
-
#letter ⇒ Object
readonly
include Teuton.
-
#macros ⇒ Object
Array of macros.
-
#options ⇒ Object
Returns the value of attribute options.
-
#output_basedir ⇒ Object
readonly
Returns the value of attribute output_basedir.
-
#project_path ⇒ Object
Returns the value of attribute project_path.
-
#running_basedir ⇒ Object
readonly
Returns the value of attribute running_basedir.
-
#script_path ⇒ Object
Returns the value of attribute script_path.
-
#test_name ⇒ Object
Returns the value of attribute test_name.
-
#uses ⇒ Object
Array of uses.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#add_input_params(projectpath, options) ⇒ Object
Preprocess input options: * Convert input case options String to an Array of integers * Read color input option.
- #debug ⇒ Object
-
#initialize ⇒ Application
constructor
A new instance of Application.
- #name ⇒ Object
- #quiet? ⇒ Boolean
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Application
Returns a new instance of Application.
22 23 24 |
# File 'lib/teuton/application.rb', line 22 def initialize reset end |
Instance Attribute Details
#config_path ⇒ Object
Returns the value of attribute config_path.
20 21 22 |
# File 'lib/teuton/application.rb', line 20 def config_path @config_path end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
11 12 13 |
# File 'lib/teuton/application.rb', line 11 def default @default end |
#global ⇒ Object
Global configuration params
14 15 16 |
# File 'lib/teuton/application.rb', line 14 def global @global end |
#groups ⇒ Object
Array of groups
17 18 19 |
# File 'lib/teuton/application.rb', line 17 def groups @groups end |
#hall_of_fame ⇒ Object
Returns the value of attribute hall_of_fame.
19 20 21 |
# File 'lib/teuton/application.rb', line 19 def hall_of_fame @hall_of_fame end |
#ialias ⇒ Object
Internal alias
15 16 17 |
# File 'lib/teuton/application.rb', line 15 def ialias @ialias end |
#letter ⇒ Object (readonly)
include Teuton
9 10 11 |
# File 'lib/teuton/application.rb', line 9 def letter @letter end |
#macros ⇒ Object
Array of macros
16 17 18 |
# File 'lib/teuton/application.rb', line 16 def macros @macros end |
#options ⇒ Object
Returns the value of attribute options.
12 13 14 |
# File 'lib/teuton/application.rb', line 12 def @options end |
#output_basedir ⇒ Object (readonly)
Returns the value of attribute output_basedir.
10 11 12 |
# File 'lib/teuton/application.rb', line 10 def output_basedir @output_basedir end |
#project_path ⇒ Object
Returns the value of attribute project_path.
20 21 22 |
# File 'lib/teuton/application.rb', line 20 def project_path @project_path end |
#running_basedir ⇒ Object (readonly)
Returns the value of attribute running_basedir.
10 11 12 |
# File 'lib/teuton/application.rb', line 10 def running_basedir @running_basedir end |
#script_path ⇒ Object
Returns the value of attribute script_path.
20 21 22 |
# File 'lib/teuton/application.rb', line 20 def script_path @script_path end |
#test_name ⇒ Object
Returns the value of attribute test_name.
20 21 22 |
# File 'lib/teuton/application.rb', line 20 def test_name @test_name end |
#uses ⇒ Object
Array of uses
18 19 20 |
# File 'lib/teuton/application.rb', line 18 def uses @uses end |
#verbose ⇒ Object
Returns the value of attribute verbose.
13 14 15 |
# File 'lib/teuton/application.rb', line 13 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
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/teuton/application.rb', line 68 def add_input_params(projectpath, ) @options.merge! NameFileFinder.find_filenames_for(projectpath) @options["color"] = true if @options["color"].nil? Rainbow.enabled = @options["color"] @options["panel"] = false if @options["panel"].nil? return if @options["case"].nil? a = @options["case"].split(",") @options["case"] = a.collect!(&:to_i) end |
#debug ⇒ Object
49 50 51 |
# File 'lib/teuton/application.rb', line 49 def debug @default[:debug] end |
#name ⇒ Object
53 54 55 |
# File 'lib/teuton/application.rb', line 53 def name @default[:name] end |
#quiet? ⇒ Boolean
57 58 59 60 61 62 |
# File 'lib/teuton/application.rb', line 57 def quiet? return true if Application.instance.["quiet"] return true unless Application.instance.verbose false end |
#reset ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/teuton/application.rb', line 26 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"} @verbose = true @global = {} @ialias = {} @macros = {} @groups = [] @uses = [] # TODO @hall_of_fame = [] end |