dotman 0.0.3.7 → 0.0.3.8

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ea42429b86a3cbc3b8a9ffe0a41ec9995cfaee61
4
+ data.tar.gz: f1daf62110ae91f79e967e11a8c7325a2bd3db80
5
+ SHA512:
6
+ metadata.gz: 58facb08d299ab8241d68a1e572981e72be9131f0082613597d53836041abbbf0553d7ebbf01afb220e686d4b1e9a2acfaa072637a804f582722a956fbf89cb9
7
+ data.tar.gz: b4e5bde32eb68b8d2882fc13e5f41d6cb2d5fbef18cb35ee979a058ba5e6891f20671cdf669d5a0007c4e2c9b0d710f98583db34d76499c28e3b9d554cdd3142
data/README.md CHANGED
@@ -53,6 +53,11 @@ To create a new dotfiles directory with all current dotfiles located in the HOME
53
53
 
54
54
  dot collect
55
55
 
56
+ ### After Clone Hook
57
+
58
+ If you would like to execute a script after cloning down your dotfiles;
59
+ Add the script as an executable file named `.dotman.after_clone` in the root of your dotfiles
60
+
56
61
  ## Contributing
57
62
 
58
63
  1. Fork it
@@ -10,3 +10,4 @@ require "dotman/dotfile_collection"
10
10
  require "dotman/user"
11
11
  require "dotman/collect"
12
12
  require "dotman/notification"
13
+ require "dotman/after_clone"
@@ -0,0 +1,10 @@
1
+ module Dotman
2
+ class AfterClone
3
+ def self.run(after_clone_path)
4
+ full_path = File.join(after_clone_path, '.dotman.after_clone')
5
+ if File.exist?(full_path)
6
+ system full_path
7
+ end
8
+ end
9
+ end
10
+ end
@@ -25,6 +25,7 @@ module Dotman
25
25
  else
26
26
  system "git clone #{git_location} #{dotfile_location}"
27
27
  Dotman::DotfileCollection.new_configuration(folder_name(git_location), alias_name)
28
+ Dotman::AfterClone.run(dotfile_location)
28
29
  end
29
30
  end
30
31
  end
@@ -1,3 +1,3 @@
1
1
  module Dotman
2
- VERSION = "0.0.3.7"
2
+ VERSION = "0.0.3.8"
3
3
  end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+ describe Dotman::AfterClone do
3
+ let (:git_dotfile_repo_path) { "git@github.com:Timbinous/dotfiles.git" }
4
+ let(:dotman_after_clone) { }
5
+ before :each do
6
+ Dotman::Git.clone_repository(git_dotfile_repo_path, 'tim')
7
+ end
8
+
9
+ describe ".run" do
10
+ context "when .dotman.after_clone file exists" do
11
+ it "executes the script" do
12
+ Dotman::Git.clone_repository(git_dotfile_repo_path, 'tim')
13
+ FileUtils.touch(File.join(timbinous_dotfiles, '.dotman.after_clone'))
14
+ Dotman::AfterClone.should_receive(:system).with(File.join(timbinous_dotfiles, '.dotman.after_clone'))
15
+ Dotman::AfterClone.run(timbinous_dotfiles)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  describe Dotman::Base do
3
3
 
4
4
  describe ".ensure_dotman_folder_exists" do
5
- context "when `$HOME.dotman/` does not exist" do
5
+ context "when `$HOME/dotman/` does not exist" do
6
6
  it "creates the dotman directory" do
7
7
  File.stub(:directory?).and_return(false)
8
8
  FileUtils.should_receive(:mkdir).with("#{ENV['HOME']}/.dotman")
@@ -10,7 +10,7 @@ describe Dotman::Base do
10
10
  end
11
11
  end
12
12
 
13
- context "when $HOME.dotman/ exists" do
13
+ context "when $HOME/dotman/ exists" do
14
14
  it "does nothing" do
15
15
  File.stub(:directory?).and_return(true)
16
16
  FileUtils.should_not_receive(:mkdir)
@@ -18,4 +18,40 @@ describe Dotman::Base do
18
18
  end
19
19
  end
20
20
  end
21
+
22
+ describe ".ensure_default_folder_exists" do
23
+ context "when `$HOME/default/` does not exist" do
24
+ it "creates the dotman directory" do
25
+ File.stub(:directory?).and_return(false)
26
+ FileUtils.should_receive(:mkdir_p).with("#{ENV['HOME']}/.dotman/default")
27
+ Dotman::Base.ensure_default_folder_exists
28
+ end
29
+ end
30
+
31
+ context "when $HOME/default/ exists" do
32
+ it "does nothing" do
33
+ File.stub(:directory?).and_return(true)
34
+ FileUtils.should_not_receive(:mkdir)
35
+ Dotman::Base.ensure_default_folder_exists
36
+ end
37
+ end
38
+ end
39
+
40
+ describe ".ensure_current_dotman_file_exists" do
41
+ context "when current dotman file does not exist" do
42
+ it "creates the file" do
43
+ File.stub(:exist?).and_return(false)
44
+ File.should_receive(:open)
45
+ Dotman::Base.ensure_current_dotman_file_exists
46
+ end
47
+ end
48
+
49
+ context "when current dotman file exists" do
50
+ it "does nothing" do
51
+ File.stub(:exist?).and_return(true)
52
+ File.should_not_receive(:open)
53
+ Dotman::Base.ensure_current_dotman_file_exists
54
+ end
55
+ end
56
+ end
21
57
  end
@@ -1,20 +1,21 @@
1
1
  require 'spec_helper'
2
2
  describe Dotman::Base do
3
- context "when .dotman folder doesn't exist in the home directory" do
3
+ describe ".ensure_dotman_folder_exists" do
4
4
  before :all do
5
5
  FileUtils.rm_rf("#{ENV['HOME']}/.dotman")
6
6
  end
7
7
 
8
- it "creates a new folder" do
9
- File.directory?("#{ENV['HOME']}/.dotman").should == false
10
- Dotman::Base.ensure_dotman_folder_exists
11
- File.directory?("#{ENV['HOME']}/.dotman").should == true
8
+ context "when .dotman folder doesn't exist in the home directory" do
9
+
10
+ it "creates a new folder" do
11
+ File.directory?("#{ENV['HOME']}/.dotman").should == false
12
+ Dotman::Base.ensure_dotman_folder_exists
13
+ File.directory?("#{ENV['HOME']}/.dotman").should == true
14
+ end
12
15
  end
13
16
 
14
17
  after :each do
15
18
  FileUtils.rm_rf("#{ENV['HOME']}/.dotman")
16
19
  end
17
-
18
20
  end
19
-
20
21
  end
@@ -17,6 +17,10 @@ def create_timbinous_dotfiles
17
17
  FileUtils.touch(File.join(timbinous_path, '.tim.zsh-theme'))
18
18
  end
19
19
 
20
+ def timbinous_dotfiles
21
+ "#{ENV['HOME']}/.dotman/Timbinous_dotfiles"
22
+ end
23
+
20
24
  RSpec.configure do |config|
21
25
 
22
26
  config.include FakeFS::SpecHelpers
metadata CHANGED
@@ -1,90 +1,79 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: dotman
3
- version: !ruby/object:Gem::Version
4
- hash: 77
5
- prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 3
10
- - 7
11
- version: 0.0.3.7
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3.8
12
5
  platform: ruby
13
- authors:
6
+ authors:
14
7
  - Tim
15
8
  autorequire:
16
9
  bindir: bin
17
10
  cert_chain: []
18
-
19
- date: 2013-06-16 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
- none: false
24
- requirements:
25
- - - ~>
26
- - !ruby/object:Gem::Version
27
- hash: 9
28
- segments:
29
- - 1
30
- - 3
31
- version: "1.3"
11
+ date: 2013-06-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
32
14
  name: bundler
33
- prerelease: false
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
34
20
  type: :development
35
- requirement: *id001
36
- - !ruby/object:Gem::Dependency
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
46
- name: rake
47
21
  prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
48
34
  type: :development
49
- requirement: *id002
50
- - !ruby/object:Gem::Dependency
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
60
- name: rspec
61
35
  prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
62
48
  type: :development
63
- requirement: *id003
64
- - !ruby/object:Gem::Dependency
65
- version_requirements: &id004 !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- hash: 3
71
- segments:
72
- - 0
73
- version: "0"
74
- name: fakefs
75
49
  prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: fakefs
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
76
62
  type: :development
77
- requirement: *id004
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
78
69
  description: Dotfiles Manager
79
- email:
70
+ email:
80
71
  - timbinous@gmail.com
81
- executables:
72
+ executables:
82
73
  - dot
83
74
  extensions: []
84
-
85
75
  extra_rdoc_files: []
86
-
87
- files:
76
+ files:
88
77
  - .gitignore
89
78
  - .rvmrc
90
79
  - .travis.yml
@@ -95,6 +84,7 @@ files:
95
84
  - bin/dot
96
85
  - dotman.gemspec
97
86
  - lib/dotman.rb
87
+ - lib/dotman/after_clone.rb
98
88
  - lib/dotman/base.rb
99
89
  - lib/dotman/collect.rb
100
90
  - lib/dotman/dotfile_collection.rb
@@ -103,6 +93,7 @@ files:
103
93
  - lib/dotman/user.rb
104
94
  - lib/dotman/version.rb
105
95
  - spec/data/home/.gitkeep
96
+ - spec/dotman/after_clone_spec.rb
106
97
  - spec/dotman/base_spec.rb
107
98
  - spec/dotman/collect_spec.rb
108
99
  - spec/dotman/dotfile_collection_spec.rb
@@ -113,41 +104,34 @@ files:
113
104
  - spec/integration/git_integration_spec.rb
114
105
  - spec/integration/user_integration_spec.rb
115
106
  - spec/spec_helper.rb
116
- homepage: ""
117
- licenses:
107
+ homepage: ''
108
+ licenses:
118
109
  - MIT
110
+ metadata: {}
119
111
  post_install_message:
120
112
  rdoc_options: []
121
-
122
- require_paths:
113
+ require_paths:
123
114
  - lib
124
- required_ruby_version: !ruby/object:Gem::Requirement
125
- none: false
126
- requirements:
127
- - - ">="
128
- - !ruby/object:Gem::Version
129
- hash: 3
130
- segments:
131
- - 0
132
- version: "0"
133
- required_rubygems_version: !ruby/object:Gem::Requirement
134
- none: false
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- hash: 3
139
- segments:
140
- - 0
141
- version: "0"
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - '>='
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
142
125
  requirements: []
143
-
144
126
  rubyforge_project:
145
- rubygems_version: 1.8.25
127
+ rubygems_version: 2.0.3
146
128
  signing_key:
147
- specification_version: 3
148
- summary: Use this utility to manage your dotfiles and others who may use the same login user as yourself
149
- test_files:
129
+ specification_version: 4
130
+ summary: Use this utility to manage your dotfiles and others who may use the same
131
+ login user as yourself
132
+ test_files:
150
133
  - spec/data/home/.gitkeep
134
+ - spec/dotman/after_clone_spec.rb
151
135
  - spec/dotman/base_spec.rb
152
136
  - spec/dotman/collect_spec.rb
153
137
  - spec/dotman/dotfile_collection_spec.rb