class TestRail::Command

Attributes

command[RW]
env[RW]
id[RW]
tags[RW]
type[RW]
venture[RW]

Public Class Methods

execute_command(command) click to toggle source
# File lib/test_rail_integration/generator/command.rb, line 39
def self.execute_command(command)
  exec("#{command}")
end
new(id_of_run) click to toggle source
# File lib/test_rail_integration/generator/command.rb, line 12
def initialize(id_of_run)
  self.id = id_of_run
end

Public Instance Methods

execute() click to toggle source
# File lib/test_rail_integration/generator/command.rb, line 16
def execute
  p "Gem will execute command: #{self.command}"
  TestRail::Command.execute_command("#{self.command}")
end
generate() click to toggle source
# File lib/test_rail_integration/generator/command.rb, line 21
def generate
  #TODO do smth with weird replacement
  if venture.nil? || env.nil?
    self.command = self.command + " " + get_tags
  else
    self.command = self.command.gsub("\#{parameters.venture}", self.venture).gsub("\#{parameters.environment}", self.env) + " " + get_tags
  end
end
get_tags() click to toggle source
# File lib/test_rail_integration/generator/command.rb, line 30
def get_tags
  if self.type.nil?
    cases = Connection.cases_ids_by_default(self.id)
  else
    cases = Connection.cases_ids_by_type(self.id, self.type)
  end
  cases.map { |id| "@C"+id.to_s }.join(",")
end