tempest_time 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/tempest_time/api/tempo_api/requests/create_worklog.rb +5 -5
- data/lib/tempest_time/cli.rb +2 -1
- data/lib/tempest_time/commands/report.rb +11 -1
- data/lib/tempest_time/commands/timer/delete.rb +8 -3
- data/lib/tempest_time/commands/timer/list.rb +5 -2
- data/lib/tempest_time/commands/timer/track.rb +2 -2
- data/lib/tempest_time/commands/track.rb +8 -7
- data/lib/tempest_time/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5f0b28efca7d86aa211972f46715abbc9280b68b9ef899964601d31b22175240
|
4
|
+
data.tar.gz: 9f244e11657b42344c22275331bde8538a247117a4c098519355f6e766bdf89d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 314dc7529baf6ff390c05d6429da13244015ecf6d89d840bab1063a53cddeb067fd0275a036d63320617b9de527bdfa896c409682a33c51cc0ec6313b19e0d8e
|
7
|
+
data.tar.gz: 1de292852bc3af692ed108442edf035d4adae2f49a686bb12986d66413f76170d4ee13708dfb84a4e8cad124580270d47c0d76480b397ae0f92f684ba3bbd1bf
|
@@ -7,11 +7,11 @@ module TempoAPI
|
|
7
7
|
def initialize(seconds, options)
|
8
8
|
super
|
9
9
|
@seconds = seconds
|
10
|
-
@remaining = options[
|
11
|
-
@issue = options[
|
12
|
-
@message = options[
|
13
|
-
@date = options[
|
14
|
-
@billable = options[
|
10
|
+
@remaining = options[:remaining]
|
11
|
+
@issue = options[:issue]
|
12
|
+
@message = options[:message]
|
13
|
+
@date = options[:date] ? options[:date] : Date.today
|
14
|
+
@billable = options[:billable]
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
data/lib/tempest_time/cli.rb
CHANGED
@@ -52,8 +52,9 @@ module TempestTime
|
|
52
52
|
end
|
53
53
|
|
54
54
|
desc 'report', 'Generate a user or team report.'
|
55
|
-
option :week, aliases: '-w', type: :numeric
|
56
55
|
option :team, aliases: '-t', type: :string
|
56
|
+
option :start, aliases: '-s', type: :string
|
57
|
+
option :end, aliases: '-e', type: :string
|
57
58
|
def report(*users)
|
58
59
|
require_relative 'commands/report'
|
59
60
|
TempestTime::Commands::Report.new(users, options).execute
|
@@ -13,6 +13,8 @@ module TempestTime
|
|
13
13
|
def initialize(users, options)
|
14
14
|
@users = users || []
|
15
15
|
@team = options[:team]
|
16
|
+
@start_date = options[:start] ? Date.parse(options[:start]) : nil
|
17
|
+
@end_date = options[:end] ? Date.parse(options[:end]) : nil
|
16
18
|
@teams = TempestTime::Settings::Teams.new
|
17
19
|
end
|
18
20
|
|
@@ -24,7 +26,11 @@ module TempestTime
|
|
24
26
|
@users.push(@teams.members(@team)) if @team
|
25
27
|
abort('No users specified.') unless @users.any?
|
26
28
|
|
27
|
-
@
|
29
|
+
if @start_date.nil? || @end_date.nil?
|
30
|
+
@week = week_prompt('Please select the week to report.')
|
31
|
+
else
|
32
|
+
validate_date_input
|
33
|
+
end
|
28
34
|
|
29
35
|
with_spinner('Generating report...') do |spinner|
|
30
36
|
table = render_table
|
@@ -72,6 +78,10 @@ module TempestTime
|
|
72
78
|
@end_date ||= week_dates(@week).last
|
73
79
|
end
|
74
80
|
|
81
|
+
def validate_date_input
|
82
|
+
abort('Start date must come before end date.') unless start_date < end_date
|
83
|
+
end
|
84
|
+
|
75
85
|
def required_seconds
|
76
86
|
@required_seconds ||= TempoAPI::Requests::GetUserSchedule.new(
|
77
87
|
start_date: start_date,
|
@@ -13,7 +13,8 @@ module TempestTime
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def execute!
|
16
|
-
timer.
|
16
|
+
timer.exists? ? deleted_message : no_timer_message
|
17
|
+
timer.delete
|
17
18
|
end
|
18
19
|
|
19
20
|
private
|
@@ -21,11 +22,15 @@ module TempestTime
|
|
21
22
|
attr_reader :issue, :timer
|
22
23
|
|
23
24
|
def deleted_message
|
24
|
-
prompt.say(
|
25
|
+
prompt.say(
|
26
|
+
pastel.yellow(
|
27
|
+
"Timer #{issue} deleted at #{formatted_time_long(timer.runtime)}"
|
28
|
+
)
|
29
|
+
)
|
25
30
|
end
|
26
31
|
|
27
32
|
def no_timer_message
|
28
|
-
prompt.say(
|
33
|
+
prompt.say(pastel.red("Timer #{issue} does not exist!"))
|
29
34
|
end
|
30
35
|
end
|
31
36
|
end
|
@@ -33,9 +33,9 @@ module TempestTime
|
|
33
33
|
|
34
34
|
def action_prompt(timer)
|
35
35
|
if timer.running?
|
36
|
-
prompt.select('', %w(Pause Track))
|
36
|
+
prompt.select('', %w(Pause Track Delete))
|
37
37
|
else
|
38
|
-
prompt.select('', %w(Resume Track))
|
38
|
+
prompt.select('', %w(Resume Track Delete))
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -50,6 +50,9 @@ module TempestTime
|
|
50
50
|
when 'Track'
|
51
51
|
require_relative './track'
|
52
52
|
TempestTime::Commands::Timer::Track.new(issue).execute
|
53
|
+
when 'Delete'
|
54
|
+
require_relative './delete'
|
55
|
+
TempestTime::Commands::Timer::Delete.new(issue).execute
|
53
56
|
else
|
54
57
|
abort
|
55
58
|
end
|
@@ -18,6 +18,7 @@ module TempestTime
|
|
18
18
|
|
19
19
|
def execute!
|
20
20
|
dates
|
21
|
+
|
21
22
|
unless options[:autoconfirm]
|
22
23
|
confirm_prompt
|
23
24
|
end
|
@@ -31,13 +32,13 @@ module TempestTime
|
|
31
32
|
private
|
32
33
|
|
33
34
|
def track_time(time, options)
|
34
|
-
message = "Tracking #{formatted_time(time)} to #{options[
|
35
|
+
message = "Tracking #{formatted_time(time)} to #{options[:issue]}..."
|
35
36
|
with_success_fail_spinner(message) do
|
36
|
-
options[
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
options[:remaining] = if options[:remaining].nil?
|
38
|
+
remaining_estimate(options[:issue], time)
|
39
|
+
else
|
40
|
+
parsed_time(options[:remaining])
|
41
|
+
end
|
41
42
|
TempoAPI::Requests::CreateWorklog.new(time, options).send_request
|
42
43
|
end
|
43
44
|
end
|
@@ -71,7 +72,7 @@ module TempestTime
|
|
71
72
|
end
|
72
73
|
|
73
74
|
def billability(options)
|
74
|
-
options[
|
75
|
+
options[:billable] ? 'billed' : 'non-billed'
|
75
76
|
end
|
76
77
|
end
|
77
78
|
end
|
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: 1.2.
|
4
|
+
version: 1.2.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-
|
11
|
+
date: 2019-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -346,8 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
346
346
|
- !ruby/object:Gem::Version
|
347
347
|
version: '0'
|
348
348
|
requirements: []
|
349
|
-
|
350
|
-
rubygems_version: 2.5.1
|
349
|
+
rubygems_version: 3.0.2
|
351
350
|
signing_key:
|
352
351
|
specification_version: 4
|
353
352
|
summary: Smart CLI for Jira Cloud.
|