tempest_time 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tempest_time/cli.rb +1 -0
- data/lib/tempest_time/commands/issue/list.rb +2 -3
- data/lib/tempest_time/commands/issue.rb +4 -3
- data/lib/tempest_time/commands/list.rb +4 -3
- data/lib/tempest_time/commands/timer/pause.rb +1 -0
- data/lib/tempest_time/commands/timer/status.rb +1 -1
- data/lib/tempest_time/commands/timer/track.rb +10 -6
- data/lib/tempest_time/commands/timer.rb +5 -5
- data/lib/tempest_time/models/timer.rb +1 -1
- data/lib/tempest_time/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dc1c7b91082976a5cdf396f23be001fbe2c68956192529eb3003ef8ba3a83c8
|
4
|
+
data.tar.gz: f49897370dd1c92460846bce2fabf8188e161729e5fd323e9b04ce990474fa43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ec5378757169311d48119c1d80e513698efc91436c92d9cb866535ebec93fc2d78fb3a1656614b2071869263d302869e09d6ecf7524707b67c48652a0129b41
|
7
|
+
data.tar.gz: 0cc9f938ff581e203cbc766d79d1c9413f7cea6e608962dac940291e63da9004bd8ba8faa5f1233ac712008996a5e187dc81d882c961c839d938dd52d4ba1b8d
|
data/lib/tempest_time/cli.rb
CHANGED
@@ -30,6 +30,7 @@ module TempestTime
|
|
30
30
|
|
31
31
|
desc 'list', 'List worklogs for a specific date.'
|
32
32
|
option :user, aliases: '-u', type: :string
|
33
|
+
option :date, aliases: '-d', type: :string
|
33
34
|
def list
|
34
35
|
require_relative 'commands/list'
|
35
36
|
TempestTime::Commands::List.new(options).execute
|
@@ -7,9 +7,8 @@ module TempestTime
|
|
7
7
|
module Commands
|
8
8
|
class Issue
|
9
9
|
class List < TempestTime::Command
|
10
|
-
def initialize(
|
11
|
-
@user =
|
12
|
-
@options = options
|
10
|
+
def initialize(user)
|
11
|
+
@user = user || current_user
|
13
12
|
end
|
14
13
|
|
15
14
|
def execute(input: $stdin, output: $stdout)
|
@@ -8,10 +8,11 @@ module TempestTime
|
|
8
8
|
|
9
9
|
namespace :issue
|
10
10
|
|
11
|
-
desc 'list', '
|
12
|
-
|
11
|
+
desc 'list', 'List unresolved issues.'
|
12
|
+
option :date, type: :string
|
13
|
+
def list(user = nil)
|
13
14
|
require_relative 'issue/list'
|
14
|
-
TempestTime::Commands::Issue::List.new(
|
15
|
+
TempestTime::Commands::Issue::List.new(user).execute
|
15
16
|
end
|
16
17
|
|
17
18
|
desc 'open', 'Open an issue in your browser. (Default: current branch)'
|
@@ -10,7 +10,8 @@ module TempestTime
|
|
10
10
|
include TempestTime::Helpers::TimeHelper
|
11
11
|
|
12
12
|
def initialize(options)
|
13
|
-
@
|
13
|
+
@user = options[:user]
|
14
|
+
@date = options[:date] ? Date.parse(options[:date]) : nil
|
14
15
|
end
|
15
16
|
|
16
17
|
def execute(input: $stdin, output: $stdout)
|
@@ -20,7 +21,7 @@ module TempestTime
|
|
20
21
|
@response = TempoAPI::Requests::ListWorklogs.new(
|
21
22
|
@date,
|
22
23
|
nil,
|
23
|
-
@
|
24
|
+
@user
|
24
25
|
).send_request
|
25
26
|
spin.stop(pastel.green('Done!'))
|
26
27
|
prompt.say(render_table)
|
@@ -42,7 +43,7 @@ module TempestTime
|
|
42
43
|
t.render(
|
43
44
|
:ascii,
|
44
45
|
padding: [0, 1],
|
45
|
-
column_widths: [7,10,15,30],
|
46
|
+
column_widths: [7, 10, 15, 30],
|
46
47
|
multiline: true
|
47
48
|
)
|
48
49
|
end
|
@@ -25,17 +25,21 @@ module TempestTime
|
|
25
25
|
private
|
26
26
|
|
27
27
|
def track_time
|
28
|
+
issue = prompt.ask(
|
29
|
+
'Which issue should this time be logged to?',
|
30
|
+
default: timer.issue
|
31
|
+
)
|
28
32
|
time = prompt.ask(
|
29
|
-
|
30
|
-
|
33
|
+
"How much time should be logged to #{issue}?",
|
34
|
+
default: formatted_time_for_input(timer.runtime)
|
31
35
|
)
|
32
36
|
billable = prompt.yes?('Is this time billable?')
|
33
37
|
message = prompt.ask('Add a message. (optional)')
|
34
38
|
Commands::Track.new(
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
+
parsed_time(time),
|
40
|
+
[issue],
|
41
|
+
'message' => message,
|
42
|
+
'billable' => billable
|
39
43
|
).execute
|
40
44
|
end
|
41
45
|
end
|
@@ -11,31 +11,31 @@ module TempestTime
|
|
11
11
|
desc 'start [ISSUE]', 'Start a new timer, or continue a paused timer.'
|
12
12
|
def start(issue = nil)
|
13
13
|
require_relative 'timer/start'
|
14
|
-
TempestTime::Commands::Timer::Start.new(issue).execute
|
14
|
+
TempestTime::Commands::Timer::Start.new(issue&.upcase).execute
|
15
15
|
end
|
16
16
|
|
17
17
|
desc 'pause [ISSUE]', 'Pause a timer.'
|
18
18
|
def pause(issue = nil)
|
19
19
|
require_relative 'timer/pause'
|
20
|
-
TempestTime::Commands::Timer::Pause.new(issue).execute
|
20
|
+
TempestTime::Commands::Timer::Pause.new(issue&.upcase).execute
|
21
21
|
end
|
22
22
|
|
23
23
|
desc 'track [ISSUE]', 'Stop and track a timer.'
|
24
24
|
def track(issue = nil)
|
25
25
|
require_relative 'timer/track'
|
26
|
-
TempestTime::Commands::Timer::Track.new(issue).execute
|
26
|
+
TempestTime::Commands::Timer::Track.new(issue&.upcase).execute
|
27
27
|
end
|
28
28
|
|
29
29
|
desc 'delete [ISSUE]', 'Delete current timer.'
|
30
30
|
def delete(issue = nil)
|
31
31
|
require_relative 'timer/delete'
|
32
|
-
TempestTime::Commands::Timer::Delete.new(issue).execute
|
32
|
+
TempestTime::Commands::Timer::Delete.new(issue&.upcase).execute
|
33
33
|
end
|
34
34
|
|
35
35
|
desc 'status [ISSUE]', 'Display timer status.'
|
36
36
|
def status(issue = nil)
|
37
37
|
require_relative 'timer/status'
|
38
|
-
TempestTime::Commands::Timer::Status.new(issue).execute
|
38
|
+
TempestTime::Commands::Timer::Status.new(issue&.upcase).execute
|
39
39
|
end
|
40
40
|
|
41
41
|
desc 'list', 'Display all timers.'
|
data/lib/tempest_time/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tempest_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Devan Hurst
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|