doing 1.0.18 → 1.0.19

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: a196efa7539ea75803e860bb9f2085433f4810eedf380da90ecf3f73a0981049
4
- data.tar.gz: 620c726d10967fb0b7f8ad1256ae6709ec7eb475d1cca75f55941f3436686321
3
+ metadata.gz: d675f8d0e03a45a55e9be965c7e1dd5da2e1f6329bd313327c92234ec54f4b57
4
+ data.tar.gz: 591e84462f5a8a7d38b94f3daf6482c65d262306f246ffcb9d5125a794eb25bd
5
5
  SHA512:
6
- metadata.gz: 4ea8b06c7a10b05978785ad5cbc6cf61f898c221d433b863b8749a5c179620c2319196a171108081c24a8863b7cf9358f703e914c902d460fda2c4f86b56f753
7
- data.tar.gz: 8139559b029d38a8802e6b4bb8a9ab8b2e309dd940dac7bf08ad5761771f808d047737fe87e666e630f7d579de73f19cc989bc6e9e1d502366b4173ac3b9a1b8
6
+ metadata.gz: cd522f9ba33483143c8f792d1c4e20c4952a91b968859f8b8c1350fe4b80c063f4158f4301c670164a4fa8404f4c9a94b522f025716a1a0effcab85485e83b91
7
+ data.tar.gz: 79170973a2dd8b49d31ef3f6b576ab9bc9c34f135585b8f0aac074cb527f5a3da08310d1f6d7192ced81c3747f2289b9ce1065de6bbc2b31627093f209473e5a
data/README.md CHANGED
@@ -336,7 +336,9 @@ Any time you use one of the foreground colors it will reset the bold and backgro
336
336
  done - Add a completed item with @done(date). No argument finishes last entry.
337
337
  meanwhile - Finish any @meanwhile tasks and optionally create a new one
338
338
 
339
- The `doing now` command can accept `-s section_name` to send the new entry straight to a non-default section. It also accepts `--back AMOUNT` to let you specify a start date in the past using "natural language." For example, `doing now --back 25m ENTRY` or `doing now --back "yesterday 3:30pm" ENTRY`.
339
+ The `doing now` command can accept `-s section_name` to send the new entry straight to a non-default section. It also accepts `--back=AMOUNT` to let you specify a start date in the past using "natural language." For example, `doing now --back=25m ENTRY` or `doing now --back="yesterday 3:30pm" ENTRY`.
340
+
341
+ If you want to use `--back` with `doing done` but want the end time to be different than the start time, you can either use `--took` in addition, or just use `--took` on its own as it will backdate the start time such that the end time is now and the duration is equal to the value of the `--took` argument.
340
342
 
341
343
  You can finish the last unfinished task when starting a new one using `doing now` with the `-f` switch. It will look for the last task not marked `@done` and add the `@done` tag with the start time of the new task (either the current time or what you specified with `--back`).
342
344
 
@@ -488,7 +490,13 @@ __Fish:__ See the file [`doing.fish`](https://github.com/ttscoff/doing/blob/mast
488
490
 
489
491
  The LaunchBar action requires that `doing` be available in `/usr/local/bin/doing`. If it's not (because you're using RVM or similar), you'll need to symlink it there. Running the action with Return will show the latest 9 items from Currently, along with any time intervals recorded, and includes a submenu of Timers for each tag.
490
492
 
491
- {% download 117 %}
493
+ Pressing Spacebar and typing allows you to add a new entry to currently. You an also trigger a custom show command by typing "show [section/tag]" and hitting return.
494
+
495
+ Point of interest, the LaunchBar Action makes use of the `-o json` flag for outputting JSON to the action's script for parsing.
496
+
497
+ <!--{% download 117 %}-->
498
+
499
+ Download the Action at [brettterpstra.com](https://brettterpstra.com/projects/doing/)
492
500
 
493
501
  Evan Lovely has [created an Alfred workflow as well](http://www.evanlovely.com/blog/technology/alfred-for-terpstras-doing/).
494
502
 
@@ -528,10 +536,17 @@ Please try not to email me directly about GitHub projects.
528
536
 
529
537
  ### Developer notes
530
538
 
531
- I'll try to document some of the code structure as I flesh it out. I'm currently working on adding a CLI reporting structure and logging methods, as well as santizing and standardizing all the flags and switches for consistency. Feel free to [poke around](http://github.com/ttscoff/doing/), I'll try to add more comments in the future (and retroactively).
539
+ Feel free to [poke around](http://github.com/ttscoff/doing/), I'll try to add more comments in the future (and retroactively).
532
540
 
533
541
  ## Changelog
534
542
 
543
+ #### 1.0.19
544
+
545
+ - For `doing note -e` include the entry title so you know what you're adding a note to
546
+ - For any other command that allows `-e` include a comment noting that anything after the first line creates a note
547
+ - Ignore # comments when parsing editor results
548
+
549
+
535
550
  #### 1.0.18
536
551
 
537
552
  - Fix `undefined method [] for nil class` error in `doing view`
data/bin/doing CHANGED
@@ -145,8 +145,11 @@ command :note do |c|
145
145
  input = wwid.fork_editor(input)
146
146
  if input
147
147
  title, note = wwid.format_input(input)
148
- note.insert(0, title)
149
- wwid.note_last(section, note, true)
148
+ if note
149
+ wwid.note_last(section, note, true)
150
+ else
151
+ raise "No note content"
152
+ end
150
153
  else
151
154
  raise "No content, cancelled"
152
155
  end
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.18'
2
+ VERSION = '1.0.19'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -223,10 +223,11 @@ class WWID
223
223
  end
224
224
 
225
225
  def fork_editor(input="")
226
- tmpfile = Tempfile.new('doing')
226
+ tmpfile = Tempfile.new(['doing','.md'])
227
227
 
228
228
  File.open(tmpfile.path,'w+') do |f|
229
229
  f.puts input
230
+ f.puts "\n# The first line is the entry title, any lines after that are added as a note"
230
231
  end
231
232
 
232
233
  pid = Process.fork { system("$EDITOR #{tmpfile.path}") }
@@ -267,7 +268,7 @@ class WWID
267
268
  note.map! { |line|
268
269
  line.strip
269
270
  }.delete_if { |line|
270
- line =~ /^\s*$/
271
+ line =~ /^\s*$/ || line =~ /^#/
271
272
  }
272
273
 
273
274
  [title, note]
@@ -433,8 +434,8 @@ class WWID
433
434
  section = guess_section(section)
434
435
  if @content.has_key?(section)
435
436
  last_item = @content[section]['items'].dup.sort_by{|item| item['date'] }.reverse[0]
436
- p last_item
437
- return last_item['note']
437
+ $stderr.puts "Editing note for #{last_item['title']}"
438
+ return "#{last_item['title']}\n# EDIT BELOW THIS LINE ------------\n#{last_item['note'].map{|line| line.strip }.join("\n")}"
438
439
  else
439
440
  raise "Section #{section} not found"
440
441
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.18
4
+ version: 1.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-07 00:00:00.000000000 Z
11
+ date: 2020-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake