sheldon 0.2.6 → 0.2.7

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
  SHA1:
3
- metadata.gz: bc997c5b4f37ad9017e95676da13f93ccda540c2
4
- data.tar.gz: 3597991837046118327d7a54d29bac5c648755c5
3
+ metadata.gz: 3a362c2944967c5547fc8852394c16806721dd0a
4
+ data.tar.gz: 5b0c19f8e27bd0e339b799ff674a6ac8654bfe6f
5
5
  SHA512:
6
- metadata.gz: fdf2d411262be96f41d48f8c09d49e89214d5cc66adcbacdf6f4501e84e709d45145df515a687d43096857a619c774b5b776ad16024757129875d5aa8374ab43
7
- data.tar.gz: 9b20b0a6110eb0f7210314f00c80d26c2302d70c411bd2ceea67a994ce3c9bf250d1dc9aa2df2489eae49b4cf53431a10bd488ff032e967fdcc64f2d721ad95b
6
+ metadata.gz: 3c1fdec9e95e9bd92b3ff7713020a2ac529d4de9e94dab5d80de14d4cc7af23366c09e8b2b08a4d19cae55f2b16c76f2f86584fcce2a4c11e9fb4a3ef3dd5261
7
+ data.tar.gz: 3144792bd5606157f305e4be30465c8712b390c1f4023e1e44602c1fb93783a84457d220fa559303158ebb74c973d441c9dcb2c983dfa23813562ad2f52dbd77
data/README.md CHANGED
@@ -1,8 +1,16 @@
1
1
  # Sheldon
2
2
  [![Build Status](https://travis-ci.org/dvjones89/sheldon.svg?branch=master)](https://travis-ci.org/dvjones89/sheldon)
3
+ [![Gem Version](https://badge.fury.io/rb/sheldon.svg)](https://badge.fury.io/rb/sheldon)
4
+
3
5
 
4
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.
5
7
 
8
+ ### Installation:
9
+ 1) `gem install sheldon`
10
+
11
+ 2) Sync Sheldon's data directory (`~/sheldon` by default) across all of your machines.
12
+ You can override the default folder location by setting the`SHELDON_DATA_DIR` environment variable on each host.
13
+
6
14
  ### How It Works
7
15
  #### Add files/folders to Sheldon (sheldon learn)
8
16
  Teach Sheldon about new files or directories using the `learn` command:
@@ -62,11 +70,6 @@ config
62
70
  source ~/.ssh/config
63
71
  ```
64
72
 
65
- ### Installation:
66
- 1) `gem install Sheldon-<version>.gem`
67
-
68
- 2) Sync Sheldon's data directory (`~/sheldon` by default) across all of your machines. You can override the default folder location by setting the`SHELDON_DATA_DIR` environment variable on each host.
69
-
70
73
  ### Isn't This Just Homesick?
71
74
  Yes, yes it is. Unfortunately, I'd written 90% of Sheldon before I discovered the awesome [homesick](https://github.com/technicalpickles/homesick) so I decided to keep going.
72
75
  Sheldon's `build` command is (as far as I know) unique to Sheldon and will perhaps prove useful to those who chunk their configs.
data/bin/sheldon CHANGED
@@ -6,6 +6,8 @@ module CLI
6
6
  class Sheldon < Thor
7
7
  map link: :recall
8
8
  map ls: :list
9
+ map "-v" => :version
10
+ map "--version" => :version
9
11
 
10
12
  desc "build path", "Tell Sheldon to build all config_ files in a directory to single master config"
11
13
  def build(rel_path_to_target)
@@ -61,7 +63,12 @@ module CLI
61
63
  end
62
64
 
63
65
  def sheldon
64
- @sheldon ||= ::Sheldon.new(sheldon_data_dir)
66
+ begin
67
+ @sheldon ||= ::Sheldon.new(sheldon_data_dir)
68
+ rescue MissingDataDirectoryException
69
+ announce "The data directory (#{sheldon_data_dir}) doesn't exist. Please create the directory or set an alternative using the $SHELDON_DATA_DIR environment variable."
70
+ exit
71
+ end
65
72
  end
66
73
 
67
74
  def sheldon_data_dir
data/lib/sheldon.rb CHANGED
@@ -3,5 +3,6 @@ require_relative "sheldon/builder"
3
3
  require_relative "sheldon/helpers"
4
4
  require_relative "sheldon/memory"
5
5
  require_relative "sheldon/sheldon"
6
+ require_relative "sheldon/exceptions"
6
7
 
7
8
  include Helpers
@@ -0,0 +1,2 @@
1
+ class MissingDataDirectoryException < StandardError
2
+ end
@@ -1,11 +1,11 @@
1
1
  require "fileutils"
2
2
 
3
3
  class Sheldon
4
- VERSION = "0.2.6".freeze
4
+ VERSION = "0.2.7".freeze
5
5
  attr_reader :brain, :builder
6
6
 
7
7
  def initialize(sheldon_data_dir, opts = {})
8
- raise "Directory #{sheldon_data_dir} does not exist" unless Dir.exists?(sheldon_data_dir)
8
+ raise MissingDataDirectoryException unless Dir.exists?(sheldon_data_dir)
9
9
  @brain = opts[:brain] || Brain.new(sheldon_data_dir)
10
10
  @builder = opts[:builder] || Builder.new
11
11
  end
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: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Jones
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-31 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -79,6 +79,7 @@ files:
79
79
  - lib/sheldon.rb
80
80
  - lib/sheldon/brain.rb
81
81
  - lib/sheldon/builder.rb
82
+ - lib/sheldon/exceptions.rb
82
83
  - lib/sheldon/helpers.rb
83
84
  - lib/sheldon/memory.rb
84
85
  - lib/sheldon/sheldon.rb