Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
92ec2d40a417
Commit
d3d0e3dd
authored
Jun 13, 2016
by
Robert Speicher
Browse files
Update `Gitlab.com?` to support staging
parent
e63e36e288ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/gitlab.rb
View file @
92ec2d40
...
...
@@ -2,6 +2,11 @@
module
Gitlab
def
self
.
com?
Gitlab
.
config
.
gitlab
.
url
==
'https://gitlab.com'
# Check `staging?` as well to keep parity with gitlab.com
Gitlab
.
config
.
gitlab
.
url
==
'https://gitlab.com'
||
staging?
end
def
self
.
staging?
Gitlab
.
config
.
gitlab
.
url
==
'https://staging.gitlab.com'
end
end
spec/lib/gitlab_spec.rb
View file @
92ec2d40
...
...
@@ -8,6 +8,12 @@
expect
(
described_class
.
com?
).
to
eq
true
end
it
'is true when on staging'
do
stub_config_setting
(
url:
'https://staging.gitlab.com'
)
expect
(
described_class
.
com?
).
to
eq
true
end
it
'is false when not on GitLab.com'
do
stub_config_setting
(
url:
'http://example.com'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment