sheldon 6.2.0 → 6.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sheldon/brain.rb +16 -4
- data/lib/sheldon/sheldon.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f3f30e785a3db0fe96994f24f64ad1d3e34411b76c15a36a50b1ca6fff77473
|
4
|
+
data.tar.gz: 9d7b0582af219591add29860ca898944645a559473997bf7a130ce6c252b58d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8da95d55101672c571e2beef0b6dc56e792cd6f46de56b4ac882ec55675b4e0540d1432d04b2a0b97f5c838a246be4a510c3fb709dc3ef1b32a5110b9489d611
|
7
|
+
data.tar.gz: ddf86f7a1e12aa385324925748b987ec46c5f0928ffffef827789b69041a9b5d06c5c295c7faa7d4984e88ec375b79ed9d421558918f71daa3c029453041ca99
|
data/lib/sheldon/brain.rb
CHANGED
@@ -48,16 +48,28 @@ class Brain
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def recall(recall_cue, opts={})
|
51
|
+
# Compute the absolute paths for recall
|
52
|
+
brain_path = brain_directory_for_cue(recall_cue)
|
51
53
|
entry = memory.recall(recall_cue)
|
52
54
|
destination_path = add_home(entry[:filepath])
|
53
55
|
destination_dir = File.dirname(destination_path)
|
54
56
|
|
55
|
-
|
57
|
+
# Handle the destination file / directory already existing on the filesystem
|
58
|
+
if File.exist?(destination_path)
|
59
|
+
if opts[:overwrite]
|
60
|
+
FileUtils.remove_dir(destination_path) # this (badly named) method deletes both files and folders
|
61
|
+
else
|
62
|
+
raise DestinationNotEmptyException, "#{destination_path} already exists."
|
63
|
+
end
|
64
|
+
end
|
56
65
|
|
66
|
+
# Create the destination directory if required
|
57
67
|
FileUtils.mkdir_p(destination_dir) unless File.directory?(destination_dir)
|
58
|
-
|
59
|
-
|
60
|
-
|
68
|
+
|
69
|
+
# Create the symbolic link between sheldon's brain and the destination
|
70
|
+
FileUtils.ln_s(get_content(brain_path), destination_path)
|
71
|
+
|
72
|
+
return recalled?(recall_cue)
|
61
73
|
end
|
62
74
|
|
63
75
|
def recalled?(recall_cue)
|
data/lib/sheldon/sheldon.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sheldon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.
|
4
|
+
version: 6.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Jones
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -116,8 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
|
-
|
120
|
-
rubygems_version: 2.7.6
|
119
|
+
rubygems_version: 3.0.3
|
121
120
|
signing_key:
|
122
121
|
specification_version: 4
|
123
122
|
summary: Another config and dotfile manager for unix environments
|