dotify 0.6.4 → 0.6.5
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.
- data/README.md +15 -0
- data/lib/dotify/config.rb +7 -1
- data/lib/dotify/version.rb +1 -1
- data/spec/dotify/config_spec.rb +4 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -53,6 +53,20 @@ After you have setup Dotify, you can add files one by one if you did not add the
|
|
53
53
|
$ dotify link .vimrc
|
54
54
|
linked /Users/computer-user/.vimrc
|
55
55
|
|
56
|
+
## What files are you managing?
|
57
|
+
|
58
|
+
No one likes to go and look for the symlinks of their dotfiles manually. Just check to see which files are being managed by Dotify by running `dotify list`.
|
59
|
+
|
60
|
+
$ dotify list
|
61
|
+
Dotify is managing 13 files:
|
62
|
+
|
63
|
+
* .bash_profile
|
64
|
+
* .dotrc
|
65
|
+
* .gemrc
|
66
|
+
* .gitconfig
|
67
|
+
* .gitignore_global
|
68
|
+
...
|
69
|
+
|
56
70
|
## Unlink the chains...
|
57
71
|
|
58
72
|
Don't want any of the dotfiles anymore? Or want to drop one? Well, I'm not one to question. Go ahead and move them back into the home directory.
|
@@ -130,6 +144,7 @@ This tool is powered by the amazing library, [Thor](http://whatisthor.com/). You
|
|
130
144
|
dotify help [TASK] # Describe available tasks or one specific task
|
131
145
|
dotify install # Install files from your home directory into Dotify
|
132
146
|
dotify link [[FILENAME]] # Link up one or all of your dotfiles (FILENAME is optional)
|
147
|
+
dotify list # List the installed dotfiles
|
133
148
|
dotify save # Save Dotify files and push to Github.
|
134
149
|
dotify setup # Setup your system for Dotify to manage your dotfiles
|
135
150
|
dotify unlink [[FILENAME]] # Unlink one or all of your dotfiles (FILENAME is optional)
|
data/lib/dotify/config.rb
CHANGED
@@ -44,7 +44,13 @@ module Dotify
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def retrieve
|
47
|
-
@hash
|
47
|
+
return @hash if @hash.class == Hash
|
48
|
+
if File.exists?(file)
|
49
|
+
loaded = YAML.load_file(file)
|
50
|
+
@hash = loaded == false ? {} : loaded
|
51
|
+
else
|
52
|
+
@hash = {}
|
53
|
+
end
|
48
54
|
symbolize_keys! @hash
|
49
55
|
rescue TypeError
|
50
56
|
{}
|
data/lib/dotify/version.rb
CHANGED
data/spec/dotify/config_spec.rb
CHANGED
@@ -27,6 +27,10 @@ module Dotify
|
|
27
27
|
YAML.stub(:load_file).and_return({ 'test' => 'example' })
|
28
28
|
Config.retrieve.should == { :test => 'example' }
|
29
29
|
end
|
30
|
+
it "should return an empty hash if YAML#load_file returns false (commented out config in .dotrc)" do
|
31
|
+
YAML.stub(:load_file).with(Config.file).and_return false
|
32
|
+
Config.retrieve.should == {}
|
33
|
+
end
|
30
34
|
it "should only try to set config from the config file once" do
|
31
35
|
YAML.should_receive(:load_file).with(Config.file).once.and_return({ 'test' => 'example' })
|
32
36
|
5.times { Config.retrieve }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|