sheldon 6.2.0 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae77eea72d0cbd8122af494ca74a65b695239441e9404ec638264d177c3402e4
4
- data.tar.gz: d75771ef4eeefc50b7d7797d3a7e0acc9bade0b1e82d0f4c7b05868414339c61
3
+ metadata.gz: 7f3f30e785a3db0fe96994f24f64ad1d3e34411b76c15a36a50b1ca6fff77473
4
+ data.tar.gz: 9d7b0582af219591add29860ca898944645a559473997bf7a130ce6c252b58d0
5
5
  SHA512:
6
- metadata.gz: 8a23ca4c9ad09b76eeaba8b08bc080867dce4525a5ac6257efeb9455252686cbba41bdf6429110b25053ecb0c0c319f73e8c7c36be4969ce1498ea9c1172a446
7
- data.tar.gz: 1292f1dc3fd7929d64c216381204d3faaf73cc230246f944fe5e2b7c9ba45452b08630645b84aa4af781bfccd743210ffc10df390a84dd4578fd294a904d315f
6
+ metadata.gz: 8da95d55101672c571e2beef0b6dc56e792cd6f46de56b4ac882ec55675b4e0540d1432d04b2a0b97f5c838a246be4a510c3fb709dc3ef1b32a5110b9489d611
7
+ data.tar.gz: ddf86f7a1e12aa385324925748b987ec46c5f0928ffffef827789b69041a9b5d06c5c295c7faa7d4984e88ec375b79ed9d421558918f71daa3c029453041ca99
@@ -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
- raise DestinationNotEmptyException, "#{destination_path} already exists." if File.exist?(destination_path) && !opts[:overwrite]
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
- brain_path = brain_directory_for_cue(recall_cue)
59
- FileUtils.ln_s(get_content(brain_path), destination_path, force: opts[:overwrite])
60
- return true
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)
@@ -1,7 +1,7 @@
1
1
  require "fileutils"
2
2
 
3
3
  class Sheldon
4
- VERSION = "6.2.0".freeze
4
+ VERSION = "6.2.1".freeze
5
5
  attr_reader :brain, :builder
6
6
 
7
7
  def initialize(sheldon_data_dir)
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.0
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-19 00:00:00.000000000 Z
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
- rubyforge_project:
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