samg-timetrap 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/README.md +9 -2
  2. data/VERSION.yml +1 -1
  3. data/lib/timetrap/cli.rb +7 -0
  4. metadata +2 -2
data/README.md CHANGED
@@ -2,8 +2,10 @@ Timetrap
2
2
  ========
3
3
 
4
4
  Timetrap is a ruby port of Trevor Caira's Timebook, a small utility which aims
5
- to be a low-overhead way of tracking what you spend time on. Timetrap
6
- maintains its state in a sqlite3 database.
5
+ to be a low-overhead way of tracking what you spend time on. It contains
6
+ several enhancement over Timebook notably the ability to parse natural language
7
+ time strings. This makes commands such as ``t in --at "30 minutes ago"``
8
+ possible. Timetrap maintains its state in a sqlite3 database.
7
9
 
8
10
  To install:
9
11
 
@@ -155,3 +157,8 @@ Commands
155
157
 
156
158
  usage: ``t switch TIMESHEET``
157
159
 
160
+ **week**
161
+ Shortcut for display with start date set to monday of this week
162
+
163
+ usage: ``t week [--ids] [--end DATE] [--format FMT] [SHEET | all]``
164
+
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 0
2
+ :patch: 1
3
3
  :major: 1
4
4
  :minor: 0
data/lib/timetrap/cli.rb CHANGED
@@ -44,6 +44,8 @@ where COMMAND is one of:
44
44
  usage: t running
45
45
  * switch - switch to a new timesheet
46
46
  usage: t switch TIMESHEET
47
+ * week - shortcut for display with start date set to monday of this week
48
+ usage: t week [--ids] [--end DATE] [--format FMT] [SHEET | all]
47
49
 
48
50
  OTHER OPTIONS
49
51
  -h, --help Display this help
@@ -207,6 +209,11 @@ where COMMAND is one of:
207
209
  say Timetrap::Entry.filter(:end => nil).map{|e| " #{e.sheet}: #{e.note}"}.uniq.sort
208
210
  end
209
211
 
212
+ def week
213
+ args['-s'] = Date.today.wday == 1 ? Date.today.to_s : Date.parse(Chronic.parse(%q(last monday)).to_s).to_s
214
+ display
215
+ end
216
+
210
217
  private
211
218
 
212
219
  def unused_args
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: samg-timetrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Goldstein
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-28 00:00:00 -07:00
12
+ date: 2009-04-30 00:00:00 -07:00
13
13
  default_executable: t
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency