jira-cli 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81198c298ab55dd6c66b672ae1109f67f4d595ea
4
- data.tar.gz: ff255596b8f5de86bdba170b69b47316426c6022
3
+ metadata.gz: 26e38024a72dacde2712cf36890c7343dd878241
4
+ data.tar.gz: 1e5ee3a5a3719235da6f4890847c419708af349b
5
5
  SHA512:
6
- metadata.gz: 4a1df81fe88e8082e0d5b139fd87b4fc0fa268534b743e71a8bd0a03a5bd363cf3bb6cf45274204f4fbd4ec30bbb07da74e2906b4f5731d0ba85706bae0eb7c5
7
- data.tar.gz: cbeb9fef880c1f4bca4bc8f8df8b75c08743c4c5cc70273c6a58884204ba40b7911776d828b0ffe73291e734a677146ba7d074cb9a15307c179a618fa1d5df9d
6
+ metadata.gz: d7fcc3a1fb30afb8d9adfa180d6c36a0529ad9feb9f197a74bd273d244ce30e717bee96adc921583b5ca8faaa877942fea75e08de642c8b388f9bb86c85f9108
7
+ data.tar.gz: d2ddb2c5c015c9ba04492d3f7c7f31de6c52b928b1d5218001a3b1ea920ebbc91e4575c1f2aef00056837f85c2ea7e2e6fb41f467f91309102a1da254368fb6f
@@ -1,5 +1,5 @@
1
1
  module Jira
2
2
 
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
 
5
5
  end
@@ -7,9 +7,6 @@ module Jira
7
7
 
8
8
  desc "install", "Guides the user through JIRA installation"
9
9
  def install
10
- say self.jira_url_path
11
- say self.jira_auth_path
12
-
13
10
  create_file self.jira_url_path, nil, verbose:false do
14
11
  self.cli.ask("Enter your JIRA URL: ")
15
12
  end
@@ -4,7 +4,7 @@ module Jira
4
4
  desc "summarize", "Outputs the summary of the input ticket"
5
5
  def summarize(ticket=nil)
6
6
  ticket ||= ex('git rev-parse --abbrev-ref HEAD')
7
- json = self.query("issue/#{ticket}")
7
+ json = self.api_get("issue/#{ticket}")
8
8
  summary = json['fields']['summary']
9
9
  status = json['fields']['status']['name']
10
10
  self.mutex.synchronize do
@@ -32,6 +32,18 @@ module Jira
32
32
  threads.each{ |thread| thread.join }
33
33
  end
34
34
 
35
+ desc "comment", "Add a comment to the input ticket"
36
+ def comment(ticket=nil)
37
+ say "Coming soon"
38
+ #ticket ||= ex('get rev-parse --abbrev-ref HEAD')
39
+ #json = self.api_post("issue/#{ticket}")
40
+ end
41
+
42
+ desc "transition", "Transitions the input ticket to the next state"
43
+ def transition(ticket=nil)
44
+ say "Coming soon"
45
+ end
46
+
35
47
  protected
36
48
 
37
49
  def colored_ticket(ticket)
@@ -57,11 +69,20 @@ module Jira
57
69
  "#{Thor::Shell::Color::CLEAR}"
58
70
  end
59
71
 
60
- def query(path)
61
- response = self.client.get "#{self.jira_url}/rest/api/2/#{path}"
72
+ def api_get(path)
73
+ response = self.client.get self.api_path(path)
62
74
  return JSON.parse(response.body)
63
75
  end
64
76
 
77
+ def api_post(path, params)
78
+ response = self.client.post self.api_path(path), params
79
+ return JSON.parse(response)
80
+ end
81
+
82
+ def api_path(path)
83
+ "#{self.jira_url}/rest/api/2/#{path}"
84
+ end
85
+
65
86
  def mutex
66
87
  @mutex ||= Mutex.new
67
88
  end
@@ -80,7 +80,9 @@ module Jira
80
80
  end
81
81
  end
82
82
 
83
- def discard_memozied
83
+ def discard_memoized
84
+ @username = nil
85
+ @password = nil
84
86
  @jira_url = nil
85
87
  end
86
88
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jira-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Lin Cheng