sheldon 6.0.1 → 6.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/sheldon +6 -10
  3. data/lib/sheldon/sheldon.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13c533961af86e6dcde2706f1740f6400fe1038f
4
- data.tar.gz: 79078990bb84e7a37e01428af94f7865826ed9d5
3
+ metadata.gz: fe61cb42f008cdbe0ea4384f415214eb20a08f22
4
+ data.tar.gz: 87bfc05fb3a49fc4a5b23ddbab0ad332717d83df
5
5
  SHA512:
6
- metadata.gz: a0ea87310e6b47401817a26c01e6b6553796b7ba60af80870908ec04fa7055d0f1467f778a4ae36a8c871597efbe1037403fe60c6ed80d951873fb50276f8a78
7
- data.tar.gz: 8e757adb6d7d250a1d74b414c5579a71026dbe70e466450bea78273a3e982b8a7c9f0b272db5a86b55a96dc429bcc64794388f322baa0587915bda5a56f6ccd6
6
+ metadata.gz: c98cb280a893571e19f74bae7d8a02a5875f46c473aede3f9337a3b5c3ac1b51efb2300dda5277ab269ff3436185d5c52d7c1c56736946a22b6a85029156deda
7
+ data.tar.gz: 81d2b925351f51422563397bb0ee20fd71b3200386a7d271e6dc8d62f77663d83cb1c407e9a248ad8d847997e470634df53046e8d6836f4ca6833388e295dab1
data/bin/sheldon CHANGED
@@ -16,11 +16,7 @@ module CLI
16
16
  def build(rel_path_to_target)
17
17
  abs_build_path = File.expand_path(rel_path_to_target)
18
18
  with_exception_handling do
19
- if sheldon.build(abs_build_path)
20
- announce("Built #{File.basename(rel_path_to_target)}")
21
- else
22
- prompt.error("Could not find any config_ files at #{abs_build_path}")
23
- end
19
+ announce("Built #{File.basename(rel_path_to_target)}") if sheldon.build(abs_build_path)
24
20
  end
25
21
  end
26
22
 
@@ -51,11 +47,11 @@ module CLI
51
47
  def open(recall_cue=nil)
52
48
  editor = ENV['EDITOR']
53
49
  error_and_exit("Your system does not define a default editor. Please set $EDITOR and try again.") if editor.nil?
54
-
55
- recall_cue ||= cue_picker("What would you like to open?")
56
- error_and_exit("#{recall_cue} has not been recalled on this computer. Use `sheldon recall #{recall_cue}` and then try again.") unless sheldon.recalled?(recall_cue)
50
+ cue_options = sheldon.list_cues.select{|cue| sheldon.recalled?(cue)}
51
+ recall_cue ||= cue_picker("What would you like to open?", cue_options)
57
52
 
58
53
  with_exception_handling do
54
+ error_and_exit("#{recall_cue} has not been recalled on this computer. Use `sheldon recall #{recall_cue}` and then try again.") unless sheldon.recalled?(recall_cue)
59
55
  memory_entry = sheldon.brain.memory.recall(recall_cue)
60
56
  filepath = add_home(memory_entry[:filepath])
61
57
  system("#{editor} '#{filepath}'")
@@ -118,8 +114,8 @@ module CLI
118
114
  @prompt ||= TTY::Prompt.new(interrupt: :exit)
119
115
  end
120
116
 
121
- def cue_picker(message)
122
- prompt.select(message, sheldon.list_cues, per_page: 20, filter: true)
117
+ def cue_picker(message, options=sheldon.list_cues)
118
+ prompt.select(message, options, per_page: 20, filter: true)
123
119
  end
124
120
 
125
121
  def read_from_dotfile(key)
@@ -1,7 +1,7 @@
1
1
  require "fileutils"
2
2
 
3
3
  class Sheldon
4
- VERSION = "6.0.1".freeze
4
+ VERSION = "6.0.2".freeze
5
5
  attr_reader :brain, :builder
6
6
 
7
7
  def initialize(sheldon_data_dir)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sheldon
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Jones