doing 1.0.79 → 1.0.80

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: 24a207b31d2f64fc81c00b1484f62a5ab2609ded162fc9733cb54463c652d63e
4
- data.tar.gz: dfc767b0d8cec0229e9ad3823f5853d81c343261198c6638e364331920dc7989
3
+ metadata.gz: 83c61397f2a1827dbe04f16255c1739c8d6a194b636afa4b1181437ffaca2ee8
4
+ data.tar.gz: b5da9fcae50fb7c90ba70a4b3d28948f551945c92170559f8bb693cda921894b
5
5
  SHA512:
6
- metadata.gz: 1f64972ed2d157a0b52afa882d257190d236ebb5805d0ff8049d3ab65ca92974a1cbe2e11ba2ee1ea9cd04b751bd4cc6874f409d442cdfb9347c37bacb6fc47c
7
- data.tar.gz: 9d3432a35cd14d44474ef32e90df40943a2a9ed7eb7c232a2361816aba255b7ed39992dc7b4cfa000afb93abbe4cea3036c9eec244a2fe141f7dca70ce400095
6
+ metadata.gz: 181eb1fa0f18e0f4c7678e48b2ae8daf07a85e88842accdf3de7c522dbc022c175067e0226d9faa21e493a654175c80595df1853d97027d6708884cbe24f82e6
7
+ data.tar.gz: a472b2013051b3525af41577ea0020b5f43e720e2b5d8598eb07b229555310dadd7a1b2cc0a106763def82f2b1920a9acf41f9ac07d077f35543b0b90ed2a631
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.78<!--END VER-->.
30
+ The current version of `doing` is <!--VER-->1.0.79<!--END VER-->.
31
31
 
32
32
  $ [sudo] gem install doing
33
33
 
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.79'
2
+ VERSION = '1.0.80'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -772,15 +772,11 @@ class WWID
772
772
  ## @return (String) The selected option
773
773
  ##
774
774
  def choose_from(options, prompt)
775
- puts prompt
776
- options.each_with_index do |section, i|
777
- puts format('% 3d: %s', i + 1, section)
778
- end
779
- print "#{colors['green']}> #{colors['default']}"
780
- num = STDIN.gets
781
- return false if num =~ /^[a-z ]*$/i
775
+ fzf = File.join(File.dirname(__FILE__), '../helpers/fuzzyfilefinder')
776
+ res = `echo #{Shellwords.escape(options.join("\n"))}|#{fzf} --prompt "#{prompt}"`
777
+ return false if res.strip.size.zero?
782
778
 
783
- options[num.to_i - 1]
779
+ res
784
780
  end
785
781
 
786
782
  ##
@@ -847,32 +843,32 @@ class WWID
847
843
  unless has_action
848
844
  action = choose_from(
849
845
  [
850
- "add tag",
851
- "remove tag",
852
- "archive",
853
- "cancel",
854
- "delete",
855
- "edit",
856
- "finish",
857
- "flag",
858
- "move",
859
- "output format"
846
+ 'add tag',
847
+ 'remove tag',
848
+ 'archive',
849
+ 'cancel',
850
+ 'delete',
851
+ 'edit',
852
+ 'finish',
853
+ 'flag',
854
+ 'move',
855
+ 'output format'
860
856
  ],
861
- 'What do you want to do with the selected items?')
857
+ 'What do you want to do with the selected items? > ')
862
858
  case action
863
859
  when /(add|remove) tag/
864
- print "Enter tag: "
860
+ print 'Enter tag: '
865
861
  tag = STDIN.gets
866
862
  return if tag =~ /^ *$/
867
863
  opt[:tag] = tag.strip
868
864
  opt[:remove] = true if action =~ /remove tag/
869
865
  when /output format/
870
- output_format = choose_from(%w[doing taskpaper json timeline html csv], 'Which output format?')
866
+ output_format = choose_from(%w[doing taskpaper json timeline html csv], 'Which output format? > ')
871
867
  return if tag =~ /^ *$/
872
868
  opt[:output] = output_format.strip
873
- res = yn("Save to file?", default_response: 'n')
869
+ res = yn('Save to file?', default_response: 'n')
874
870
  if res
875
- print "File path/name: "
871
+ print 'File path/name: '
876
872
  filename = STDIN.gets.strip
877
873
  return if filename.empty?
878
874
  opt[:save_to] = filename
@@ -1507,14 +1503,7 @@ class WWID
1507
1503
  ## @return (String) The selected section name
1508
1504
  ##
1509
1505
  def choose_section
1510
- sections.each_with_index do |section, i|
1511
- puts format('% 3d: %s', i + 1, section)
1512
- end
1513
- print "#{colors['green']}> #{colors['default']}"
1514
- num = STDIN.gets
1515
- return false if num =~ /^[a-z ]*$/i
1516
-
1517
- sections[num.to_i - 1]
1506
+ choose_from(sections, 'Choose a section > ').strip
1518
1507
  end
1519
1508
 
1520
1509
  ##
@@ -1532,14 +1521,7 @@ class WWID
1532
1521
  ## @return (String) The selected view name
1533
1522
  ##
1534
1523
  def choose_view
1535
- views.each_with_index do |view, i|
1536
- puts format('% 3d: %s', i + 1, view)
1537
- end
1538
- print '> '
1539
- num = STDIN.gets
1540
- return false if num =~ /^[a-z ]*$/i
1541
-
1542
- views[num.to_i - 1]
1524
+ choose_from(views, 'Choose a view > ').strip
1543
1525
  end
1544
1526
 
1545
1527
  ##
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.79
4
+ version: 1.0.80
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra