teuton 2.6.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/docs/changelog/todo.md +4 -8
  3. data/docs/changelog/v2.7.md +11 -0
  4. data/docs/diagram.md +16 -15
  5. data/docs/learn/06-cmd_check.md +3 -2
  6. data/docs/learn/21-exit_codes.md +19 -14
  7. data/lib/teuton/case/case.rb +25 -44
  8. data/lib/teuton/case/close.rb +2 -0
  9. data/lib/teuton/case/config.rb +3 -3
  10. data/lib/teuton/case/{runner.rb → deprecated/runner.rb} +14 -10
  11. data/lib/teuton/case/deprecated/utils.rb +40 -0
  12. data/lib/teuton/case/dsl/all.rb +8 -0
  13. data/lib/teuton/case/dsl/expect.rb +25 -9
  14. data/lib/teuton/case/dsl/goto.rb +10 -9
  15. data/lib/teuton/case/dsl/log.rb +1 -2
  16. data/lib/teuton/case/dsl/macro.rb +2 -2
  17. data/lib/teuton/case/dsl/send.rb +3 -8
  18. data/lib/teuton/case/execute/copy_ssh.rb +70 -0
  19. data/lib/teuton/case/execute/execute_base.rb +55 -0
  20. data/lib/teuton/case/execute/execute_local.rb +29 -0
  21. data/lib/teuton/case/execute/execute_manager.rb +56 -0
  22. data/lib/teuton/case/execute/execute_ssh.rb +90 -0
  23. data/lib/teuton/case/execute/execute_telnet.rb +56 -0
  24. data/lib/teuton/case/play.rb +6 -6
  25. data/lib/teuton/case_manager/case_manager.rb +12 -8
  26. data/lib/teuton/case_manager/check_cases.rb +14 -12
  27. data/lib/teuton/case_manager/dsl.rb +6 -8
  28. data/lib/teuton/case_manager/export_manager.rb +2 -3
  29. data/lib/teuton/case_manager/hall_of_fame.rb +9 -10
  30. data/lib/teuton/case_manager/report.rb +11 -9
  31. data/lib/teuton/case_manager/show_report.rb +5 -7
  32. data/lib/teuton/case_manager/utils.rb +2 -48
  33. data/lib/teuton/check/dsl.rb +1 -2
  34. data/lib/teuton/check/laboratory.rb +7 -7
  35. data/lib/teuton/check/show.rb +5 -8
  36. data/lib/teuton/cli.rb +10 -0
  37. data/lib/teuton/readme/dsl.rb +5 -7
  38. data/lib/teuton/readme/lang.rb +3 -2
  39. data/lib/teuton/readme/readme.rb +15 -18
  40. data/lib/teuton/report/formatter/default/array.rb +6 -5
  41. data/lib/teuton/report/formatter/default/txt.rb +1 -0
  42. data/lib/teuton/report/formatter/formatter.rb +1 -1
  43. data/lib/teuton/report/formatter/resume/array.rb +3 -3
  44. data/lib/teuton/report/formatter/resume/html.rb +2 -2
  45. data/lib/teuton/report/report.rb +6 -5
  46. data/lib/teuton/skeleton.rb +8 -10
  47. data/lib/teuton/{application.rb → utils/application.rb} +13 -5
  48. data/lib/teuton/utils/name_file_finder.rb +40 -45
  49. data/lib/teuton/utils/project.rb +73 -0
  50. data/lib/teuton/{result → utils/result}/result.rb +9 -7
  51. data/lib/teuton/utils/settings.rb +12 -0
  52. data/lib/teuton/utils/verbose.rb +2 -2
  53. data/lib/teuton/version.rb +1 -1
  54. data/lib/teuton.rb +19 -18
  55. metadata +20 -9
  56. data/lib/teuton/case/dsl.rb +0 -10
  57. /data/lib/teuton/{result → utils/result}/ext_array.rb +0 -0
  58. /data/lib/teuton/{result → utils/result}/ext_compare.rb +0 -0
  59. /data/lib/teuton/{result → utils/result}/ext_filter.rb +0 -0
@@ -1,6 +1,6 @@
1
1
  require "rainbow"
2
2
  require "terminal-table"
3
- require_relative "../application"
3
+ require_relative "../utils/project"
4
4
 
5
5
  # | Verbosity level | Description |
6
6
  # | :-------------: | ----------- |
@@ -15,7 +15,7 @@ class ShowReport
15
15
  end
16
16
 
17
17
  def call(verbose)
18
- return if Application.instance.quiet?
18
+ return if Project.quiet?
19
19
 
20
20
  show_initial_configurations if verbose > 2
21
21
  if filename.to_s.include? "resume"
@@ -95,7 +95,7 @@ class ShowReport
95
95
  puts lines[0]
96
96
  else
97
97
  lines.each do |i|
98
- if i.class.to_s == "Hash"
98
+ if i.instance_of?(::Hash)
99
99
  value = 0.0
100
100
  value = i[:weight] if i[:check]
101
101
  print tab + "%03d" % i[:id].to_i
@@ -121,8 +121,7 @@ class ShowReport
121
121
  end
122
122
 
123
123
  def show_hall_of_fame
124
- app = Application.instance
125
- return if app.hall_of_fame.size < 3
124
+ return if Project.value[:hall_of_fame].size < 3
126
125
 
127
126
  puts Rainbow("HALL OF FAME").bright
128
127
  my_screen_table = Terminal::Table.new do |st|
@@ -133,9 +132,8 @@ class ShowReport
133
132
  puts "#{my_screen_table}\n"
134
133
  end
135
134
 
136
- ##
137
- # Trim absolute path values
138
135
  def trim(input)
136
+ # Trim absolute path values
139
137
  return input unless input.to_s.start_with? Dir.pwd.to_s
140
138
  return input if input == Dir.pwd.to_s
141
139
 
@@ -1,10 +1,9 @@
1
- require_relative "../application"
2
1
  require "fileutils"
3
- require "open3"
4
- require "rainbow"
2
+ require_relative "../utils/project"
5
3
 
6
4
  module Utils
7
5
  def ensure_dir(dirname)
6
+ # TODO: Mover a la carpeta Utils
8
7
  # Create the directory if it dosn't exist.
9
8
  unless Dir.exist?(dirname)
10
9
  FileUtils.mkdir_p(dirname)
@@ -12,49 +11,4 @@ module Utils
12
11
  end
13
12
  true
14
13
  end
15
-
16
- def encode_and_split(encoding, text)
17
- # Convert text to UTF-8 deleting unknown chars
18
- text ||= "" # Ensure text is not nil
19
- flag = [:default, "UTF-8"].include? encoding
20
- return text.encode("UTF-8", invalid: :replace).split("\n") if flag
21
-
22
- # Convert text from input ENCODING to UTF-8
23
- ec = Encoding::Converter.new(encoding.to_s, "UTF-8")
24
- begin
25
- text = ec.convert(text)
26
- rescue => e
27
- puts "[ERROR] #{e}: Declare text encoding..."
28
- puts " run 'command', on: :host, :encoding => 'ISO-8859-1'"
29
- end
30
-
31
- text.split("\n")
32
- end
33
-
34
- def my_execute(cmd, encoding = "UTF-8")
35
- return {exitstatus: 0, content: ""} if Application.instance.debug
36
-
37
- begin
38
- # text = `#{cmd}`
39
- # exitstatus = $CHILD_STATUS.exitstatus
40
- text, status = Open3.capture2e(cmd)
41
- exitstatus = status.exitstatus
42
- rescue => e
43
- verbose Rainbow("!").green
44
- text = e.to_s
45
- exitstatus = 1
46
- end
47
- content = encode_and_split(encoding, text)
48
- {exitstatus: exitstatus, content: content}
49
- end
50
-
51
- def verboseln(text)
52
- verbose(text + "\n")
53
- end
54
-
55
- def verbose(text)
56
- return if Application.instance.quiet?
57
-
58
- print text
59
- end
60
14
  end
@@ -1,8 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ##
4
- # Include Teuton DSL keywords into Laboratory class
5
3
  class Laboratory
4
+ # Include Teuton DSL keywords into Laboratory class
6
5
  def readme(_text)
7
6
  # Usefull for "teuton readme" command action.
8
7
  end
@@ -1,28 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../application"
4
- require_relative "../result/result"
3
+ require_relative "../utils/project"
4
+ require_relative "../utils/result/result"
5
5
  require_relative "show"
6
6
  require_relative "dsl"
7
7
  require_relative "builtin"
8
8
 
9
9
  def use(filename)
10
10
  filename += ".rb"
11
- app = Application.instance
12
- rbfiles = File.join(app.project_path, "**", filename)
11
+ rbfiles = File.join(Project.value[:project_path], "**", filename)
13
12
  files = Dir.glob(rbfiles)
14
13
  use = []
15
14
  files.sort.each { |f| use << f if f.include?(filename) }
16
15
  require_relative use[0]
16
+ Project.value[:uses] << use[0]
17
17
  end
18
18
 
19
19
  def group(name, &block)
20
- Application.instance.groups << {name: name, block: block}
20
+ Project.value[:groups] << {name: name, block: block}
21
21
  end
22
22
  alias task group
23
23
 
24
24
  def define_macro(name, *args, &block)
25
- Application.instance.macros[name] = {args: args, block: block}
25
+ Project.value[:macros][name] = {args: args, block: block}
26
26
  end
27
27
  alias def_macro define_macro
28
28
  alias defmacro define_macro
@@ -54,6 +54,6 @@ class Laboratory
54
54
  @sets = {}
55
55
  @hosts = {}
56
56
  @requests = [] # REVISE this
57
- @verbose = Application.instance.verbose
57
+ @verbose = Project.value[:verbose]
58
58
  end
59
59
  end
@@ -1,13 +1,9 @@
1
1
  require "terminal-table"
2
2
  require "rainbow"
3
3
 
4
- require_relative "../application"
4
+ require_relative "../utils/project"
5
5
  require_relative "../utils/configfile_reader"
6
6
 
7
- # Laboratory
8
- # * show_dsl
9
- # * show_stats
10
- # * show_config
11
7
  class Laboratory
12
8
  def show
13
9
  @verbose = true
@@ -34,9 +30,9 @@ class Laboratory
34
30
  end
35
31
 
36
32
  def process_content
37
- groups = Application.instance.groups
38
- option = Application.instance.options
39
-
33
+ groups = Project.value[:groups]
34
+ option = Project.value[:options]
35
+ @stats[:uses] = Project.value[:uses].size
40
36
  verboseln ""
41
37
  groups.each do |t|
42
38
  @stats[:groups] += 1
@@ -124,6 +120,7 @@ class Laboratory
124
120
  my_screen_table = Terminal::Table.new do |st|
125
121
  st.add_row ["DSL Stats", "Count"]
126
122
  st.add_separator
123
+ st.add_row ["Uses", @stats[:uses]]
127
124
  st.add_row ["Groups", @stats[:groups]]
128
125
  st.add_row ["Targets", @stats[:targets]]
129
126
  st.add_row ["Runs", @stats[:hosts]]
data/lib/teuton/cli.rb CHANGED
@@ -37,6 +37,16 @@ class CLI < Thor
37
37
  Teuton.check(projectpath, options)
38
38
  end
39
39
 
40
+ map ["co", "-co", "--config"] => "config"
41
+ desc "config DIRECTORY", "Suggest configuration"
42
+ long_desc <<~LONGDESC
43
+ config [OPTIONS] DIRECTORY", "Suggest configuration"
44
+ LONGDESC
45
+ def config(projectpath)
46
+ opt = {"onlyconfig" => true}
47
+ Teuton.check(projectpath, opt)
48
+ end
49
+
40
50
  map ["--readme"] => "readme"
41
51
  option :lang, type: :string
42
52
  desc "readme DIRECTORY", "Show README extracted from test contents"
@@ -1,12 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Readme
4
- # * target
5
- # * goto
6
- # * run
7
- # * expect
8
- # * unique
9
- # * log
4
+ # readme, target, goto, run
5
+ # expect,
6
+ # gett, set, unique, log
10
7
  class Readme
11
8
  def readme(text)
12
9
  if @action[:target].nil?
@@ -92,7 +89,8 @@ class Readme
92
89
  m = method.to_s
93
90
  if m[0] == "_"
94
91
  instance_eval("get(:#{m[1, m.size - 1]})", __FILE__, __LINE__)
95
- elsif not Application.instance.macros[m].nil?
92
+ # elsif not Application.instance.macros[m].nil?
93
+ elsif not Project.value[:macros][m].nil?
96
94
  puts "macro exec: #{m}"
97
95
  code = ""
98
96
  args[0].keys.each { |key| code += "set(:#{key}, '#{args[0][key]}')\n" }
@@ -1,4 +1,4 @@
1
- require_relative "../application"
1
+ require_relative "../utils/project"
2
2
 
3
3
  module Lang
4
4
  def self.get(key)
@@ -23,7 +23,8 @@ module Lang
23
23
  global: "\nParámetros globales que pueden ser modificados:\n",
24
24
  created: "\nParámetros creados durante la ejecución del reto:\n"
25
25
  }
26
- locale = Application.instance.options["lang"].downcase
26
+ # locale = Application.instance.options["lang"].downcase
27
+ locale = Project.value[:options]["lang"].downcase
27
28
  lang[locale][key]
28
29
  end
29
30
  end
@@ -1,27 +1,27 @@
1
- require_relative "../application"
1
+ require_relative "../utils/project"
2
2
  require_relative "../utils/configfile_reader"
3
- require_relative "../result/result"
3
+ require_relative "../utils/result/result"
4
4
  require_relative "../version"
5
5
  require_relative "dsl"
6
6
  require_relative "lang"
7
7
 
8
8
  def use(filename)
9
9
  filename += ".rb"
10
- app = Application.instance
11
- rbfiles = File.join(app.project_path, "**", filename)
10
+ rbfiles = File.join(Project.value[:project_path], "**", filename)
12
11
  files = Dir.glob(rbfiles)
13
12
  use = []
14
13
  files.sort.each { |f| use << f if f.include?(filename) }
15
14
  require_relative use[0]
15
+ Project.value[:uses] << use[0]
16
16
  end
17
17
 
18
18
  def define_macro(name, *args, &block)
19
19
  puts "macro: #{name}"
20
- Application.instance.macros[name] = {args: args, block: block}
20
+ Project.value[:macros][name] = {args: args, block: block}
21
21
  end
22
22
 
23
23
  def group(name, &block)
24
- Application.instance.groups << {name: name, block: block}
24
+ Project.value[:groups] << {name: name, block: block}
25
25
  end
26
26
  alias task group
27
27
 
@@ -31,16 +31,14 @@ end
31
31
  # alias_method "play", "start" # REVISE THIS
32
32
  alias play start
33
33
 
34
- # Creates README.md file from RB script file
35
34
  class Readme
35
+ # Creates README.md file from RB script file
36
36
  attr_reader :result
37
37
  attr_reader :data
38
38
 
39
- ##
40
- # Initialize Readme instance
41
- # @param script_path (String) Path to main rb file (start.rb)
42
- # @param config_path (String) Path to main config file (config.yaml)
43
39
  def initialize(script_path, config_path)
40
+ # script_path Path to main rb file (start.rb)
41
+ # config_path Path to main config file (config.yaml)
44
42
  @path = {}
45
43
  @path[:script] = script_path
46
44
  @path[:dirname] = File.dirname(script_path)
@@ -59,9 +57,9 @@ class Readme
59
57
  private
60
58
 
61
59
  def reset
62
- app = Application.instance
63
- @config = ConfigFileReader.read(app.config_path)
64
- @verbose = app.verbose
60
+ # app = Application.instance
61
+ @config = ConfigFileReader.read(Project.value[:config_path])
62
+ @verbose = Project.value[:verbose]
65
63
  @result = Result.new
66
64
  @data = {}
67
65
  @data[:macros] = []
@@ -76,7 +74,7 @@ class Readme
76
74
  end
77
75
 
78
76
  def process_content
79
- Application.instance.groups.each do |g|
77
+ Project.value[:groups].each do |g|
80
78
  @current = {name: g[:name], readme: [], actions: []}
81
79
  @data[:groups] << @current
82
80
  reset_action
@@ -89,14 +87,13 @@ class Readme
89
87
  end
90
88
 
91
89
  def show_head
92
- app = Application.instance
93
90
  puts "```"
94
- puts format(Lang.get(:testname), app.test_name)
91
+ puts format(Lang.get(:testname), Project.value[:test_name])
95
92
  puts format(Lang.get(:date), Time.now)
96
93
  puts format(Lang.get(:version), Teuton::VERSION)
97
94
  puts "```"
98
95
  puts "\n"
99
- puts "# #{app.test_name}\n"
96
+ puts "# #{Project.value[:test_name]}\n"
100
97
 
101
98
  i = 1
102
99
  unless @required_hosts.empty?
@@ -1,5 +1,5 @@
1
1
  require_relative "../base_formatter"
2
- require_relative "../../../application"
2
+ require_relative "../../../utils/project"
3
3
 
4
4
  class ArrayFormatter < BaseFormatter
5
5
  def initialize(report)
@@ -60,12 +60,14 @@ class ArrayFormatter < BaseFormatter
60
60
  target[:duration] = i[:duration]
61
61
 
62
62
  target[:command] = i[:command]
63
+ target[:output] = i[:output]
63
64
  target[:alterations] = i[:alterations]
64
65
  target[:expected] = i[:expected]
65
66
  target[:result] = i[:result]
66
67
 
67
68
  if options[:feedback] == false
68
69
  target[:command] = "*" * i[:command].size
70
+ target[:output] = "*" * i[:output].size
69
71
  target[:alterations] = "*" * i[:alterations].size
70
72
  target[:expected] = "*" * i[:expected].size
71
73
  target[:result] = "*" * i[:result].size
@@ -85,12 +87,11 @@ class ArrayFormatter < BaseFormatter
85
87
  end
86
88
 
87
89
  def build_hof_data
88
- app = Application.instance
89
90
  @data[:hall_of_fame] = {}
90
- return if app.options[:case_number] < 3
91
+ return if Project.value[:options][:case_number] < 3
91
92
 
92
93
  fame = {}
93
- app.hall_of_fame.each { |line| fame[line[0]] = line[1] }
94
+ Project.value[:hall_of_fame].each { |line| fame[line[0]] = line[1] }
94
95
  @data[:hall_of_fame] = fame
95
96
  end
96
97
 
@@ -115,6 +116,6 @@ class ArrayFormatter < BaseFormatter
115
116
  end
116
117
 
117
118
  def version
118
- Application::VERSION
119
+ Teuton::VERSION
119
120
  end
120
121
  end
@@ -91,6 +91,7 @@ class TXTFormatter < ArrayFormatter
91
91
  w " (" + Rainbow(i[:score].to_s + "/" + i[:weight].to_s).color(color) + ")\n"
92
92
  w "#{tab * 4}Description : #{i[:description]}\n"
93
93
  w "#{tab * 4}Command : #{i[:command]}\n"
94
+ w "#{tab * 4}Output : #{i[:output]}\n"
94
95
  w "#{tab * 4}Duration : #{i[:duration]} (#{i[:conn_type]})\n"
95
96
  w "#{tab * 4}Alterations : #{i[:alterations]}\n"
96
97
  w "#{tab * 4}Expected : #{i[:expected]} (#{i[:expected].class})\n"
@@ -48,7 +48,7 @@ module Formatter
48
48
  report2 = report.clone
49
49
  report2.groups.each do |group|
50
50
  group.each do |item|
51
- puts item.to_s
51
+ puts item
52
52
  end
53
53
  end
54
54
  end
@@ -1,4 +1,5 @@
1
1
  require_relative "../base_formatter"
2
+ require_relative "../../../utils/project"
2
3
 
3
4
  class ResumeArrayFormatter < BaseFormatter
4
5
  def initialize(report)
@@ -36,10 +37,9 @@ class ResumeArrayFormatter < BaseFormatter
36
37
  end
37
38
 
38
39
  def build_hof_data
39
- app = Application.instance
40
40
  fame = {}
41
- if app.options[:case_number] > 2
42
- app.hall_of_fame.each { |line| fame[line[0]] = line[1] }
41
+ if Project.value[:options][:case_number] > 2
42
+ Project.value[:hall_of_fame].each { |line| fame[line[0]] = line[1] }
43
43
  end
44
44
  @data[:hall_of_fame] = fame
45
45
  end
@@ -1,6 +1,6 @@
1
1
  require "erb"
2
2
  require_relative "yaml"
3
- require_relative "../../../application"
3
+ # require_relative "../../../../teuton"
4
4
 
5
5
  class ResumeHTMLFormatter < ResumeYAMLFormatter
6
6
  def initialize(report)
@@ -42,6 +42,6 @@ class ResumeHTMLFormatter < ResumeYAMLFormatter
42
42
  end
43
43
 
44
44
  def version
45
- Application::VERSION
45
+ Teuton::VERSION
46
46
  end
47
47
  end
@@ -1,4 +1,5 @@
1
- require_relative "../application"
1
+ require_relative "../utils/project"
2
+ require_relative "../utils/settings"
2
3
  require_relative "formatter/formatter"
3
4
 
4
5
  class Report
@@ -12,7 +13,8 @@ class Report
12
13
  def initialize(id = "00")
13
14
  @id = id
14
15
  @filename = "case-#{@id}"
15
- @output_dir = Application.instance.output_basedir
16
+ # @output_dir = Application.instance.output_basedir
17
+ @output_dir = Project.value[:output_basedir]
16
18
  @head = {}
17
19
  @lines = []
18
20
  @tail = {}
@@ -57,7 +59,6 @@ class Report
57
59
  # * fail_weight
58
60
  # * fail_counter
59
61
  def close
60
- app = Application.instance
61
62
  max = 0.0
62
63
  good = 0.0
63
64
  fail = 0.0
@@ -68,11 +69,11 @@ class Report
68
69
  max += i[:weight] if i[:weight].positive?
69
70
  if i[:check]
70
71
  good += i[:weight]
71
- @history += app.letter[:good]
72
+ @history += Settings.letter[:good]
72
73
  else
73
74
  fail += i[:weight]
74
75
  fail_counter += 1
75
- @history += app.letter[:bad]
76
+ @history += Settings.letter[:bad]
76
77
  end
77
78
  end
78
79
  @tail[:max_weight] = max
@@ -1,16 +1,18 @@
1
1
  require "fileutils"
2
2
  require "rainbow"
3
3
 
4
- module Skeleton
5
- def self.create(project_dir)
4
+ class Skeleton
5
+ def create(project_dir)
6
6
  project_name = File.basename(project_dir)
7
- puts "\n[INFO] Creating #{Rainbow(project_name).bright} project skeleton"
7
+ puts "\nCreating #{Rainbow(project_name).bright} project"
8
8
  source_basedir = File.dirname(__FILE__)
9
9
  create_dir project_dir
10
10
  create_main_dir_and_files(project_dir, source_basedir)
11
11
  end
12
12
 
13
- private_class_method def self.create_main_dir_and_files(project_dir, source_basedir)
13
+ private
14
+
15
+ def create_main_dir_and_files(project_dir, source_basedir)
14
16
  # Directory and files: Ruby script, Configfile, gitignore
15
17
  items = [
16
18
  {source: "files/config.yaml", target: "config.yaml"},
@@ -23,7 +25,7 @@ module Skeleton
23
25
  end
24
26
  end
25
27
 
26
- private_class_method def self.create_dir(dirpath)
28
+ def create_dir(dirpath)
27
29
  if Dir.exist? dirpath
28
30
  puts "* Exists dir! => #{Rainbow(dirpath).yellow}"
29
31
  else
@@ -36,11 +38,7 @@ module Skeleton
36
38
  end
37
39
  end
38
40
 
39
- ##
40
- # Copy file
41
- # @param source (String) Source file
42
- # @param dest (String) Dest file
43
- private_class_method def self.copyfile(source, dest)
41
+ def copyfile(source, dest)
44
42
  if File.exist? dest
45
43
  puts "* Exists file! => #{Rainbow(dest).yellow}"
46
44
  else
@@ -1,5 +1,5 @@
1
1
  require "singleton"
2
- require_relative "utils/name_file_finder"
2
+ require_relative "name_file_finder"
3
3
 
4
4
  class Application
5
5
  include Singleton
@@ -33,7 +33,11 @@ class Application
33
33
  @running_basedir = Dir.getwd
34
34
  @output_basedir = "var"
35
35
  @default = {name: "teuton", format: :txt, debug: false}
36
- @options = {"lang" => "en"}
36
+ @options = {
37
+ "lang" => "en",
38
+ "color" => true,
39
+ "panel" => false
40
+ }
37
41
  @verbose = true
38
42
 
39
43
  @global = {}
@@ -65,10 +69,14 @@ class Application
65
69
  # * Read color input option
66
70
  def add_input_params(projectpath, options)
67
71
  @options.merge! options
68
- NameFileFinder.find_filenames_for(projectpath)
69
- @options["color"] = true if @options["color"].nil?
70
72
  Rainbow.enabled = @options["color"]
71
- @options["panel"] = false if @options["panel"].nil?
73
+
74
+ finder = NameFileFinder.new(@options)
75
+ finder.find_filenames_for(projectpath)
76
+ @project_path = finder.project_path
77
+ @script_path = finder.script_path
78
+ @config_path = finder.config_path
79
+ @test_name = finder.test_name
72
80
 
73
81
  unless @options["case"].nil?
74
82
  numbers = @options["case"].split(",")