lib/learn_submit/submission/git_interactor.rb in learn-submit-1.2.0 vs lib/learn_submit/submission/git_interactor.rb in learn-submit-1.3.0
- old
+ new
@@ -28,11 +28,11 @@
commit_changes
end
def repo_name(remote: remote_name)
url = git.remote(remote).url
- url.match(/^.+\w+\/(.*?)(?:\.git)?$/)[1]
+ url.match(/^.+[\w-]+\/(.*?)(?:\.git)?$/)[1]
end
def org_name(remote: remote_name)
url = git.remote(remote).url
url.match(/^.+github\.com(?::|\/)(.+)\/.*?(?:\.git)?$/)[1]
@@ -59,16 +59,16 @@
end
end
end
def check_remote
- if git.remote.url.match(/#{username}/).nil? && git.remote.url.match(/#{LEARN_ORG_NAMES.join('|').gsub('-','\-')}/).nil?
+ if git.remote.url.match(/#{username}/i).nil? && git.remote.url.match(/#{LEARN_ORG_NAMES.join('|').gsub('-','\-')}/i).nil?
puts "It doesn't look like you're in a lesson directory."
puts 'Please cd into an appropriate directory and try again.'
exit 1
else
- self.remote_name = if git.remote.url.match(/#{username}/).nil?
+ self.remote_name = if git.remote.url.match(/#{username}/i).nil?
fix_remote!
else
git.remote.name
end
end