Permalink
Browse files

add Plugin#path to make things simpler

  • Loading branch information...
1 parent 17484ae commit 9d5cda5f25b111adaee254f7e90953651e07b1d6 @pedro pedro committed Dec 15, 2009
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/heroku/plugin.rb
View
@@ -32,20 +32,23 @@ def to_s
name
end
+ def path
+ "#{self.class.directory}/#{name}"
+ end
+
def install
- FileUtils.mkdir_p(install_path = "#{self.class.directory}/#{name}")
- Dir.chdir install_path do
+ FileUtils.mkdir_p(path)
+ Dir.chdir(path) do
system("git init > /dev/null 2>&1")
if system("git pull --depth 1 #{uri} > /dev/null 2>&1")
FileUtils.rm_rf %w(.git .gitignore)
else
- FileUtils.rm_rf install_path
+ FileUtils.rm_rf path
end
end
end
def uninstall
- path = "#{self.class.directory}/#{name}"
FileUtils.rm_r path if File.directory?(path)
end

0 comments on commit 9d5cda5

Please sign in to comment.