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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bee4c127b0d41d0f31cf49f9b3291c5948060eb44a8e9835720cb94ab9ffd123
4
- data.tar.gz: 7d8102ca79d54c07b6ade649135f5a545d6a6e2297564420e1cd762b18980b4d
3
+ metadata.gz: 3dc1c7b91082976a5cdf396f23be001fbe2c68956192529eb3003ef8ba3a83c8
4
+ data.tar.gz: f49897370dd1c92460846bce2fabf8188e161729e5fd323e9b04ce990474fa43
5
5
  SHA512:
6
- metadata.gz: 6db29dd83c233f730e47f8226292f305ae8c99c8f640846f271314ab3365c59e0ebbed337910fbf7b28971ccde1e5e645b1f8b19ea0e3cdfd368a2c1b34ec0e2
7
- data.tar.gz: c8d4feac6d657e579d0382e72331dd18a33b5a13e024c12baf67c7d7131c2acc6087e95ebceb53a0199cda97888e6e7976462bec2fd4c2992f70613b1c37c2cb
6
+ metadata.gz: 3ec5378757169311d48119c1d80e513698efc91436c92d9cb866535ebec93fc2d78fb3a1656614b2071869263d302869e09d6ecf7524707b67c48652a0129b41
7
+ data.tar.gz: 0cc9f938ff581e203cbc766d79d1c9413f7cea6e608962dac940291e63da9004bd8ba8faa5f1233ac712008996a5e187dc81d882c961c839d938dd52d4ba1b8d
@@ -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(options)
11
- @user = options[:user] || current_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', 'Set up Tempest with your credentials.'
12
- def list(*)
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(options).execute
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
- @options = options
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
- @options[:user]
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
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative '../../command'
4
4
  require_relative '../../models/timer'
5
+ require_relative './status'
5
6
 
6
7
  module TempestTime
7
8
  module Commands
@@ -8,7 +8,7 @@ module TempestTime
8
8
  class Timer
9
9
  class Status < TempestTime::Command
10
10
  def initialize(issue)
11
- @issue = issue
11
+ @issue = issue || automatic_issue
12
12
  @timer = TempestTime::Models::Timer.new(issue)
13
13
  end
14
14
 
@@ -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
- "How much time should be logged to #{issue}?",
30
- default: formatted_time_for_input(timer.runtime)
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
- parsed_time(time),
36
- [issue],
37
- 'message' => message,
38
- 'billable' => billable
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.'
@@ -23,7 +23,7 @@ module TempestTime
23
23
 
24
24
  def initialize(issue)
25
25
  ensure_tmp_dir
26
- @issue = issue || automatic_issue
26
+ @issue = issue
27
27
  end
28
28
 
29
29
  def start
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TempestTime
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
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.0
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-05 00:00:00.000000000 Z
11
+ date: 2019-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler