gokdok 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gokdok.rb +7 -0
- metadata +1 -1
data/lib/gokdok.rb
CHANGED
@@ -52,6 +52,11 @@ module Gokdok
|
|
52
52
|
|
53
53
|
private
|
54
54
|
|
55
|
+
# Fix git variables that may have been set by other tasks
|
56
|
+
def clear_git_vars
|
57
|
+
%w(GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE).each { |var| ENV[var] = nil }
|
58
|
+
end
|
59
|
+
|
55
60
|
def find_git_binary
|
56
61
|
`which git`.chop
|
57
62
|
end
|
@@ -110,6 +115,7 @@ module Gokdok
|
|
110
115
|
end
|
111
116
|
|
112
117
|
def run_git_command(command)
|
118
|
+
clear_git_vars
|
113
119
|
result = system("#{git_path} #{command}")
|
114
120
|
raise(RuntimeError, "Could not run: git #{command}") unless(result)
|
115
121
|
end
|
@@ -131,6 +137,7 @@ module Gokdok
|
|
131
137
|
|
132
138
|
desc 'Create the documentation without actually pushing it'
|
133
139
|
task :update => rdoc_task do
|
140
|
+
clear_git_vars
|
134
141
|
repo = Grit::Repo.new(pages_home)
|
135
142
|
remote_dir = File.join(pages_home, remote_path)
|
136
143
|
|