doing 1.0.78 → 1.0.79

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: 64076f13651c82428d05f490870a3a8a2507dc783cfaeebe7658538523aaef25
4
- data.tar.gz: 691df494543c3ff71911a4ca87135adba9504fb445d51180e9c5914372c5d35b
3
+ metadata.gz: 24a207b31d2f64fc81c00b1484f62a5ab2609ded162fc9733cb54463c652d63e
4
+ data.tar.gz: dfc767b0d8cec0229e9ad3823f5853d81c343261198c6638e364331920dc7989
5
5
  SHA512:
6
- metadata.gz: be005b1f54f3e170030f88a6df19567478985965b56bb50a842fe3d5c87d7afb750e165d4888da45466f3dba16205a94d1baf5cbfe723f0a18dffe960d944d00
7
- data.tar.gz: 48e5cbec09157db3c974b5d0c242c394884a77f47ce5cf4e009b7dedf47daccba581709aefb534266415884ab71fad03c0a4d22385e3abc9d3e33576f3aaad17
6
+ metadata.gz: 1f64972ed2d157a0b52afa882d257190d236ebb5805d0ff8049d3ab65ca92974a1cbe2e11ba2ee1ea9cd04b751bd4cc6874f409d442cdfb9347c37bacb6fc47c
7
+ data.tar.gz: 9d3432a35cd14d44474ef32e90df40943a2a9ed7eb7c232a2361816aba255b7ed39992dc7b4cfa000afb93abbe4cea3036c9eec244a2fe141f7dca70ce400095
data/README.md CHANGED
@@ -27,7 +27,7 @@ If there's something I want to look at later but doesn't need to be added to a t
27
27
 
28
28
  ## Installation
29
29
 
30
- The current version of `doing` is <!--VER-->1.0.76<!--END VER-->.
30
+ The current version of `doing` is <!--VER-->1.0.78<!--END VER-->.
31
31
 
32
32
  $ [sudo] gem install doing
33
33
 
@@ -619,12 +619,15 @@ Now you can run `doing import --type timing -s SECTION PATH`, where SECTION is t
619
619
 
620
620
  #### Interactive Usage
621
621
 
622
- If you have `fzf` installed (<https://github.com/junegunn/fzf>), you can use `doing select` to get a menu of all your items (or items in a given section) which can be searched with fuzzy matching. The menu allows multiple selections to be acted on directly.
622
+ FuzzyFileFinder (`fzf`) is included with doing (<https://github.com/junegunn/fzf>), and you can use `doing select` to get a menu of all your items (or items in a given section) which can be searched with fuzzy matching. The menu allows multiple selections to be acted on directly.
623
623
 
624
- To use the menu, type a search string or use the arrow keys to navigate up and down. Press tab on an entry you'd like to perform an action on. A marker will show up on the left indicating the entry is selected. Repeat the process and select as many entries as needed. When you hit Return, the selection will be passed back to doing. Use Control-A to select all visible entries.
624
+ To use the menu, type a search string or use the arrow keys to navigate up and down. Tip: searching is "fuzzy" by default, but you can start your search with a single quote (`'`) to force an exact match. Press tab on an entry you'd like to perform an action on. A marker will show up on the left indicating the entry is selected. Repeat the process and select as many entries as needed. When you hit Return, the selection will be passed back to doing. Use Control-A to select all visible entries.
625
625
 
626
626
  Doing can perform several functions with this menu. Not all of doing's features are available, but the core functionality you'd need is there, plus you can open the selected entries on one page in your text editor, make changes to them, and when you save and close the entries are updated accordingly. This allows editing of everything from timestamps to tags to notes.
627
627
 
628
+ If no actions are specified, an interactive menu of options will be
629
+ presented.
630
+
628
631
  Run `doing help select` for a list of options:
629
632
 
630
633
  -a, --archive - Archive selected items
@@ -634,7 +637,11 @@ Run `doing help select` for a list of options:
634
637
  -f, --finish - Add @done with current time to selected item(s)
635
638
  --flag - Add flag to selected item(s)
636
639
  -m, --move=SECTION - Move selected items to section (default: none)
640
+ -o, --output=FORMAT - Output format for export (doing|taskpaper|csv|html|json|template|timeline) (default: none)
641
+ -q, --query=QUERY - Initial search query for filtering (default: none)
642
+ -r, --remove - Reverse -c, -f, --flag, and -t (remove instead of adding)
637
643
  -s, --section=SECTION - Select from a specific section (default: none)
644
+ --save_to=FILE - Save selected entries to file using --output format (default: none)
638
645
  -t, --tag=TAG - Tag selected entries (default: none)
639
646
 
640
647
  For example, `doing select -d -a` would present the menu, and then mark selected entries as @done (with timestamp) and move them to the Archive section.
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.78'
2
+ VERSION = '1.0.79'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -823,7 +823,7 @@ class WWID
823
823
  out.join('')
824
824
  end
825
825
 
826
- res = `echo #{Shellwords.escape(options.join("\n"))}|#{fzf} -m --bind ctrl-a:select-all -q "#{opt[:query]}"`
826
+ res = `echo #{Shellwords.escape(options.join("\n"))}|#{fzf} --header="Arrows to navigate, tab to mark for selection, enter to perform action" --prompt="Select entries to act on> " -m --bind ctrl-a:select-all -q "#{opt[:query]}"`
827
827
  selected = []
828
828
  res.split(/\n/).each do |item|
829
829
  idx = item.match(/^(\d+)\)/)[1].to_i
@@ -835,7 +835,16 @@ class WWID
835
835
  return
836
836
  end
837
837
 
838
- unless opt[:delete] || opt[:flag] || opt[:finish] || opt[:cancel] || opt[:tag] || opt[:archive] || opt[:output] || opt[:save_to]
838
+ actions = %i[editor delete tag flag finish cancel tag archive output save_to]
839
+ has_action = false
840
+ actions.each do |a|
841
+ if opt[a]
842
+ has_action = true
843
+ break
844
+ end
845
+ end
846
+
847
+ unless has_action
839
848
  action = choose_from(
840
849
  [
841
850
  "add tag",
@@ -1199,19 +1208,24 @@ class WWID
1199
1208
  ## @param old_item (Item) The item to tag
1200
1209
  ## @param tag (string) The tag to remove
1201
1210
  ##
1202
- def untag_item(old_item, tag)
1211
+ def untag_item(old_item, tags)
1203
1212
  title = old_item['title'].dup
1204
-
1205
- if title =~ /@#{tag}/
1206
- title.chomp!
1207
- title.gsub!(/ +@#{tag}(\(.*?\))?/, '')
1208
- new_item = old_item.dup
1209
- new_item['title'] = title
1210
- update_item(old_item, new_item)
1211
- return new_item
1212
- else
1213
- @results.push(%(Item isn't tagged @#{tag}: "#{title}" in #{old_item['section']}))
1214
- return old_item
1213
+ if tags.is_a? ::String
1214
+ tags = tags.split(/ *, */).map {|t| t.strip.gsub(/\*/,'[^ (]*') }
1215
+ end
1216
+
1217
+ tags.each do |tag|
1218
+ if title =~ /@#{tag}/
1219
+ title.chomp!
1220
+ title.gsub!(/ +@#{tag}(\(.*?\))?/, '')
1221
+ new_item = old_item.dup
1222
+ new_item['title'] = title
1223
+ update_item(old_item, new_item)
1224
+ return new_item
1225
+ else
1226
+ @results.push(%(Item isn't tagged @#{tag}: "#{title}" in #{old_item['section']}))
1227
+ return old_item
1228
+ end
1215
1229
  end
1216
1230
  end
1217
1231
 
@@ -1222,23 +1236,29 @@ class WWID
1222
1236
  ## @param tag (string) The tag to apply
1223
1237
  ## @param date (Boolean) Include timestamp?
1224
1238
  ##
1225
- def tag_item(old_item, tag, remove: false, date: false)
1239
+ def tag_item(old_item, tags, remove: false, date: false)
1226
1240
  title = old_item['title'].dup
1241
+ if tags.is_a? ::String
1242
+ tags = tags.split(/ *, */).map(&:strip)
1243
+ end
1244
+
1227
1245
  done_date = Time.now
1228
- if title !~ /@#{tag}/
1229
- title.chomp!
1230
- if date
1231
- title += " @#{tag}(#{done_date.strftime('%F %R')})"
1246
+ tags.each do |tag|
1247
+ if title !~ /@#{tag}/
1248
+ title.chomp!
1249
+ if date
1250
+ title += " @#{tag}(#{done_date.strftime('%F %R')})"
1251
+ else
1252
+ title += " @#{tag}"
1253
+ end
1254
+ new_item = old_item.dup
1255
+ new_item['title'] = title
1256
+ update_item(old_item, new_item)
1257
+ return new_item
1232
1258
  else
1233
- title += " @#{tag}"
1259
+ @results.push(%(Item already @#{tag}: "#{title}" in #{old_item['section']}))
1260
+ return old_item
1234
1261
  end
1235
- new_item = old_item.dup
1236
- new_item['title'] = title
1237
- update_item(old_item, new_item)
1238
- return new_item
1239
- else
1240
- @results.push(%(Item already @#{tag}: "#{title}" in #{old_item['section']}))
1241
- return old_item
1242
1262
  end
1243
1263
  end
1244
1264
 
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.78
4
+ version: 1.0.79
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
@@ -168,6 +168,7 @@ files:
168
168
  - lib/doing/helpers.rb
169
169
  - lib/doing/version.rb
170
170
  - lib/doing/wwid.rb
171
+ - lib/helpers/fuzzyfilefinder
171
172
  - lib/templates/doing.css
172
173
  - lib/templates/doing.haml
173
174
  homepage: http://brettterpstra.com/project/doing/