Skip to content

Commit 53f30b7

Browse files
committed
docs(parser,base): Location -> URL
1 parent caa7d2e commit 53f30b7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

libvcs/parse/base.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,33 +85,33 @@ def register(self, cls: Matcher) -> None:
8585
... is_explicit = True
8686
8787
>>> @dataclasses.dataclass(repr=False)
88-
... class GitHubLocation(GitURL):
88+
... class GitHubURL(GitURL):
8989
... matchers: MatcherRegistry = MatcherRegistry(
9090
... _matchers={'github_prefix': GitHubPrefix}
9191
... )
9292
93-
>>> GitHubLocation.is_valid(url='github:vcs-python/libvcs')
93+
>>> GitHubURL.is_valid(url='github:vcs-python/libvcs')
9494
True
9595
96-
>>> GitHubLocation.is_valid(url='github:vcs-python/libvcs', is_explicit=True)
96+
>>> GitHubURL.is_valid(url='github:vcs-python/libvcs', is_explicit=True)
9797
True
9898
9999
Notice how ``pattern_defaults`` neatly fills the values for us.
100100
101-
>>> GitHubLocation(url='github:vcs-python/libvcs')
102-
GitHubLocation(url=github:vcs-python/libvcs,
101+
>>> GitHubURL(url='github:vcs-python/libvcs')
102+
GitHubURL(url=github:vcs-python/libvcs,
103103
scheme=https,
104104
hostname=github.com,
105105
path=vcs-python/libvcs,
106106
matcher=gh-prefix)
107107
108-
>>> GitHubLocation(url='github:vcs-python/libvcs').to_url()
108+
>>> GitHubURL(url='github:vcs-python/libvcs').to_url()
109109
'https://github.com/vcs-python/libvcs'
110110
111-
>>> GitHubLocation.is_valid(url='gitlab:vcs-python/libvcs')
111+
>>> GitHubURL.is_valid(url='gitlab:vcs-python/libvcs')
112112
False
113113
114-
`GitHubLocation` sees this as invalid since it only has one matcher,
114+
`GitHubURL` sees this as invalid since it only has one matcher,
115115
`GitHubPrefix`.
116116
117117
>>> GitURL.is_valid(url='gitlab:vcs-python/libvcs')
@@ -135,12 +135,12 @@ def register(self, cls: Matcher) -> None:
135135
Option 1: Create a brand new matcher
136136
137137
>>> @dataclasses.dataclass(repr=False)
138-
... class GitLabLocation(GitURL):
138+
... class GitLabURL(GitURL):
139139
... matchers: MatcherRegistry = MatcherRegistry(
140140
... _matchers={'gitlab_prefix': GitLabPrefix}
141141
... )
142142
143-
>>> GitLabLocation.is_valid(url='gitlab:vcs-python/libvcs')
143+
>>> GitLabURL.is_valid(url='gitlab:vcs-python/libvcs')
144144
True
145145
146146
Option 2 (global, everywhere): Add to the global :class:`GitURL`:

0 commit comments

Comments
 (0)