tempest_time 0.5.6 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/tempest_time/cli.rb +6 -0
- data/lib/tempest_time/commands/issue.rb +25 -0
- data/lib/tempest_time/commands/issues.rb +16 -4
- data/lib/tempest_time/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d691cff0165bbed3a5fec7fd6e03290e22073d11c8d00bcc2d695d7a0e29161a
|
4
|
+
data.tar.gz: 480718ec2d0f8a99bb9128113c0c2927cdcb8f634d3c0cf3616d6c2469830205
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d83520231149dce7e91072a738c8e75556ac6070e19db50ef43f275d7f91645e8a6973183529789ff3a8495c9d79f5deca061aeb494bd76e6f6c72c0ec4b63bf
|
7
|
+
data.tar.gz: 3e6dca53bdedfdaaea7a9e373bf367693c2f819315b581372813067b6e452e9f7cebd6146a3ef59738bdeb9c88638a98c0eb45a77a3c2c4e6e640d25a83058ec
|
data/Gemfile.lock
CHANGED
data/lib/tempest_time/cli.rb
CHANGED
@@ -57,6 +57,12 @@ module TempestTime
|
|
57
57
|
TempestTime::Commands::Delete.new(worklogs, options).execute
|
58
58
|
end
|
59
59
|
|
60
|
+
desc 'issue', 'Open a Jira issue in your browser.'
|
61
|
+
def issue(issue)
|
62
|
+
require_relative 'commands/issue'
|
63
|
+
TempestTime::Commands::Issue.new(issue).execute
|
64
|
+
end
|
65
|
+
|
60
66
|
desc 'issues', "View a list of a user's assigned tickets. (Defaults to you.)"
|
61
67
|
def issues(user = nil)
|
62
68
|
require_relative 'commands/issues'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../command'
|
4
|
+
require_relative '../settings/authorization'
|
5
|
+
|
6
|
+
module TempestTime
|
7
|
+
module Commands
|
8
|
+
class Issue < TempestTime::Command
|
9
|
+
def initialize(issue)
|
10
|
+
@issue = issue.upcase
|
11
|
+
end
|
12
|
+
|
13
|
+
def execute(input: $stdin, output: $stdout)
|
14
|
+
command.run("open #{url(@issue)}")
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def url(issue)
|
20
|
+
domain = TempestTime::Settings::Authorization.read('subdomain')
|
21
|
+
"https://#{domain}.atlassian.net/browse/#{issue}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative '../command'
|
4
4
|
require_relative '../api/jira_api/requests/get_user_issues'
|
5
|
+
require_relative './issue'
|
5
6
|
|
6
7
|
module TempestTime
|
7
8
|
module Commands
|
@@ -13,15 +14,26 @@ module TempestTime
|
|
13
14
|
|
14
15
|
def execute(input: $stdin, output: $stdout)
|
15
16
|
request = JiraAPI::Requests::GetUserIssues.new(@user)
|
16
|
-
|
17
|
-
|
18
|
-
spinner.stop
|
19
|
-
puts format_output(response.issues)
|
17
|
+
message = "Getting issues for #{request.requested_user}"
|
18
|
+
response = with_spinner(message) do |spinner|
|
19
|
+
request.send_request.tap { spinner.stop }
|
20
20
|
end
|
21
|
+
puts format_output(response.issues)
|
22
|
+
browser_prompt(response.issues)
|
21
23
|
end
|
22
24
|
|
23
25
|
private
|
24
26
|
|
27
|
+
def browser_prompt(issues)
|
28
|
+
abort if prompt.no?('Open an issue in your browser?')
|
29
|
+
issue = prompt.select(
|
30
|
+
'Select an issue to open in browser, or press ^C to quit.',
|
31
|
+
issues.map(&:key),
|
32
|
+
per_page: 5
|
33
|
+
)
|
34
|
+
Issue.new(issue).execute
|
35
|
+
end
|
36
|
+
|
25
37
|
def format_output(issues)
|
26
38
|
table.new(
|
27
39
|
%w[Status Issue Summary],
|
data/lib/tempest_time/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tempest_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Devan Hurst
|
@@ -454,6 +454,7 @@ files:
|
|
454
454
|
- lib/tempest_time/commands/config/edit.rb
|
455
455
|
- lib/tempest_time/commands/config/setup.rb
|
456
456
|
- lib/tempest_time/commands/delete.rb
|
457
|
+
- lib/tempest_time/commands/issue.rb
|
457
458
|
- lib/tempest_time/commands/issues.rb
|
458
459
|
- lib/tempest_time/commands/list.rb
|
459
460
|
- lib/tempest_time/commands/report.rb
|