dotfu 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/bin/dotfu +5 -6
- data/commands/install.rb +1 -1
- data/lib/dotfu/repos.rb +11 -17
- data/lib/dotfu/version.rb +1 -1
- data/lib/dotfu.rb +4 -0
- metadata +3 -4
- data/roadmap.md +0 -3
- /data/{LICENSE.txt → LICENSE.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ed0e8ea77f9d7aee9b7cee356605c2cccade658
|
4
|
+
data.tar.gz: 78416629973e69872bfe0f60a055b9619ef17a90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cabfbe695f9754bb16a36c93e1a7cc5a082455c03490ae3d2878712bf90a9f7e72fe25b3fde609620cea3a5172fdf3d5252533da68eb5940e13dd8d198b1e8ef
|
7
|
+
data.tar.gz: 9078d91a95e8dc1b011a7541225292d49e429fe961a9edbec80bd66e4d661df0d42726a5586f39dadc35bd416d4427698062ef1fd3644d329612ee8a648035c4
|
data/CHANGELOG.md
CHANGED
data/bin/dotfu
CHANGED
@@ -2,9 +2,8 @@
|
|
2
2
|
|
3
3
|
require 'dotfu'
|
4
4
|
require 'yaml'
|
5
|
-
|
6
|
-
|
7
5
|
require 'slop'
|
6
|
+
require 'git'
|
8
7
|
|
9
8
|
if !Dotfu.installed?
|
10
9
|
puts "Git does not appear to be installed, aporting."
|
@@ -13,16 +12,16 @@ end
|
|
13
12
|
|
14
13
|
opts = Slop.parse(help:true) do
|
15
14
|
banner "Dotfu:\n"\
|
16
|
-
"
|
17
|
-
"
|
15
|
+
"Simple usage: dotfu install user@repo:branch\n"\
|
16
|
+
"User/branch are optional in all contexts. Check http://github.com/erniebrodeur for more details."
|
18
17
|
|
19
18
|
on(:v, :verbose, 'Enable verbose mode')
|
20
19
|
on(:version, 'Print the version') {puts "Version #{Dotfu::VERSION}" }
|
21
20
|
on(:data_directory, "Root directory to fetch into (default: #{Bini.data_dir}/repos)")
|
22
21
|
on(:target_directory, "Change the default target directory from your home: #{Dir.home}")
|
23
22
|
|
24
|
-
|
25
|
-
|
23
|
+
|
24
|
+
Dotfu.commands.each do |file|
|
26
25
|
instance_eval open(file).read
|
27
26
|
end
|
28
27
|
|
data/commands/install.rb
CHANGED
data/lib/dotfu/repos.rb
CHANGED
@@ -44,7 +44,9 @@ module Dotfu
|
|
44
44
|
# initial clone
|
45
45
|
def clone
|
46
46
|
return nil if !repo || !user
|
47
|
-
|
47
|
+
uri = "git://github.com/#{user}/#{repo}.git"
|
48
|
+
FileUtils.mkdir_p working_dir
|
49
|
+
return true if Git.clone(uri, repo, path:"#{Bini.data_dir}/repos/#{user}" )
|
48
50
|
end
|
49
51
|
|
50
52
|
# A wrapper method to clone or update a repo.
|
@@ -59,9 +61,11 @@ module Dotfu
|
|
59
61
|
|
60
62
|
|
61
63
|
def install
|
62
|
-
|
64
|
+
r = Git.init working_dir
|
63
65
|
|
64
|
-
|
66
|
+
result = r.checkout(@branch ? branch : "master")
|
67
|
+
|
68
|
+
raise RuntimeError.new result unless result
|
65
69
|
|
66
70
|
# lets check if we have anything in the way, and abort instead of partially
|
67
71
|
# installing
|
@@ -78,7 +82,10 @@ module Dotfu
|
|
78
82
|
|
79
83
|
def pull
|
80
84
|
return nil if !repo || !user
|
81
|
-
|
85
|
+
r = Git.init working_dir
|
86
|
+
#TODO: I'm confident that the implicit decleration of first here is going
|
87
|
+
# to muck something up for someone. Find a way to do this explicitly.
|
88
|
+
return r.remote.merge
|
82
89
|
end
|
83
90
|
|
84
91
|
def uninstall
|
@@ -182,18 +189,5 @@ module Dotfu
|
|
182
189
|
def file_string(file)
|
183
190
|
return file.class == Fixnum ? files[file] : file
|
184
191
|
end
|
185
|
-
def git_cmd(cmd, cd = true)
|
186
|
-
if cd
|
187
|
-
pwd = Dir.pwd
|
188
|
-
Dir.chdir working_dir
|
189
|
-
end
|
190
|
-
|
191
|
-
out, err, status = Open3.capture3 "git #{cmd}"
|
192
|
-
|
193
|
-
Dir.chdir pwd if cd
|
194
|
-
|
195
|
-
return {status:status, out:out, err:err}
|
196
|
-
end
|
197
|
-
|
198
192
|
end
|
199
193
|
end
|
data/lib/dotfu/version.rb
CHANGED
data/lib/dotfu.rb
CHANGED
@@ -40,6 +40,10 @@ module Dotfu
|
|
40
40
|
return @git_installed
|
41
41
|
end
|
42
42
|
|
43
|
+
def commands
|
44
|
+
spec = Gem::Specification.find_by_name("dotfu")
|
45
|
+
return Dir["#{spec.full_gem_path}/commands/*"]
|
46
|
+
end
|
43
47
|
Bini.long_name = "dotfu"
|
44
48
|
GITHUB ||= Github.new user_agent:"Dotfu: #{Dotfu::VERSION}", auto_pagination:true
|
45
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotfu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernie Brodeur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bini
|
@@ -95,7 +95,7 @@ files:
|
|
95
95
|
- CHANGELOG.md
|
96
96
|
- Gemfile
|
97
97
|
- Guardfile
|
98
|
-
- LICENSE.
|
98
|
+
- LICENSE.md
|
99
99
|
- README.md
|
100
100
|
- Rakefile
|
101
101
|
- bin/dotfu
|
@@ -109,7 +109,6 @@ files:
|
|
109
109
|
- lib/dotfu/config_parser.rb
|
110
110
|
- lib/dotfu/repos.rb
|
111
111
|
- lib/dotfu/version.rb
|
112
|
-
- roadmap.md
|
113
112
|
- spec/cli_spec_helper.rb
|
114
113
|
- spec/dotfu_spec.rb
|
115
114
|
- spec/spec_helper.rb
|
data/roadmap.md
DELETED
/data/{LICENSE.txt → LICENSE.md}
RENAMED
File without changes
|