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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
28bafd53
Commit
28bafd53
authored
Jun 29, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Style/SpaceAfterComma Rubocop cop
parent
9798ac77
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
20 additions
and
20 deletions
+20
-20
.rubocop.yml
.rubocop.yml
+1
-1
app/helpers/page_layout_helper.rb
app/helpers/page_layout_helper.rb
+1
-1
app/models/network/graph.rb
app/models/network/graph.rb
+2
-2
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+1
-1
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+1
-1
app/models/user.rb
app/models/user.rb
+1
-1
app/uploaders/lfs_object_uploader.rb
app/uploaders/lfs_object_uploader.rb
+1
-1
config/initializers/devise.rb
config/initializers/devise.rb
+1
-1
config/initializers/sidekiq.rb
config/initializers/sidekiq.rb
+1
-1
features/steps/project/forked_merge_requests.rb
features/steps/project/forked_merge_requests.rb
+1
-1
lib/api/group_members.rb
lib/api/group_members.rb
+1
-1
lib/gitlab/backend/grack_auth.rb
lib/gitlab/backend/grack_auth.rb
+1
-1
lib/gitlab/o_auth/auth_hash.rb
lib/gitlab/o_auth/auth_hash.rb
+1
-1
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+1
-1
spec/lib/gitlab/o_auth/user_spec.rb
spec/lib/gitlab/o_auth/user_spec.rb
+2
-2
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+3
-3
No files found.
.rubocop.yml
View file @
28bafd53
...
@@ -536,7 +536,7 @@ Style/SpaceAfterColon:
...
@@ -536,7 +536,7 @@ Style/SpaceAfterColon:
# Use spaces after commas.
# Use spaces after commas.
Style/SpaceAfterComma
:
Style/SpaceAfterComma
:
Enabled
:
fals
e
Enabled
:
tru
e
# Do not put a space between a method name and the opening parenthesis in a
# Do not put a space between a method name and the opening parenthesis in a
# method definition.
# method definition.
...
...
app/helpers/page_layout_helper.rb
View file @
28bafd53
...
@@ -52,7 +52,7 @@ module PageLayoutHelper
...
@@ -52,7 +52,7 @@ module PageLayoutHelper
raise
ArgumentError
,
'cannot provide more than two attributes'
if
map
.
length
>
2
raise
ArgumentError
,
'cannot provide more than two attributes'
if
map
.
length
>
2
@page_card_attributes
||=
{}
@page_card_attributes
||=
{}
@page_card_attributes
=
map
.
reject
{
|
_
,
v
|
v
.
blank?
}
if
map
.
present?
@page_card_attributes
=
map
.
reject
{
|
_
,
v
|
v
.
blank?
}
if
map
.
present?
@page_card_attributes
@page_card_attributes
end
end
...
...
app/models/network/graph.rb
View file @
28bafd53
...
@@ -54,7 +54,7 @@ module Network
...
@@ -54,7 +54,7 @@ module Network
@map
=
{}
@map
=
{}
@reserved
=
{}
@reserved
=
{}
@commits
.
each_with_index
do
|
c
,
i
|
@commits
.
each_with_index
do
|
c
,
i
|
c
.
time
=
i
c
.
time
=
i
days
[
i
]
=
c
.
committed_date
days
[
i
]
=
c
.
committed_date
@map
[
c
.
id
]
=
c
@map
[
c
.
id
]
=
c
...
@@ -116,7 +116,7 @@ module Network
...
@@ -116,7 +116,7 @@ module Network
end
end
def
commits_sort_by_ref
def
commits_sort_by_ref
@commits
.
sort
do
|
a
,
b
|
@commits
.
sort
do
|
a
,
b
|
if
include_ref?
(
a
)
if
include_ref?
(
a
)
-
1
-
1
elsif
include_ref?
(
b
)
elsif
include_ref?
(
b
)
...
...
app/models/project_services/hipchat_service.rb
View file @
28bafd53
...
@@ -106,7 +106,7 @@ class HipchatService < Service
...
@@ -106,7 +106,7 @@ class HipchatService < Service
else
else
message
<<
"pushed to
#{
ref_type
}
<a href=
\"
"
\
message
<<
"pushed to
#{
ref_type
}
<a href=
\"
"
\
"
#{
project
.
web_url
}
/commits/
#{
CGI
.
escape
(
ref
)
}
\"
>
#{
ref
}
</a> "
"
#{
project
.
web_url
}
/commits/
#{
CGI
.
escape
(
ref
)
}
\"
>
#{
ref
}
</a> "
message
<<
"of <a href=
\"
#{
project
.
web_url
}
\"
>
#{
project
.
name_with_namespace
.
gsub!
(
/\s/
,
''
)
}
</a> "
message
<<
"of <a href=
\"
#{
project
.
web_url
}
\"
>
#{
project
.
name_with_namespace
.
gsub!
(
/\s/
,
''
)
}
</a> "
message
<<
"(<a href=
\"
#{
project
.
web_url
}
/compare/
#{
before
}
...
#{
after
}
\"
>Compare changes</a>)"
message
<<
"(<a href=
\"
#{
project
.
web_url
}
/compare/
#{
before
}
...
#{
after
}
\"
>Compare changes</a>)"
push
[
:commits
].
take
(
MAX_COMMITS
).
each
do
|
commit
|
push
[
:commits
].
take
(
MAX_COMMITS
).
each
do
|
commit
|
...
...
app/models/project_services/jira_service.rb
View file @
28bafd53
...
@@ -124,7 +124,7 @@ class JiraService < IssueTrackerService
...
@@ -124,7 +124,7 @@ class JiraService < IssueTrackerService
def
build_api_url_from_project_url
def
build_api_url_from_project_url
server
=
URI
(
project_url
)
server
=
URI
(
project_url
)
default_ports
=
[[
"http"
,
80
],[
"https"
,
443
]].
include?
([
server
.
scheme
,
server
.
port
])
default_ports
=
[[
"http"
,
80
],
[
"https"
,
443
]].
include?
([
server
.
scheme
,
server
.
port
])
server_url
=
"
#{
server
.
scheme
}
://
#{
server
.
host
}
"
server_url
=
"
#{
server
.
scheme
}
://
#{
server
.
host
}
"
server_url
.
concat
(
":
#{
server
.
port
}
"
)
unless
default_ports
server_url
.
concat
(
":
#{
server
.
port
}
"
)
unless
default_ports
"
#{
server_url
}
/rest/api/
#{
DEFAULT_API_VERSION
}
"
"
#{
server_url
}
/rest/api/
#{
DEFAULT_API_VERSION
}
"
...
...
app/models/user.rb
View file @
28bafd53
...
@@ -764,7 +764,7 @@ class User < ActiveRecord::Base
...
@@ -764,7 +764,7 @@ class User < ActiveRecord::Base
unless
email_domains
.
blank?
unless
email_domains
.
blank?
match_found
=
email_domains
.
any?
do
|
domain
|
match_found
=
email_domains
.
any?
do
|
domain
|
escaped
=
Regexp
.
escape
(
domain
).
gsub
(
'\*'
,
'.*?'
)
escaped
=
Regexp
.
escape
(
domain
).
gsub
(
'\*'
,
'.*?'
)
regexp
=
Regexp
.
new
"^
#{
escaped
}
$"
,
Regexp
::
IGNORECASE
regexp
=
Regexp
.
new
"^
#{
escaped
}
$"
,
Regexp
::
IGNORECASE
email_domain
=
Mail
::
Address
.
new
(
self
.
email
).
domain
email_domain
=
Mail
::
Address
.
new
(
self
.
email
).
domain
email_domain
=~
regexp
email_domain
=~
regexp
...
...
app/uploaders/lfs_object_uploader.rb
View file @
28bafd53
...
@@ -4,7 +4,7 @@ class LfsObjectUploader < CarrierWave::Uploader::Base
...
@@ -4,7 +4,7 @@ class LfsObjectUploader < CarrierWave::Uploader::Base
storage
:file
storage
:file
def
store_dir
def
store_dir
"
#{
Gitlab
.
config
.
lfs
.
storage_path
}
/
#{
model
.
oid
[
0
,
2
]
}
/
#{
model
.
oid
[
2
,
2
]
}
"
"
#{
Gitlab
.
config
.
lfs
.
storage_path
}
/
#{
model
.
oid
[
0
,
2
]
}
/
#{
model
.
oid
[
2
,
2
]
}
"
end
end
def
cache_dir
def
cache_dir
...
...
config/initializers/devise.rb
View file @
28bafd53
...
@@ -212,7 +212,7 @@ Devise.setup do |config|
...
@@ -212,7 +212,7 @@ Devise.setup do |config|
if
Gitlab
::
LDAP
::
Config
.
enabled?
if
Gitlab
::
LDAP
::
Config
.
enabled?
Gitlab
.
config
.
ldap
.
servers
.
values
.
each
do
|
server
|
Gitlab
.
config
.
ldap
.
servers
.
values
.
each
do
|
server
|
if
server
[
'allow_username_or_email_login'
]
if
server
[
'allow_username_or_email_login'
]
email_stripping_proc
=
->
(
name
)
{
name
.
gsub
(
/@.*\z/
,
''
)}
email_stripping_proc
=
->
(
name
)
{
name
.
gsub
(
/@.*\z/
,
''
)}
else
else
email_stripping_proc
=
->
(
name
)
{
name
}
email_stripping_proc
=
->
(
name
)
{
name
}
end
end
...
...
config/initializers/sidekiq.rb
View file @
28bafd53
...
@@ -13,7 +13,7 @@ Sidekiq.configure_server do |config|
...
@@ -13,7 +13,7 @@ Sidekiq.configure_server do |config|
# UGLY Hack to get nested hash from settingslogic
# UGLY Hack to get nested hash from settingslogic
cron_jobs
=
JSON
.
parse
(
Gitlab
.
config
.
cron_jobs
.
to_json
)
cron_jobs
=
JSON
.
parse
(
Gitlab
.
config
.
cron_jobs
.
to_json
)
# UGLY hack: Settingslogic doesn't allow 'class' key
# UGLY hack: Settingslogic doesn't allow 'class' key
cron_jobs
.
each
{
|
k
,
v
|
cron_jobs
[
k
][
'class'
]
=
cron_jobs
[
k
].
delete
(
'job_class'
)
}
cron_jobs
.
each
{
|
k
,
v
|
cron_jobs
[
k
][
'class'
]
=
cron_jobs
[
k
].
delete
(
'job_class'
)
}
Sidekiq
::
Cron
::
Job
.
load_from_hash!
cron_jobs
Sidekiq
::
Cron
::
Job
.
load_from_hash!
cron_jobs
# Database pool should be at least `sidekiq_concurrency` + 2
# Database pool should be at least `sidekiq_concurrency` + 2
...
...
features/steps/project/forked_merge_requests.rb
View file @
28bafd53
...
@@ -153,6 +153,6 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
...
@@ -153,6 +153,6 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
# Verify a link is generated against the correct project
# Verify a link is generated against the correct project
def
verify_commit_link
(
container_div
,
container_project
)
def
verify_commit_link
(
container_div
,
container_project
)
# This should force a wait for the javascript to execute
# This should force a wait for the javascript to execute
expect
(
find
(
:div
,
container_div
).
find
(
".commit_short_id"
)[
'href'
]).
to
have_content
"
#{
container_project
.
path_with_namespace
}
/commit"
expect
(
find
(
:div
,
container_div
).
find
(
".commit_short_id"
)[
'href'
]).
to
have_content
"
#{
container_project
.
path_with_namespace
}
/commit"
end
end
end
end
lib/api/group_members.rb
View file @
28bafd53
...
@@ -77,7 +77,7 @@ module API
...
@@ -77,7 +77,7 @@ module API
member
=
group
.
group_members
.
find_by
(
user_id:
params
[
:user_id
])
member
=
group
.
group_members
.
find_by
(
user_id:
params
[
:user_id
])
if
member
.
nil?
if
member
.
nil?
render_api_error!
(
"404 Not Found - user_id:
#{
params
[
:user_id
]
}
not a member of group
#{
group
.
name
}
"
,
404
)
render_api_error!
(
"404 Not Found - user_id:
#{
params
[
:user_id
]
}
not a member of group
#{
group
.
name
}
"
,
404
)
else
else
member
.
destroy
member
.
destroy
end
end
...
...
lib/gitlab/backend/grack_auth.rb
View file @
28bafd53
...
@@ -22,7 +22,7 @@ module Grack
...
@@ -22,7 +22,7 @@ module Grack
# Need this if under RELATIVE_URL_ROOT
# Need this if under RELATIVE_URL_ROOT
unless
Gitlab
.
config
.
gitlab
.
relative_url_root
.
empty?
unless
Gitlab
.
config
.
gitlab
.
relative_url_root
.
empty?
# If website is mounted using relative_url_root need to remove it first
# If website is mounted using relative_url_root need to remove it first
@env
[
'PATH_INFO'
]
=
@request
.
path
.
sub
(
Gitlab
.
config
.
gitlab
.
relative_url_root
,
''
)
@env
[
'PATH_INFO'
]
=
@request
.
path
.
sub
(
Gitlab
.
config
.
gitlab
.
relative_url_root
,
''
)
else
else
@env
[
'PATH_INFO'
]
=
@request
.
path
@env
[
'PATH_INFO'
]
=
@request
.
path
end
end
...
...
lib/gitlab/o_auth/auth_hash.rb
View file @
28bafd53
...
@@ -66,7 +66,7 @@ module Gitlab
...
@@ -66,7 +66,7 @@ module Gitlab
# Get the first part of the email address (before @)
# Get the first part of the email address (before @)
# In addtion in removes illegal characters
# In addtion in removes illegal characters
def
generate_username
(
email
)
def
generate_username
(
email
)
email
.
match
(
/^[^@]*/
)[
0
].
mb_chars
.
normalize
(
:kd
).
gsub
(
/[^\x00-\x7F]/
,
''
).
to_s
email
.
match
(
/^[^@]*/
)[
0
].
mb_chars
.
normalize
(
:kd
).
gsub
(
/[^\x00-\x7F]/
,
''
).
to_s
end
end
def
generate_temporarily_email
(
username
)
def
generate_temporarily_email
(
username
)
...
...
spec/features/issues_spec.rb
View file @
28bafd53
...
@@ -92,7 +92,7 @@ describe 'Issues', feature: true do
...
@@ -92,7 +92,7 @@ describe 'Issues', feature: true do
end
end
context
'on edit form'
do
context
'on edit form'
do
let
(
:issue
)
{
create
(
:issue
,
author:
@user
,
project:
project
,
due_date:
Date
.
today
.
at_beginning_of_month
.
to_s
)
}
let
(
:issue
)
{
create
(
:issue
,
author:
@user
,
project:
project
,
due_date:
Date
.
today
.
at_beginning_of_month
.
to_s
)
}
before
do
before
do
visit
edit_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
edit_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
...
...
spec/lib/gitlab/o_auth/user_spec.rb
View file @
28bafd53
...
@@ -122,7 +122,7 @@ describe Gitlab::OAuth::User, lib: true do
...
@@ -122,7 +122,7 @@ describe Gitlab::OAuth::User, lib: true do
before
do
before
do
allow
(
ldap_user
).
to
receive
(
:uid
)
{
uid
}
allow
(
ldap_user
).
to
receive
(
:uid
)
{
uid
}
allow
(
ldap_user
).
to
receive
(
:username
)
{
uid
}
allow
(
ldap_user
).
to
receive
(
:username
)
{
uid
}
allow
(
ldap_user
).
to
receive
(
:email
)
{
[
'johndoe@example.com'
,
'john2@example.com'
]
}
allow
(
ldap_user
).
to
receive
(
:email
)
{
[
'johndoe@example.com'
,
'john2@example.com'
]
}
allow
(
ldap_user
).
to
receive
(
:dn
)
{
'uid=user1,ou=People,dc=example'
}
allow
(
ldap_user
).
to
receive
(
:dn
)
{
'uid=user1,ou=People,dc=example'
}
allow
(
Gitlab
::
LDAP
::
Person
).
to
receive
(
:find_by_uid
).
and_return
(
ldap_user
)
allow
(
Gitlab
::
LDAP
::
Person
).
to
receive
(
:find_by_uid
).
and_return
(
ldap_user
)
end
end
...
@@ -203,7 +203,7 @@ describe Gitlab::OAuth::User, lib: true do
...
@@ -203,7 +203,7 @@ describe Gitlab::OAuth::User, lib: true do
stub_omniauth_config
(
auto_link_ldap_user:
true
)
stub_omniauth_config
(
auto_link_ldap_user:
true
)
allow
(
ldap_user
).
to
receive
(
:uid
)
{
uid
}
allow
(
ldap_user
).
to
receive
(
:uid
)
{
uid
}
allow
(
ldap_user
).
to
receive
(
:username
)
{
uid
}
allow
(
ldap_user
).
to
receive
(
:username
)
{
uid
}
allow
(
ldap_user
).
to
receive
(
:email
)
{
[
'johndoe@example.com'
,
'john2@example.com'
]
}
allow
(
ldap_user
).
to
receive
(
:email
)
{
[
'johndoe@example.com'
,
'john2@example.com'
]
}
allow
(
ldap_user
).
to
receive
(
:dn
)
{
'uid=user1,ou=People,dc=example'
}
allow
(
ldap_user
).
to
receive
(
:dn
)
{
'uid=user1,ou=People,dc=example'
}
allow
(
oauth_user
).
to
receive
(
:ldap_person
).
and_return
(
ldap_user
)
allow
(
oauth_user
).
to
receive
(
:ldap_person
).
and_return
(
ldap_user
)
end
end
...
...
spec/requests/api/projects_spec.rb
View file @
28bafd53
...
@@ -217,7 +217,7 @@ describe API::API, api: true do
...
@@ -217,7 +217,7 @@ describe API::API, api: true do
post
api
(
'/projects'
,
user
),
project
post
api
(
'/projects'
,
user
),
project
project
.
each_pair
do
|
k
,
v
|
project
.
each_pair
do
|
k
,
v
|
expect
(
json_response
[
k
.
to_s
]).
to
eq
(
v
)
expect
(
json_response
[
k
.
to_s
]).
to
eq
(
v
)
end
end
end
end
...
@@ -325,7 +325,7 @@ describe API::API, api: true do
...
@@ -325,7 +325,7 @@ describe API::API, api: true do
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
project
.
each_pair
do
|
k
,
v
|
project
.
each_pair
do
|
k
,
v
|
next
if
k
==
:path
next
if
k
==
:path
expect
(
json_response
[
k
.
to_s
]).
to
eq
(
v
)
expect
(
json_response
[
k
.
to_s
]).
to
eq
(
v
)
end
end
...
@@ -805,7 +805,7 @@ describe API::API, api: true do
...
@@ -805,7 +805,7 @@ describe API::API, api: true do
context
'when authenticated'
do
context
'when authenticated'
do
it
'should return an array of projects'
do
it
'should return an array of projects'
do
get
api
(
"/projects/search/
#{
query
}
"
,
user
)
get
api
(
"/projects/search/
#{
query
}
"
,
user
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
size
).
to
eq
(
6
)
expect
(
json_response
.
size
).
to
eq
(
6
)
...
...
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