sheldon 6.0.0 → 6.0.1

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
  SHA1:
3
- metadata.gz: a180e427aaaa17ffda3f9e1b0ce027dae5b33cac
4
- data.tar.gz: 7e3781240108e33ffc6151395e8cde019dc54abd
3
+ metadata.gz: 13c533961af86e6dcde2706f1740f6400fe1038f
4
+ data.tar.gz: 79078990bb84e7a37e01428af94f7865826ed9d5
5
5
  SHA512:
6
- metadata.gz: aa7ef3e53ddb837b896b01c01db1c69fd176184915951368c698b110355aaacae40359e79106fc85df42e7fe84c6254339b27eb5f3c135fab656ec02f7e992dc
7
- data.tar.gz: d6f892726f5e7c35b750cd65ef6f16f0c1b0526dcf3ac0314912a14d5ca693bf36467e27777da988f81f60ba922da2a8b0e89d122fc8e4b57365eb8b29e6b4b8
6
+ metadata.gz: a0ea87310e6b47401817a26c01e6b6553796b7ba60af80870908ec04fa7055d0f1467f778a4ae36a8c871597efbe1037403fe60c6ed80d951873fb50276f8a78
7
+ data.tar.gz: 8e757adb6d7d250a1d74b414c5579a71026dbe70e466450bea78273a3e982b8a7c9f0b272db5a86b55a96dc429bcc64794388f322baa0587915bda5a56f6ccd6
data/README.md CHANGED
@@ -3,11 +3,11 @@
3
3
  [![Coverage Status](https://coveralls.io/repos/github/dvjones89/sheldon/badge.svg?branch=master)](https://coveralls.io/github/dvjones89/sheldon?branch=master)
4
4
  [![Gem Version](https://badge.fury.io/rb/sheldon.svg)](https://badge.fury.io/rb/sheldon)
5
5
 
6
- Designed with the obsessive developer in mind, Sheldon makes it easy for you to manage your .dotfiles and configs across all your OS X / linux devices.
6
+ Sheldon makes it easy for you to manage your .dotfiles and configs across all your OS X / linux devices.
7
7
 
8
8
  ### Installation:
9
9
  1) `gem install sheldon`
10
- 2) `sheldon setup path/to/data-directory` to tell Sheldon where your existing data directory resides, or otherwise where a new data directory should be created.
10
+ 2) `sheldon setup path/to/data/directory` to tell Sheldon where your existing data directory resides, or otherwise where a new data directory should be created.
11
11
  3) Sync your data directory across all your different hosts using your preferred method (git, rsync, Dropbox, Resilio Sync), so Sheldon's knowledge is available everywhere.
12
12
 
13
13
  ### How It Works
@@ -41,29 +41,11 @@ Recall git_config (Y/N): y
41
41
  Recall .zshrc (Y/N): y
42
42
  ```
43
43
 
44
- #### Build Bespoke Configs For Your Host (sheldon build)
45
- Sometimes copying an entire config file between all your machine is overkill. What if you only want a subset of your configuration? Sheldon can help.
46
-
47
- Split your ssh config into `config_work` and `config_personal`
48
- Use Sheldon `learn` and `recall` to make the appropriate `_config` files available on the appropriate hosts.
49
- Once the files are in the right place, use Sheldon `build` to create a single `config` file that can be easily sourced.
50
-
44
+ #### Open Your Configs In A Flash (sheldon open)
45
+ Want to quickly tweak that config file but can't remember where it resides on your system? No worries, Sheldon's got your back:
51
46
  ```shell
52
- cd ~/.ssh
53
-
54
- ls -l
55
- config_dev -> /Users/dave/sheldon/ssh_config_dev/config_dev
56
- config_personal -> /Users/dave/sheldon/ssh_config_personal/config_personal
57
-
58
- sheldon build ~/.ssh
59
- 💥 Sheldon💥 Built .ssh
60
-
61
- ls -l
62
- config_dev -> /Users/dave/sheldon/ssh_config_dev/config_dev
63
- config_personal -> /Users/dave/sheldon/ssh_config_personal/config_personal
64
- config
65
-
66
- source ~/.ssh/config
47
+ sheldon open git
48
+ # Your ~/.gitconfig will be opened in your $EDITOR
67
49
  ```
68
50
 
69
51
  ### Contributing
@@ -77,4 +59,4 @@ source ~/.ssh/config
77
59
  7. Create a new Pull Request
78
60
 
79
61
  ### License
80
- See LICENSE
62
+ See [LICENSE](https://github.com/dvjones89/sheldon/blob/master/LICENSE)
data/bin/sheldon CHANGED
@@ -58,7 +58,7 @@ module CLI
58
58
  with_exception_handling do
59
59
  memory_entry = sheldon.brain.memory.recall(recall_cue)
60
60
  filepath = add_home(memory_entry[:filepath])
61
- system("#{ENV['EDITOR']} '#{filepath}'")
61
+ system("#{editor} '#{filepath}'")
62
62
  end
63
63
  end
64
64
 
@@ -72,7 +72,7 @@ module CLI
72
72
  with_exception_handling { sheldon.recall(recall_cue) if answer.downcase == "y" }
73
73
  end
74
74
  else
75
- recall_cue = cue_picker("What would you like to recall?")
75
+ recall_cue ||= cue_picker("What would you like to recall?")
76
76
  with_exception_handling { sheldon.recall(recall_cue) }
77
77
  end
78
78
 
data/lib/sheldon/brain.rb CHANGED
@@ -45,9 +45,11 @@ class Brain
45
45
  entry = memory.recall(recall_cue)
46
46
  destination_path = add_home(entry[:filepath])
47
47
  destination_dir = File.dirname(destination_path)
48
+ raise DestinationNotEmptyException, "#{destination_path} already exists." if File.exist?(destination_path)
49
+
48
50
  FileUtils.mkdir_p(destination_dir) unless File.directory?(destination_dir)
49
51
  brain_path = brain_path_for_cue(recall_cue)
50
- FileUtils.ln_s(get_content(brain_path), destination_path, force: true)
52
+ FileUtils.ln_s(get_content(brain_path), destination_path)
51
53
  return true
52
54
  end
53
55
 
@@ -1,2 +1,5 @@
1
1
  class MissingDataDirectoryException < StandardError
2
2
  end
3
+
4
+ class DestinationNotEmptyException < StandardError
5
+ end
@@ -1,7 +1,7 @@
1
1
  require "fileutils"
2
2
 
3
3
  class Sheldon
4
- VERSION = "6.0.0".freeze
4
+ VERSION = "6.0.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.0.0
4
+ version: 6.0.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: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor