Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d3d0e3dd
Commit
d3d0e3dd
authored
Jun 13, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update `Gitlab.com?` to support staging
parent
298e4ece
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
lib/gitlab.rb
lib/gitlab.rb
+6
-1
spec/lib/gitlab_spec.rb
spec/lib/gitlab_spec.rb
+6
-0
No files found.
lib/gitlab.rb
View file @
d3d0e3dd
...
...
@@ -2,6 +2,11 @@ require_dependency 'gitlab/git'
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 @
d3d0e3dd
...
...
@@ -8,6 +8,12 @@ describe Gitlab, lib: true do
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