lib/learn_submit/submission/git_interactor.rb in learn-submit-1.1.7 vs lib/learn_submit/submission/git_interactor.rb in learn-submit-1.2.0
- old
+ new
@@ -21,12 +21,22 @@
commit_changes
push!
end
- def repo_name
- url = git.remote(remote_name).url
+ def commit
+ add_changes
+ commit_changes
+ end
+
+ def repo_name(remote: remote_name)
+ url = git.remote(remote).url
url.match(/^.+\w+\/(.*?)(?:\.git)?$/)[1]
+ end
+
+ def org_name(remote: remote_name)
+ url = git.remote(remote).url
+ url.match(/^.+github\.com(?::|\/)(.+)\/.*?(?:\.git)?$/)[1]
end
def branch_name
git.branch.name
end