提交 8d87891a 编写于 作者: C Chris Wanstrath

Add `hub standalone` for installation of standalone via RubyGems

上级 fd63f9b4
......@@ -60,6 +60,14 @@ Though not recommended, `hub` can also be installed as a RubyGem:
(It's not recommended because of the RubyGems startup time. See [this
gist][speed] for information.)
### Standalone via RubyGems
Yes, the gem name is still `git-hub`:
$ gem install git-hub
$ hub hub standalone > ~/bin/hub && chmod 755 ~/bin/hub
$ gem uninstall git-hub
### Source
You can also install from source:
......
......@@ -161,6 +161,20 @@ module Hub
exec "#{browser} #{protocol}://github.com/#{user}/#{repo}"
end
# $ hub hub standalone
# Prints the "standalone" version of hub for an easy, memorable
# installation sequence:
#
# $ gem install git-hub
# $ hub standalone > ~/bin/standalone
# $ gem uninstall git-hub
def hub(args)
return help(args) unless args[1] == 'standalone'
require 'hub/standalone'
puts Hub::Standalone.build
exit
end
def alias(args)
shells = {
'sh' => 'alias git=hub',
......
......@@ -147,6 +147,11 @@ config
assert_equal "** Can't find groff(1)\n", help_manpage
end
def test_hub_standalone
help_standalone = hub("hub standalone")
assert_equal Hub::Standalone.build, help_standalone
end
def test_hub_open
input = "browse mojombo/bert"
command = "http://github.com/mojombo/bert\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册