Skip to content

Commit ef14c4e

Browse files
committed
Missing file for gitlab
1 parent 1802cc5 commit ef14c4e

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

giturlparse/platforms/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .bitbucket import BitbucketPlatform
55
from .friendcode import FriendCodePlatform
66
from .assembla import AssemblaPlatform
7-
from .gitlab import GitlabPlatform
7+
from .gitlab import GitLabPlatform
88

99

1010
# Supported platforms
@@ -20,4 +20,4 @@
2020
('base', BasePlatform()),
2121
)
2222

23-
PLATFORMS_MAP = dict(PLATFORMS)
23+
PLATFORMS_MAP = dict(PLATFORMS)

giturlparse/platforms/gitlab.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Imports
2+
from .base import BasePlatform
3+
4+
5+
class GitLabPlatform(BasePlatform):
6+
PATTERNS = {
7+
'https': r'https://(?P<domain>.+)/(?P<owner>.+)/(?P<repo>.+).git',
8+
'ssh': r'git@(?P<domain>.+):(?P<owner>.+)/(?P<repo>.+).git',
9+
'git': r'git://(?P<domain>.+)/(?P<owner>.+)/(?P<repo>.+).git',
10+
}
11+
FORMATS = {
12+
'https': r'https://%(domain)s/%(owner)s/%(repo)s.git',
13+
'ssh': r'git@%(domain)s:%(owner)s/%(repo)s.git',
14+
'git': r'git://%(domain)s/%(owner)s/%(repo)s.git'
15+
}
16+
DEFAULTS = {
17+
'_user': 'git'
18+
}
19+

0 commit comments

Comments
 (0)