sheldon 6.0.1 → 6.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sheldon +6 -10
- data/lib/sheldon/sheldon.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe61cb42f008cdbe0ea4384f415214eb20a08f22
|
4
|
+
data.tar.gz: 87bfc05fb3a49fc4a5b23ddbab0ad332717d83df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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)
|
data/lib/sheldon/sheldon.rb
CHANGED