Class: NameFileFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/teuton/utils/name_file_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ NameFileFinder

Returns a new instance of NameFileFinder.



10
11
12
13
14
15
16
# File 'lib/teuton/utils/name_file_finder.rb', line 10

def initialize(options = {})
  @options = options
  @project_path = nil
  @script_path = nil
  @config_path = nil
  @test_name = nil
end

Instance Attribute Details

#config_pathObject (readonly)

Returns the value of attribute config_path.



7
8
9
# File 'lib/teuton/utils/name_file_finder.rb', line 7

def config_path
  @config_path
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/teuton/utils/name_file_finder.rb', line 4

def options
  @options
end

#project_pathObject (readonly)

Returns the value of attribute project_path.



5
6
7
# File 'lib/teuton/utils/name_file_finder.rb', line 5

def project_path
  @project_path
end

#script_pathObject (readonly)

Returns the value of attribute script_path.



6
7
8
# File 'lib/teuton/utils/name_file_finder.rb', line 6

def script_path
  @script_path
end

#test_nameObject (readonly)

Returns the value of attribute test_name.



8
9
10
# File 'lib/teuton/utils/name_file_finder.rb', line 8

def test_name
  @test_name
end

Instance Method Details

#find_filenames_for(relprojectpath) ⇒ Object

Find project filenames from input project relative path

Parameters:

  • relprojectpath (String)


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/teuton/utils/name_file_finder.rb', line 21

def find_filenames_for(relprojectpath)
  projectpath = File.absolute_path(relprojectpath)

  # Define:
  #   script_path, must contain fullpath to DSL script file
  #   config_path, must contain fullpath to YAML config file
  if File.directory?(projectpath)
    # COMPLEX MODE: We use start.rb as main RB file
    find_filenames_from_directory(projectpath)
  else
    # SIMPLE MODE: We use pathtofile as main RB file
    find_filenames_from_rb(projectpath)
  end
  true
end