File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -127,12 +127,14 @@ def parse(url)
127127 ret = { }
128128 # start with http://github.com/evolvingweb/git_remote or [email protected] :some/repo.git 129129 ret [ :url ] = url
130+
131+ # NB: Starting lines with ".gsub" is a syntax error in ruby 1.8.
132+ # See http://stackoverflow.com/q/12906048/9621
130133 # path is github.com/evolvingweb/muhc-ci
131- ret [ :path ] = url
132- . gsub ( /^.*:\/ \/ / , '' ) # Remove anything before ://
133- . gsub ( /:/ , '/' ) # convert ":" to "/"
134- . gsub ( /^.*@/ , '' ) # Remove anything before @
135- . gsub ( /\. git$/ , '' ) # Remove trailing .git
134+ ret [ :path ] = url . gsub ( /^.*:\/ \/ / , '' ) . # Remove anything before ://
135+ gsub ( /:/ , '/' ) . # convert ":" to "/"
136+ gsub ( /^.*@/ , '' ) . # Remove anything before @
137+ gsub ( /\. git$/ , '' ) # Remove trailing .git
136138 ret [ :host ] = ret [ :path ] . split ( '/' ) . first
137139 #TODO: handle project uniqueness automatically or prompt
138140 ret [ :identifier ] = ret [ :path ] . split ( '/' ) . last . downcase . gsub ( /[^a-z0-9_-]/ , '-' )
You can’t perform that action at this time.
0 commit comments