Class: TestRail::Command
- Inherits:
-
Object
- Object
- TestRail::Command
- Defined in:
- lib/test_rail_integration/generator/command.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#env ⇒ Object
Returns the value of attribute env.
-
#id ⇒ Object
Returns the value of attribute id.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#type ⇒ Object
Returns the value of attribute type.
-
#venture ⇒ Object
Returns the value of attribute venture.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
- #generate ⇒ Object
- #get_tags ⇒ Object
-
#initialize(id_of_run) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(id_of_run) ⇒ Command
Returns a new instance of Command.
12 13 14 |
# File 'lib/test_rail_integration/generator/command.rb', line 12 def initialize(id_of_run) self.id = id_of_run end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
5 6 7 |
# File 'lib/test_rail_integration/generator/command.rb', line 5 def command @command end |
#env ⇒ Object
Returns the value of attribute env.
5 6 7 |
# File 'lib/test_rail_integration/generator/command.rb', line 5 def env @env end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/test_rail_integration/generator/command.rb', line 5 def id @id end |
#tags ⇒ Object
Returns the value of attribute tags.
5 6 7 |
# File 'lib/test_rail_integration/generator/command.rb', line 5 def @tags end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/test_rail_integration/generator/command.rb', line 5 def type @type end |
#venture ⇒ Object
Returns the value of attribute venture.
5 6 7 |
# File 'lib/test_rail_integration/generator/command.rb', line 5 def venture @venture end |
Class Method Details
.execute_command(command) ⇒ Object
39 40 41 |
# File 'lib/test_rail_integration/generator/command.rb', line 39 def self.execute_command(command) exec("#{command}") end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 |
# 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 ⇒ Object
21 22 23 24 25 26 27 28 |
# 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 + " " + else self.command = self.command.gsub("\#{parameters.venture}", self.venture).gsub("\#{parameters.environment}", self.env) + " " + end end |
#get_tags ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/test_rail_integration/generator/command.rb', line 30 def 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 |