myworklog 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/worklog_cli.rb +5 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6bb114a4f85ad31f76ed6a16de66e1cf964511578319618098b97b88583cb0f2
4
- data.tar.gz: c3afe25497699be6b76de511a9bd0f53c3c51f2da93139b782e97a94e79cecc7
3
+ metadata.gz: 42d37f3cfd48fb7dd15e989b814f76f6617abb1ae2f273af94c9fba0d7e752f8
4
+ data.tar.gz: 1fd15183fb9a7f391c37414dac5bc34d65a1f8fcf0021b52c4b56286f99f63dd
5
5
  SHA512:
6
- metadata.gz: 4e7cdcd4a2b4a6f349f2f291d9c2c77a4ca07726416cb50165b318a5defdad9c8abee33d2b657963b07a731cbc1ad1db7021804f9405bdf05cdf465021f719dc
7
- data.tar.gz: 2b19a010e995da4e392939d8481a6ac173f6cc6903097b0d42b73b99e1e2635b907021028452ca7a3c33af799792efad0a1803fdc1a5e37f10b3763a3981983d
6
+ metadata.gz: 11608be11f9dbad29af5bd6f8210102fecac722c7bb507c4f8f361edf6c8360b3bb0dbe9730d7bc6befb4375df72c7da8ab6b4a0e784e0d0809e73b22e2abf2b
7
+ data.tar.gz: 8cccbf75521a73924aaa347871b19b3c5e9eff01ce6e962dc9928499188430669e50f576950dee644db73f35b751ed2624b2041b49472fc1d3a8d44b8215590d
data/lib/worklog_cli.rb CHANGED
@@ -5,10 +5,11 @@ require_relative 'work_log_controller'
5
5
  DATE_FORMAT = 'DD/MM/YYYY'
6
6
 
7
7
  class WorkLogCli < Thor
8
- desc 'add [DATE] [DESCRIPTION]', "adds a new work log. Use 'today' as DATE for current date or 'yesterday'. Date format #{DATE_FORMAT}"
9
-
10
- def add(date, description)
8
+ desc 'add [DESCRIPTION]', "Adds a new work log with today's date as default. Use -d flag to specify a different date (e.g. myworklog add -d 10/10/2010 'I worked'). Date format #{DATE_FORMAT}"
9
+ options :d => :string
10
+ def add(description)
11
11
  begin
12
+ date = options[:d] ? options[:d] : 'today'
12
13
  WorkLogController.new.add_work_log(date, description)
13
14
  rescue ArgumentError => msg
14
15
  puts msg
@@ -27,7 +28,7 @@ class WorkLogCli < Thor
27
28
  print(WorkLogController.new.list_all)
28
29
  end
29
30
 
30
- desc 'delete [ID]', 'Deletes the work log by ID. Use list command before to retrieve the ID'
31
+ desc 'delete [ID]', 'Deletes the work log by ID. You can use the `list` command to retrieve the ID'
31
32
 
32
33
  def delete(id)
33
34
  begin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myworklog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gyowanny Queiroz