handle modern bundler :github syntax for gem property with default penchant files

This commit is contained in:
John Bintz 2013-01-24 10:06:49 -05:00
parent 2250d629be
commit eeb743467d
2 changed files with 14 additions and 2 deletions

View File

@ -134,7 +134,19 @@ ensure_git_hooks!
defaults_for env(:local), :path => '../%s'
# reference a github repository with gem 'my-gem', :github => 'username'
property :github, :git => 'git://github.com/$1/%s.git'
# also supports modern bundler user/repo syntax
property(:github) { |name|
parts = name.split('/')
url = case parts.length
when 1
"git://github.com/\#{name}/%s.git"
when 2
"git://github.com/\#{parts.first}/\#{parts.last}.git"
end
{ :git => url }
}
RB
gemfile(:remote)
end

View File

@ -1,3 +1,3 @@
module Penchant
VERSION = "0.2.26"
VERSION = "0.2.27"
end