Permalink
Browse files

Added install task to Rakefile to install standalone script and man

pages.

caveat: had to override jewelers install task
  • Loading branch information...
1 parent 36a76e1 commit 58497ee3f7e65426df360238a641910f49774d91 @josh josh committed with defunkt Dec 11, 2009
Showing with 26 additions and 2 deletions.
  1. +5 −2 README.md
  2. +21 −0 Rakefile
View
@@ -44,6 +44,10 @@ Assuming `~/bin/` is in your `$PATH`, you're ready to roll:
git version 1.6.4.2
hub version 0.1.0
+### Homebrew
+
+ brew install hub
+
### RubyGems
Though not recommended, `hub` can also be installed as a RubyGem:
@@ -58,8 +62,7 @@ You can also install from source:
$ git clone git://github.com/defunkt/hub.git
$ cd hub
- $ rake standalone
- $ cp hub /usr/local/bin/
+ $ rake install prefix=/usr/local
Aliasing
View
@@ -77,6 +77,27 @@ rescue LoadError
puts "Install it with: gem install jeweler"
end
+
+Rake::TaskManager.class_eval do
+ def remove_task(task_name)
+ @tasks.delete(task_name.to_s)
+ end
+end
+
+# Remove jewelers install task
+Rake.application.remove_task(:install)
+
+desc "Install standalone script and man pages"
+task :install => :standalone do
+ prefix = ENV['PREFIX'] || ENV['prefix'] || '/usr/local'
+
+ FileUtils.mkdir_p "#{prefix}/bin"
+ FileUtils.cp "hub", "#{prefix}/bin"
+
+ FileUtils.mkdir_p "#{prefix}/share/man/man1"
+ FileUtils.cp "man/hub.1", "#{prefix}/share/man/man1"
+end
+
desc "Push a new version to Gemcutter"
task :publish => [ :test, :gemspec, :build ] do
system "git tag v#{Hub::Version}"

0 comments on commit 58497ee

Please sign in to comment.