terjira 0.4.4 → 0.4.5
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/.travis.yml +1 -0
- data/Gemfile.lock +7 -7
- data/README.md +2 -2
- data/lib/terjira/base_cli.rb +1 -1
- data/lib/terjira/client/board.rb +1 -1
- data/lib/terjira/client/issue.rb +2 -4
- data/lib/terjira/client/jql_builder.rb +2 -2
- data/lib/terjira/issue_cli.rb +0 -2
- data/lib/terjira/option_support/editor.rb +0 -2
- data/lib/terjira/option_support/option_selector.rb +6 -12
- data/lib/terjira/option_support/shared_options.rb +4 -4
- data/lib/terjira/option_supportable.rb +11 -11
- data/lib/terjira/presenters/board_presenter.rb +0 -2
- data/lib/terjira/presenters/common_presenter.rb +0 -2
- data/lib/terjira/presenters/issue_presenter.rb +1 -3
- data/lib/terjira/presenters/project_presenter.rb +0 -2
- data/lib/terjira/presenters/sprint_presenter.rb +1 -3
- data/lib/terjira/utils/file_cache.rb +1 -1
- data/lib/terjira/version.rb +1 -2
- data/terjira.gemspec +3 -3
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5ee0dcef09fef89e14eb9988ec488d155f64dc9abdf6b40e580608f2e1df210
|
4
|
+
data.tar.gz: a73fc739d2c2baebfcc1104f8c09a32dbfd6bbfedefe549791f5ef288e833f57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb451d9a5f4a97d7dcde64c75d7d83fbe23acbe7383e32f89de5c02d3603f4bd02100efe4a6078cf190ca9b0ed09be01d9eda50b5926ab29ee550443e375dff8
|
7
|
+
data.tar.gz: 4d13204a71527cc1cfe03f43f5b3bfe431641ee3d2a87a69e642fe390e696a200837a93aca805b0e321c6d0016af9d95e1346946f306e6f6078d1bf37165d1a9
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
terjira (0.4.
|
4
|
+
terjira (0.4.5)
|
5
5
|
activesupport (= 5.2.3)
|
6
6
|
jira-ruby (= 1.7.1)
|
7
7
|
thor (~> 0.20.0)
|
@@ -36,7 +36,7 @@ GEM
|
|
36
36
|
method_source (0.9.2)
|
37
37
|
minitest (5.13.0)
|
38
38
|
multipart-post (2.1.1)
|
39
|
-
necromancer (0.5.
|
39
|
+
necromancer (0.5.1)
|
40
40
|
oauth (0.5.4)
|
41
41
|
pastel (0.7.3)
|
42
42
|
equatable (~> 0.6)
|
@@ -63,7 +63,7 @@ GEM
|
|
63
63
|
json (>= 1.8, < 3)
|
64
64
|
simplecov-html (~> 0.10.0)
|
65
65
|
simplecov-html (0.10.2)
|
66
|
-
strings (0.1.
|
66
|
+
strings (0.1.8)
|
67
67
|
strings-ansi (~> 0.1)
|
68
68
|
unicode-display_width (~> 1.5)
|
69
69
|
unicode_utils (~> 1.4)
|
@@ -81,7 +81,7 @@ GEM
|
|
81
81
|
tty-screen (~> 0.7)
|
82
82
|
wisper (~> 2.0.0)
|
83
83
|
tty-screen (0.7.0)
|
84
|
-
tty-spinner (0.9.
|
84
|
+
tty-spinner (0.9.2)
|
85
85
|
tty-cursor (~> 0.7)
|
86
86
|
tty-table (0.11.0)
|
87
87
|
equatable (~> 0.6)
|
@@ -89,7 +89,7 @@ GEM
|
|
89
89
|
pastel (~> 0.7.2)
|
90
90
|
strings (~> 0.1.5)
|
91
91
|
tty-screen (~> 0.7)
|
92
|
-
tzinfo (1.2.
|
92
|
+
tzinfo (1.2.6)
|
93
93
|
thread_safe (~> 0.1)
|
94
94
|
unicode-display_width (1.6.0)
|
95
95
|
unicode_utils (1.4.0)
|
@@ -99,7 +99,7 @@ PLATFORMS
|
|
99
99
|
ruby
|
100
100
|
|
101
101
|
DEPENDENCIES
|
102
|
-
bundler (~> 1
|
102
|
+
bundler (~> 2.1)
|
103
103
|
pry (~> 0.12.0)
|
104
104
|
rake (~> 13.0)
|
105
105
|
rspec (~> 3.9)
|
@@ -107,4 +107,4 @@ DEPENDENCIES
|
|
107
107
|
terjira!
|
108
108
|
|
109
109
|
BUNDLED WITH
|
110
|
-
1.
|
110
|
+
2.1.2
|
data/README.md
CHANGED
@@ -61,7 +61,7 @@ Sprint:
|
|
61
61
|
Issue:
|
62
62
|
jira issue help [COMMAND] # Describe one specific subcommand
|
63
63
|
jira issue ( ls | list ) # List of issues
|
64
|
-
#
|
64
|
+
# Default assignee option is current logged-in user
|
65
65
|
# To show issues of all users(include no assignee)
|
66
66
|
# pass `--assignee ALL` or `-a ALL`.
|
67
67
|
jira issue jql "[QUERY]" # Search issues with JQL
|
@@ -81,7 +81,7 @@ Issue:
|
|
81
81
|
jira issue new # Create an issue
|
82
82
|
# pass `-E` or `--editor` to open system default editor for composing issue description
|
83
83
|
jira issue open [ISSUE_KEY] # Open browser
|
84
|
-
jira issue url [ISSUE_KEY] #
|
84
|
+
jira issue url [ISSUE_KEY] # Return url of the issue
|
85
85
|
jira issue take [ISSUE_KEY] # Assign the issue to self
|
86
86
|
jira issue trans [ISSUE_KEY] ([STATUS]) # Do transition
|
87
87
|
|
data/lib/terjira/base_cli.rb
CHANGED
data/lib/terjira/client/board.rb
CHANGED
@@ -20,7 +20,7 @@ module Terjira
|
|
20
20
|
def backlog(board_id, options = {})
|
21
21
|
jql = build_jql(options)
|
22
22
|
resp = if jql.present?
|
23
|
-
|
23
|
+
agile_api_get("board/#{board_id}/backlog", jql: jql)
|
24
24
|
else
|
25
25
|
agile_api_get("board/#{board_id}/backlog")
|
26
26
|
end
|
data/lib/terjira/client/issue.rb
CHANGED
@@ -61,7 +61,7 @@ module Terjira
|
|
61
61
|
def update(issue, options = {})
|
62
62
|
params = extract_to_update_params(options)
|
63
63
|
params.merge!(extract_to_fields_params(options))
|
64
|
-
|
64
|
+
api_put "issue/#{issue.key_value}", params.to_json
|
65
65
|
find(issue)
|
66
66
|
end
|
67
67
|
|
@@ -101,9 +101,7 @@ module Terjira
|
|
101
101
|
end
|
102
102
|
|
103
103
|
[:project, :parent].each do |resource|
|
104
|
-
if opts.key?(resource)
|
105
|
-
params[resource] = { key: opts.delete(resource).key_value }
|
106
|
-
end
|
104
|
+
params[resource] = { key: opts.delete(resource).key_value } if opts.key?(resource)
|
107
105
|
end
|
108
106
|
|
109
107
|
opts.each { |k, v| params[k] = convert_param_key_value_hash(v) }
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Terjira
|
2
2
|
module Client
|
3
3
|
module JQLBuilder
|
4
|
-
STRICT_KEYS = %w
|
5
|
-
SEARCH_KEYS = %w
|
4
|
+
STRICT_KEYS = %w[sprint assignee issuetype priority project status statusCategory].freeze
|
5
|
+
SEARCH_KEYS = %w[summary description].freeze
|
6
6
|
|
7
7
|
def build_jql(options = {})
|
8
8
|
search = options.select { |k, _v| SEARCH_KEYS.include?(k.to_s) }
|
data/lib/terjira/issue_cli.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require 'tty-prompt'
|
4
|
-
require_relative 'resource_store'
|
5
2
|
require_relative 'editor'
|
3
|
+
require_relative 'resource_store'
|
6
4
|
|
7
5
|
module Terjira
|
8
6
|
module OptionSelector
|
@@ -135,12 +133,12 @@ module Terjira
|
|
135
133
|
|
136
134
|
def write_epiclink_key
|
137
135
|
fetch(:epiclink) do
|
138
|
-
option_prompt.ask('Epic
|
136
|
+
option_prompt.ask('Epic Key?')
|
139
137
|
end
|
140
138
|
end
|
141
139
|
|
142
140
|
def write_epic_name
|
143
|
-
option_prompt.ask('Epic
|
141
|
+
option_prompt.ask('Epic Name?')
|
144
142
|
end
|
145
143
|
|
146
144
|
def write_comment
|
@@ -180,7 +178,7 @@ module Terjira
|
|
180
178
|
end
|
181
179
|
|
182
180
|
def write_parent_issue_key
|
183
|
-
fetch(:parent) { option_prompt.ask('Parent
|
181
|
+
fetch(:parent) { option_prompt.ask('Parent Issue Key?') }
|
184
182
|
end
|
185
183
|
|
186
184
|
private
|
@@ -241,15 +239,11 @@ module Terjira
|
|
241
239
|
@_option_select_prompt.on(:keypress) do |event|
|
242
240
|
# emacs key binding
|
243
241
|
{ "\u000E" => :keydown, "\u0010" => :keyup }.each do |key, action|
|
244
|
-
if event.value == key
|
245
|
-
@_option_select_prompt.trigger(action)
|
246
|
-
end
|
242
|
+
@_option_select_prompt.trigger(action) if event.value == key
|
247
243
|
end
|
248
244
|
# vim key binding
|
249
245
|
{ 'j' => :keydown, 'k' => :keyup, 'h' => :keyleft, 'l' => :keyright }.each do |key, action|
|
250
|
-
if event.value == key
|
251
|
-
@_option_select_prompt.trigger(action)
|
252
|
-
end
|
246
|
+
@_option_select_prompt.trigger(action) if event.value == key
|
253
247
|
end
|
254
248
|
end
|
255
249
|
@_option_select_prompt
|
@@ -3,7 +3,7 @@ module Terjira
|
|
3
3
|
OPTIONS = {
|
4
4
|
'project' => {
|
5
5
|
type: :string,
|
6
|
-
aliases: '-p'
|
6
|
+
aliases: '-p'
|
7
7
|
},
|
8
8
|
'board' => {
|
9
9
|
type: :numeric,
|
@@ -23,9 +23,9 @@ module Terjira
|
|
23
23
|
'state' => {
|
24
24
|
type: :array,
|
25
25
|
aliases: '-s',
|
26
|
-
default: %w
|
27
|
-
lazy_default: %w
|
28
|
-
enum: %w
|
26
|
+
default: %w[Active Future],
|
27
|
+
lazy_default: %w[Active Future],
|
28
|
+
enum: %w[Active Future Closed]
|
29
29
|
},
|
30
30
|
'status' => {
|
31
31
|
type: :string,
|
@@ -13,22 +13,22 @@ module Terjira
|
|
13
13
|
end
|
14
14
|
|
15
15
|
OPTION_TO_SELECTOR = {
|
16
|
-
|
16
|
+
assignee: :select_assignee,
|
17
17
|
board: :select_board,
|
18
|
-
|
18
|
+
comment: :write_comment,
|
19
19
|
description: :write_description,
|
20
|
-
|
20
|
+
editable_comment: :update_comment,
|
21
|
+
epiclink: :write_epiclink_key,
|
21
22
|
issuetype: :select_issuetype,
|
22
|
-
assignee: :select_assignee,
|
23
|
-
status: :select_issue_status,
|
24
23
|
priority: :select_priority,
|
24
|
+
project: :select_project,
|
25
25
|
resolution: :select_resolution,
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
sprint: :select_sprint,
|
27
|
+
status: :select_issue_status,
|
28
|
+
summary: :write_summary
|
29
29
|
}.freeze
|
30
30
|
|
31
|
-
# Transforming and
|
31
|
+
# Transforming and cleaning options
|
32
32
|
# and suggest list of option values
|
33
33
|
def suggest_options(opts = {})
|
34
34
|
origin = options.dup
|
@@ -63,13 +63,13 @@ module Terjira
|
|
63
63
|
default_value_options = Hash[default_value_options]
|
64
64
|
|
65
65
|
# Suggest option values and save to resource store
|
66
|
-
default_value_options.
|
66
|
+
default_value_options.each_key do |k, _v|
|
67
67
|
selector_method = OPTION_TO_SELECTOR[k.to_sym]
|
68
68
|
send(selector_method) if selector_method
|
69
69
|
end
|
70
70
|
|
71
71
|
# Fetch selected values from resource store
|
72
|
-
default_value_options.
|
72
|
+
default_value_options.each_key do |k, _v|
|
73
73
|
default_value_options[k] = resource_store.get(k)
|
74
74
|
end
|
75
75
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require 'tty-prompt'
|
4
2
|
require 'tty-table'
|
5
3
|
require 'pastel'
|
@@ -203,7 +201,7 @@ module Terjira
|
|
203
201
|
|
204
202
|
def extract_status_names(issues)
|
205
203
|
issue_names = issues.sort_by do |issue|
|
206
|
-
status_key = %w
|
204
|
+
status_key = %w[new indeterminate done]
|
207
205
|
idx = if issue.status.respond_to? :statusCategory
|
208
206
|
status_key.index(issue.status.statusCategory['key'])
|
209
207
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
module Terjira
|
4
2
|
module SprintPresenter
|
5
3
|
def render_sprint_detail(sprint)
|
@@ -15,7 +13,7 @@ module Terjira
|
|
15
13
|
end
|
16
14
|
|
17
15
|
def render_sprints_summary(sprints)
|
18
|
-
headers = %w
|
16
|
+
headers = %w[ID Summary].map { |h| pastel.bold(h) }
|
19
17
|
rows = []
|
20
18
|
sort_sprint_by_state(sprints).each do |sprint|
|
21
19
|
rows << [pastel.bold(sprint.id), summarise_sprint(sprint)]
|
@@ -60,7 +60,7 @@ module Terjira
|
|
60
60
|
|
61
61
|
# Delete the value for the given key from the cache
|
62
62
|
def delete(key)
|
63
|
-
FileUtils.rm(get_path(key)) if File.
|
63
|
+
FileUtils.rm(get_path(key)) if File.exist? get_path(key)
|
64
64
|
end
|
65
65
|
|
66
66
|
# Delete ALL data from the cache, regardless of expiry time
|
data/lib/terjira/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'terjira/utils/file_cache'
|
2
2
|
|
3
3
|
module Terjira
|
4
|
-
VERSION = '0.4.
|
4
|
+
VERSION = '0.4.5'.freeze
|
5
5
|
|
6
6
|
class VersionChecker
|
7
7
|
VERSION_CHECK_DURATION = (60 * 60 * 24 * 5).freeze
|
@@ -43,6 +43,5 @@ module Terjira
|
|
43
43
|
@version_alert_cache ||= Terjira::FileCache.new("version", VERSION_CHECK_DURATION)
|
44
44
|
end
|
45
45
|
end
|
46
|
-
|
47
46
|
end
|
48
47
|
end
|
data/terjira.gemspec
CHANGED
@@ -7,8 +7,8 @@ require 'terjira/version'
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = "terjira"
|
9
9
|
spec.version = Terjira::VERSION
|
10
|
-
spec.authors = ["Jaehyun Shin"]
|
11
|
-
spec.email = ["keepcosmos@gmail.com"]
|
10
|
+
spec.authors = ["Jaehyun Shin", "Ren Guoy"]
|
11
|
+
spec.email = ["keepcosmos@gmail.com", "guoy.ren@gmail.com"]
|
12
12
|
|
13
13
|
spec.summary = "Terjira is interactive command line application for Jira"
|
14
14
|
spec.description = "Terjira is interactive and easy to use command line interface (or Application) for Jira.\nYou do not need to remember resource key or id. Terjira suggests with interactive prompt."
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency "tty-prompt", "~> 0.19.0"
|
29
29
|
spec.add_dependency "tty-spinner", "~> 0.9.1"
|
30
30
|
|
31
|
-
spec.add_development_dependency "bundler", "~> 1
|
31
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
32
32
|
spec.add_development_dependency "rake", "~> 13.0"
|
33
33
|
spec.add_development_dependency "rspec", "~> 3.9"
|
34
34
|
spec.add_development_dependency "simplecov", "~> 0"
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terjira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaehyun Shin
|
8
|
+
- Ren Guoy
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2020-01-02 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: thor
|
@@ -100,14 +101,14 @@ dependencies:
|
|
100
101
|
requirements:
|
101
102
|
- - "~>"
|
102
103
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1
|
104
|
+
version: '2.1'
|
104
105
|
type: :development
|
105
106
|
prerelease: false
|
106
107
|
version_requirements: !ruby/object:Gem::Requirement
|
107
108
|
requirements:
|
108
109
|
- - "~>"
|
109
110
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1
|
111
|
+
version: '2.1'
|
111
112
|
- !ruby/object:Gem::Dependency
|
112
113
|
name: rake
|
113
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,6 +170,7 @@ description: |-
|
|
169
170
|
You do not need to remember resource key or id. Terjira suggests with interactive prompt.
|
170
171
|
email:
|
171
172
|
- keepcosmos@gmail.com
|
173
|
+
- guoy.ren@gmail.com
|
172
174
|
executables:
|
173
175
|
- jira
|
174
176
|
extensions: []
|