提交 871faf9c 编写于 作者: C Chris Wanstrath

rake and readme updates

上级 4780ede0
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:
......@@ -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/
......@@ -33,22 +31,21 @@ 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
......@@ -56,7 +53,8 @@ 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
......
......@@ -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
......@@ -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
------------------------------------------------------------
......@@ -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*`
......@@ -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
......@@ -22,6 +22,7 @@ premable
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}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册