Skip to content

Commit

Permalink
rake and readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Dec 9, 2009
1 parent 4780ede commit 871faf9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 40 deletions.
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
hub: git + hub = github
=======================

`hub` is a command line utility which injects `git` with GitHub
knowledge.
`hub` is a command line utility which adds GitHub knowledge to `git`.

It can used on its own or can serve as a complete, backwards
compatible replacement for the `git` script.
It can used on its own or as a `git` wrapper.

Normal:

Expand All @@ -17,7 +15,7 @@ Normal:
Receiving objects: 100% (307/307), 48.91 KiB, done.
Resolving deltas: 100% (175/175), done.

Aliased:
Wrapping `git`:

$ git clone rack/rack
Initialized empty Git repository in /Users/chris/sandbox/rack/.git/
Expand All @@ -33,30 +31,30 @@ Install

### Standalone

`hub` can be installed most easily as a stand alone script:
`hub` can be installed most easily as a standalone script:

curl http://defunkt.github.com/hub/standalone > ~/bin/hub && chmod 0755 !$

If ~/bin/hub is in your path, you're ready to roll!
Assuming `~/bin/` is in your path, you're ready to roll:

### Rubygem
$ hub version
git version 1.6.4.2
hub version 0.1.0

It also can be installed using Rubygems:
### Rubygems

$ gem install hub -s http://gemcutter.org/

Once you have the gem installed you will probably want to install the
standalone script, to avoid the Rubygems startup tax:
Though not recommended, `hub` can also be installed as a Rubygem:

$ hub install standalone
$ gem install hub -s http://gemcutter.org/

### Source

You can also install from source:

$ git clone git://github.com/defunkt/hub.git
$ cd hub
$ rake install_standalone
$ rake standalone
$ cp hub /usr/local/bin/


Aliasing
Expand Down
38 changes: 13 additions & 25 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,14 @@ end
desc "Build a gem"
task :gem => [ :gemspec, :build ]

desc "Install `hub`"
task :setup => :standalone do
path = ENV['BINPATH'] || %w( ~/bin /usr/local/bin /usr/bin ).detect do |dir|
File.directory? File.expand_path(dir)
end
desc "Build standalone script"
task :standalone => [ :test, :load_hub ] do
Hub::Standalone.save('hub')
end

if path
puts "Installing into #{path}"
cp "standalone", hub = File.expand_path(File.join(path, 'hub'))
chmod 0755, hub
puts "Done. Type `hub version` to see if it worked!"
else
puts "** Can't find a suitable installation location."
abort "** Please set the BINPATH env variable and try again."
end
task :load_hub do
$LOAD_PATH.unshift 'lib'
require 'hub'
end

begin
Expand All @@ -54,13 +47,14 @@ begin
If you are a heavy user of `git` on the command
line you may want to install `hub` the old
fashioned way! Faster startup time, you see.
fashioned way. Faster startup time, you see.
Check out the installation instructions at
http://github.com/defunkt/hub#readme or simply
use the `install` command:
http://github.com/defunkt/hub#readme under the
"Standalone" section.
$ hub install
Cheers,
defunkt
------------------------------------------------------------
Expand All @@ -83,6 +77,7 @@ end

desc "Publish to GitHub Pages"
task :pages => [ :check_dirty, :standalone ] do
`mv hub standalone`
`git checkout gh-pages`
`md5 -q standalone > standalone.md5`
`git add standalone*`
Expand All @@ -97,10 +92,3 @@ task :check_dirty do
abort "dirty index - not publishing!"
end
end

desc "Build standalone script"
task :standalone => :test do
$LOAD_PATH.unshift 'lib'
require 'hub'
Hub::Standalone.save('standalone')
end
1 change: 1 addition & 0 deletions lib/hub/standalone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def save(filename, path = '.')
target = File.join(File.expand_path(path), filename)
File.open(target, 'w') do |f|
f.puts build
f.chmod 0755
end
rescue Errno::EACCES, Errno::ENOENT
puts "** can't write to #{target}"
Expand Down

0 comments on commit 871faf9

Please sign in to comment.