gl 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gl.rb +10 -3
- data/lib/gl/cli.rb +1 -0
- data/lib/gl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c68809c9d31ef96ad88527015b3432f3bd364769945b1b04117eb3b0e50f774
|
4
|
+
data.tar.gz: 1d4e6bee5defb3ac371cebf07f847f2861cc20eda5af7ba272089657851e0959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 024c1f21ce307a94efc92e8891cb057ef007b21480182a6f8becb33f2e6e0c71b905a6631e99aebf67d472498beb7e3e1c140690264f5b7241c7a00ae1258fe6
|
7
|
+
data.tar.gz: c54840dfbf91cc4d787995be0d45b0c4c820b2bbfa22bbe7e94b8819f9ec984967c5617a7f7e4bd410e6dea21e11276d49259587bdbfa33439cd09ab549ace55
|
data/Gemfile.lock
CHANGED
data/lib/gl.rb
CHANGED
@@ -27,17 +27,24 @@ module Gl
|
|
27
27
|
`sensible-browser #{url}`
|
28
28
|
end
|
29
29
|
|
30
|
+
def self.validate_endpoint!
|
31
|
+
return if Net::HTTP.get(URI("#{Gitlab.endpoint}version")) == '{"message":"401 Unauthorized"}'
|
32
|
+
|
33
|
+
puts 'It seems this is not a valid GitLab repository'
|
34
|
+
exit(1)
|
35
|
+
end
|
36
|
+
|
30
37
|
def self.remote_url
|
31
38
|
`git config --get remote.origin.url`.chomp
|
32
39
|
end
|
33
40
|
|
34
41
|
def self.remote_parse
|
35
42
|
if remote_url.start_with?('git@')
|
36
|
-
regexp = %r{
|
43
|
+
regexp = %r{git@(.*?)(:|\/)(.*)?(\.git)}
|
37
44
|
url = remote_url
|
38
45
|
|
39
|
-
host = url.gsub(regexp, '\
|
40
|
-
project = url.gsub(regexp, '\
|
46
|
+
host = url.gsub(regexp, '\1')
|
47
|
+
project = url.gsub(regexp, '\3')
|
41
48
|
else
|
42
49
|
uri = URI(remote_url)
|
43
50
|
host = uri.host
|
data/lib/gl/cli.rb
CHANGED
data/lib/gl/version.rb
CHANGED