jira-cli 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -28
- data/bin/jira +3 -1
- data/lib/jira.rb +12 -6
- data/lib/jira/api.rb +10 -5
- data/lib/jira/auth_api.rb +11 -0
- data/lib/jira/command.rb +21 -1
- data/lib/jira/commands/all.rb +2 -2
- data/lib/jira/commands/assign.rb +2 -2
- data/lib/jira/commands/comment.rb +8 -98
- data/lib/jira/commands/comment/add.rb +46 -0
- data/lib/jira/commands/comment/delete.rb +80 -0
- data/lib/jira/commands/comment/list.rb +69 -0
- data/lib/jira/commands/comment/update.rb +88 -0
- data/lib/jira/commands/delete.rb +0 -2
- data/lib/jira/commands/describe.rb +0 -2
- data/lib/jira/commands/install.rb +39 -17
- data/lib/jira/commands/link.rb +4 -3
- data/lib/jira/commands/log.rb +7 -72
- data/lib/jira/commands/log/add.rb +50 -0
- data/lib/jira/commands/log/delete.rb +80 -0
- data/lib/jira/commands/log/list.rb +69 -0
- data/lib/jira/commands/log/update.rb +89 -0
- data/lib/jira/commands/new.rb +4 -6
- data/lib/jira/commands/rename.rb +0 -2
- data/lib/jira/commands/sprint.rb +3 -3
- data/lib/jira/commands/tickets.rb +0 -2
- data/lib/jira/commands/transition.rb +0 -2
- data/lib/jira/commands/vote.rb +5 -107
- data/lib/jira/commands/vote/add.rb +43 -0
- data/lib/jira/commands/vote/delete.rb +46 -0
- data/lib/jira/commands/vote/list.rb +59 -0
- data/lib/jira/commands/watch.rb +5 -108
- data/lib/jira/commands/watch/add.rb +43 -0
- data/lib/jira/commands/watch/delete.rb +46 -0
- data/lib/jira/commands/watch/list.rb +59 -0
- data/lib/jira/constants.rb +1 -1
- data/lib/jira/core.rb +9 -1
- data/lib/jira/sprint_api.rb +2 -18
- metadata +17 -5
- data/lib/jira/commands/commit.rb +0 -14
- data/lib/jira/legacy_api.rb +0 -102
- data/lib/jira/mixins.rb +0 -56
data/lib/jira/mixins.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
module Jira
|
2
|
-
class CLI < Thor
|
3
|
-
|
4
|
-
require 'json'
|
5
|
-
require 'inifile'
|
6
|
-
require 'tty-prompt'
|
7
|
-
include Thor::Actions
|
8
|
-
|
9
|
-
protected
|
10
|
-
|
11
|
-
def io
|
12
|
-
@io ||= TTY::Prompt.new
|
13
|
-
end
|
14
|
-
|
15
|
-
#
|
16
|
-
# @param [Symbol]
|
17
|
-
#
|
18
|
-
# @return [Jira::API] Jira API class
|
19
|
-
#
|
20
|
-
def api(type=:rest)
|
21
|
-
key = "@api_#{type}"
|
22
|
-
klass = self.instance_variable_get(key)
|
23
|
-
if klass.nil?
|
24
|
-
klass = Jira::LegacyAPI.new(type)
|
25
|
-
self.instance_variable_set(key, klass)
|
26
|
-
end
|
27
|
-
return klass
|
28
|
-
end
|
29
|
-
|
30
|
-
#
|
31
|
-
# Prompts the user for a type of index, then returns the
|
32
|
-
# it; failure is < 0
|
33
|
-
#
|
34
|
-
# @return index [Integer] asked type of index
|
35
|
-
#
|
36
|
-
def get_type_of_index(command, description)
|
37
|
-
response = self.io.ask("Index for #{command} to #{description}:").strip
|
38
|
-
return -1 if response.empty?
|
39
|
-
index = response.to_i
|
40
|
-
return -1 if index < 0
|
41
|
-
index
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
class String
|
47
|
-
|
48
|
-
def from_json
|
49
|
-
JSON.parse(self) rescue {}
|
50
|
-
end
|
51
|
-
|
52
|
-
def periodize
|
53
|
-
self.strip[-1] == "." ? self : self + "."
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|