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 +4 -4
- data/lib/jira/constants.rb +1 -1
- data/lib/jira/install.rb +0 -3
- data/lib/jira/lookup.rb +24 -3
- data/lib/jira/mixins.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26e38024a72dacde2712cf36890c7343dd878241
|
4
|
+
data.tar.gz: 1e5ee3a5a3719235da6f4890847c419708af349b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7fcc3a1fb30afb8d9adfa180d6c36a0529ad9feb9f197a74bd273d244ce30e717bee96adc921583b5ca8faaa877942fea75e08de642c8b388f9bb86c85f9108
|
7
|
+
data.tar.gz: d2ddb2c5c015c9ba04492d3f7c7f31de6c52b928b1d5218001a3b1ea920ebbc91e4575c1f2aef00056837f85c2ea7e2e6fb41f467f91309102a1da254368fb6f
|
data/lib/jira/constants.rb
CHANGED
data/lib/jira/install.rb
CHANGED
data/lib/jira/lookup.rb
CHANGED
@@ -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.
|
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
|
61
|
-
response = self.client.get
|
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
|
data/lib/jira/mixins.rb
CHANGED