Class: Project
- Inherits:
-
Object
- Object
- Project
- Defined in:
- lib/teuton/utils/project.rb
Class 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? ⇒ Boolean
- .init ⇒ Object
- .name ⇒ Object
- .quiet? ⇒ Boolean
- .value ⇒ Object
- .verbose ⇒ Object
Class 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
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/teuton/utils/project.rb', line 57 def self.add_input_params(projectpath, ) value[:options].merge! Rainbow.enabled = value[:options]["color"] finder = NameFileFinder.new(value[:options]) finder.find_filenames_for(projectpath) value[:project_path] = finder.project_path value[:script_path] = finder.script_path value[:config_path] = finder.config_path value[:test_name] = finder.test_name unless value[:options]["case"].nil? numbers = value[:options]["case"].split(",") value[:options]["case"] = numbers.collect!(&:to_i) end end |
.debug? ⇒ Boolean
34 35 36 |
# File 'lib/teuton/utils/project.rb', line 34 def self.debug? value[:debug] end |
.init ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/teuton/utils/project.rb', line 6 def self.init @project = {} @project[:running_basedir] = Dir.getwd @project[:output_basedir] = "var" @project[:name] = "teuton" @project[:format] = :txt @project[:debug] = false @project[:options] = { "color" => true, "lang" => "en", "panel" => false, "quiet" => false } @project[:verbose] = true @project[:global] = {} # Hash of Global configuration params @project[:ialias] = {} # Hash of Internal alias @project[:macros] = {} # Hash of macros @project[:groups] = [] # Array of groups @project[:uses] = [] # TODO: Array of files used @project[:hall_of_fame] = [] end |
.name ⇒ Object
38 39 40 |
# File 'lib/teuton/utils/project.rb', line 38 def self.name value[:name] end |
.quiet? ⇒ Boolean
42 43 44 45 46 47 |
# File 'lib/teuton/utils/project.rb', line 42 def self.quiet? return true if value[:options]["quiet"] return true unless value[:verbose] false end |
.value ⇒ Object
28 29 30 |
# File 'lib/teuton/utils/project.rb', line 28 def self.value @project end |
.verbose ⇒ Object
49 50 51 |
# File 'lib/teuton/utils/project.rb', line 49 def self.verbose value[:verbose] end |