Class: Jigit::IssueRunner

Inherits:
Runner
  • Object
show all
Defined in:
lib/jigit/commands/issue.rb

Direct Known Subclasses

StartIssueRunner, StopIssueRunner

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Runner

#ui

Constructor Details

#initialize(argv) ⇒ IssueRunner

Returns a new instance of IssueRunner.



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/jigit/commands/issue.rb', line 14

def initialize(argv)
  super
  jigitfile = argv.option("jigitfile")
  unless jigitfile
    jigitfile = try_to_find_jigitfile_path
    raise "--jigitfile is a required parameter and could not be nil" if jigitfile.nil?
  end
  @jigitfile = Jigit::Jigitfile.new(jigitfile)
  @issue_name = argv.option("name")
  keychain_item = Jigit::KeychainStorage.new.load_item(@jigitfile.host)
  @jira_config = Jigit::JiraConfig.new(keychain_item., keychain_item.password, keychain_item.service)
  @jira_api_client = Jigit::JiraAPIClient.new(@jira_config, nil) if @jira_config
end

Class Method Details

.optionsObject



34
35
36
37
38
39
# File 'lib/jigit/commands/issue.rb', line 34

def self.options
  [
    ["--name=issue_name_on_jira", "Use this argument to provide a JIRA issue name. For example if the project short name is CNI, the issue name could be CNI-101"],
    ["--jigitfile=path_to_jigit_file", "Use this argument to provide a path to Jigitfile, if nil will be used a default path under the './jigit/' folder"]
  ].concat(super)
end

Instance Method Details

#runObject



41
42
43
# File 'lib/jigit/commands/issue.rb', line 41

def run
  self
end

#validate!Object



28
29
30
31
32
# File 'lib/jigit/commands/issue.rb', line 28

def validate!
  super
  help!("Please setup jira config using `jigit init` before using issue command.") unless @jira_config
  help!("Please setup jigitfile using `jigit init` before using issue command.") unless @jigitfile
end