Permalink
Browse files

merging in git_name branch

  • Loading branch information...
2 parents dd9adb0 + 064f741 commit 5d2f1cd49e900d0afb57902e142758c527a7c67b @asceth committed Apr 2, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −1 lib/ors/config.rb
  2. +3 −1 spec/ors/config_spec.rb
View
2 lib/ors/config.rb
@@ -66,7 +66,7 @@ def remote_from_git
private
def name_from_git
- remote_from_git.gsub(/^[\w]*(@|:\/\/)[^\/:]*(\/|:)([a-zA-Z0-9\/]*)(.git)?$/i, '\3')
+ remote_from_git.gsub(/^[\w]*(@|:\/\/)[^\/:]*(\/|:)([a-zA-Z0-9\/_-]*)(.git)?$/i, '\3')
end
end
extend ModuleMethods
View
4 spec/ors/config_spec.rb
@@ -105,7 +105,9 @@ class ORS::ConfigTest; include ORS::Config; end
"git@github.com:testing/github" => "testing/github",
"git@ghub.com:testing/gitlabhq.git" => "testing/gitlabhq",
"git@ghub.com:gitlabhq.git" => "gitlabhq",
- "git://ghub.com/gitlabhq.git" => "gitlabhq"
+ "git://ghub.com/gitlabhq.git" => "gitlabhq",
+ "git://ghub.com/level_git.git" => "level_git",
+ "git://ghub.com/level-up/two.git" => "level-up/two"
}.each do |remote, name|
it "should handle a remote origin url such as #{remote}" do
stub(ORS::Config).git { mock!.config { {"remote.origin.url" => remote} }}

0 comments on commit 5d2f1cd

Please sign in to comment.