Class: TestRail::Generators::Project

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/test_rail_integration/generator/project.rb

Class Method Summary collapse

Class Method Details

.copy_file(file_name, root = nil) ⇒ Object

Copying templates for using for accessing to testrail



28
29
30
31
32
33
34
35
36
37
# File 'lib/test_rail_integration/generator/project.rb', line 28

def self.copy_file(file_name, root = nil)
  if file_name == "test_rail_data.yml"
    FileUtils.mkdir_p("config/data")
  end
  if root
    FileUtils.cp("#{source_root}/project/#{file_name}", "#{root}/#{file_name}")
  else
    FileUtils.cp("#{source_root}/project/#{file_name}", "#{file_name}")
  end
end

.source_rootObject

Obtaining path of project folder



14
15
16
# File 'lib/test_rail_integration/generator/project.rb', line 14

def self.source_root
  File.dirname(__FILE__)
end

.test_rail_data_file_exist?Boolean

Checking existence of tes trail data file

Returns:

  • (Boolean)


21
22
23
# File 'lib/test_rail_integration/generator/project.rb', line 21

def self.test_rail_data_file_exist?
  File.exists?("config/data/test_rail_data.yml")
end