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
e21257f7
Commit
e21257f7
authored
Feb 13, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zj-ruby-2-1-no-more' into 'master'
[EE] Update Rubocop to Ruby 2.3 See merge request !1195
parents
251d0116
6155d8e7
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
38 additions
and
52 deletions
+38
-52
.rubocop.yml
.rubocop.yml
+1
-1
app/helpers/kerberos_spnego_helper.rb
app/helpers/kerberos_spnego_helper.rb
+1
-1
app/mailers/notify.rb
app/mailers/notify.rb
+1
-1
app/models/application_setting.rb
app/models/application_setting.rb
+11
-17
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+2
-2
app/models/concerns/milestoneish.rb
app/models/concerns/milestoneish.rb
+1
-1
app/models/environment.rb
app/models/environment.rb
+1
-1
app/models/geo_node.rb
app/models/geo_node.rb
+1
-1
app/models/group_milestone.rb
app/models/group_milestone.rb
+1
-1
app/models/repository.rb
app/models/repository.rb
+1
-3
app/models/user.rb
app/models/user.rb
+1
-1
app/models/wiki_page.rb
app/models/wiki_page.rb
+2
-6
app/services/create_tag_service.rb
app/services/create_tag_service.rb
+1
-1
app/services/delete_tag_service.rb
app/services/delete_tag_service.rb
+1
-1
app/services/issues/create_service.rb
app/services/issues/create_service.rb
+1
-1
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+1
-1
app/workers/authorized_projects_worker.rb
app/workers/authorized_projects_worker.rb
+1
-1
lib/api/branches.rb
lib/api/branches.rb
+1
-1
lib/api/entities.rb
lib/api/entities.rb
+1
-3
lib/gitlab/ci/config/entry/configurable.rb
lib/gitlab/ci/config/entry/configurable.rb
+1
-1
lib/gitlab/email/message/repository_push.rb
lib/gitlab/email/message/repository_push.rb
+2
-2
lib/gitlab/git/blob_snippet.rb
lib/gitlab/git/blob_snippet.rb
+1
-1
lib/gitlab/metrics.rb
lib/gitlab/metrics.rb
+3
-3
No files found.
.rubocop.yml
View file @
e21257f7
...
...
@@ -5,7 +5,7 @@ require:
inherit_from
:
.rubocop_todo.yml
AllCops
:
TargetRubyVersion
:
2.
1
TargetRubyVersion
:
2.
3
# Cop names are not d§splayed in offense messages by default. Change behavior
# by overriding DisplayCopNames, or by giving the -D/--display-cop-names
# option.
...
...
app/helpers/kerberos_spnego_helper.rb
View file @
e21257f7
...
...
@@ -46,7 +46,7 @@ module KerberosSpnegoHelper
return
unless
krb_principal
identity
=
::
Identity
.
find_by
(
provider: :kerberos
,
extern_uid:
krb_principal
)
identity
.
user
if
identity
identity
&
.
user
end
# The Kerberos backend will translate spnego_token into a Kerberos
...
...
app/mailers/notify.rb
View file @
e21257f7
...
...
@@ -152,7 +152,7 @@ class Notify < BaseMailer
headers
[
'In-Reply-To'
]
=
message_id
(
model
)
headers
[
'References'
]
=
message_id
(
model
)
headers
[
:subject
]
.
prepend
(
'Re: '
)
if
headers
[
:subject
]
headers
[
:subject
]
&
.
prepend
(
'Re: '
)
mail_thread
(
model
,
headers
)
end
...
...
app/models/application_setting.rb
View file @
e21257f7
...
...
@@ -129,31 +129,25 @@ class ApplicationSetting < ActiveRecord::Base
numericality:
{
only_integer:
true
,
greater_than_or_equal_to:
0
}
validates_each
:restricted_visibility_levels
do
|
record
,
attr
,
value
|
unless
value
.
nil?
value
.
each
do
|
level
|
unless
Gitlab
::
VisibilityLevel
.
options
.
has_value?
(
level
)
record
.
errors
.
add
(
attr
,
"'
#{
level
}
' is not a valid visibility level"
)
end
value
&
.
each
do
|
level
|
unless
Gitlab
::
VisibilityLevel
.
options
.
has_value?
(
level
)
record
.
errors
.
add
(
attr
,
"'
#{
level
}
' is not a valid visibility level"
)
end
end
end
validates_each
:import_sources
do
|
record
,
attr
,
value
|
unless
value
.
nil?
value
.
each
do
|
source
|
unless
Gitlab
::
ImportSources
.
options
.
has_value?
(
source
)
record
.
errors
.
add
(
attr
,
"'
#{
source
}
' is not a import source"
)
end
value
&
.
each
do
|
source
|
unless
Gitlab
::
ImportSources
.
options
.
has_value?
(
source
)
record
.
errors
.
add
(
attr
,
"'
#{
source
}
' is not a import source"
)
end
end
end
validates_each
:disabled_oauth_sign_in_sources
do
|
record
,
attr
,
value
|
unless
value
.
nil?
value
.
each
do
|
source
|
unless
Devise
.
omniauth_providers
.
include?
(
source
.
to_sym
)
record
.
errors
.
add
(
attr
,
"'
#{
source
}
' is not an OAuth sign-in source"
)
end
value
&
.
each
do
|
source
|
unless
Devise
.
omniauth_providers
.
include?
(
source
.
to_sym
)
record
.
errors
.
add
(
attr
,
"'
#{
source
}
' is not an OAuth sign-in source"
)
end
end
end
...
...
@@ -255,11 +249,11 @@ class ApplicationSetting < ActiveRecord::Base
end
def
domain_whitelist_raw
self
.
domain_whitelist
.
join
(
"
\n
"
)
unless
self
.
domain_whitelist
.
nil?
self
.
domain_whitelist
&
.
join
(
"
\n
"
)
end
def
domain_blacklist_raw
self
.
domain_blacklist
.
join
(
"
\n
"
)
unless
self
.
domain_blacklist
.
nil?
self
.
domain_blacklist
&
.
join
(
"
\n
"
)
end
def
domain_whitelist_raw
=
(
values
)
...
...
app/models/concerns/issuable.rb
View file @
e21257f7
...
...
@@ -98,8 +98,8 @@ module Issuable
def
update_assignee_cache_counts
# make sure we flush the cache for both the old *and* new assignees(if they exist)
previous_assignee
=
User
.
find_by_id
(
assignee_id_was
)
if
assignee_id_was
previous_assignee
.
update_cache_counts
if
previous_assignee
assignee
.
update_cache_counts
if
assignee
previous_assignee
&
.
update_cache_counts
assignee
&
.
update_cache_counts
end
# We want to use optimistic lock for cases when only title or description are involved
...
...
app/models/concerns/milestoneish.rb
View file @
e21257f7
...
...
@@ -73,7 +73,7 @@ module Milestoneish
def
memoize_per_user
(
user
,
method_name
)
@memoized
||=
{}
@memoized
[
method_name
]
||=
{}
@memoized
[
method_name
][
user
.
try!
(
:id
)
]
||=
yield
@memoized
[
method_name
][
user
&
.
id
]
||=
yield
end
# override in a class that includes this module to get a faster query
...
...
app/models/environment.rb
View file @
e21257f7
...
...
@@ -126,7 +126,7 @@ class Environment < ActiveRecord::Base
return
unless
available?
stop!
stop_action
.
play
(
current_user
)
if
stop_action
stop_action
&
.
play
(
current_user
)
end
def
actions_for
(
environment
)
...
...
app/models/geo_node.rb
View file @
e21257f7
...
...
@@ -95,7 +95,7 @@ class GeoNode < ActiveRecord::Base
end
def
update_dependents_attributes
self
.
geo_node_key
.
title
=
"Geo node:
#{
self
.
url
}
"
if
self
.
geo_node_key
self
.
geo_node_key
&
.
title
=
"Geo node:
#{
self
.
url
}
"
if
self
.
primary?
self
.
oauth_application
=
nil
...
...
app/models/group_milestone.rb
View file @
e21257f7
...
...
@@ -9,7 +9,7 @@ class GroupMilestone < GlobalMilestone
def
self
.
build
(
group
,
projects
,
title
)
super
(
projects
,
title
).
tap
do
|
milestone
|
milestone
.
group
=
group
if
milestone
milestone
&
.
group
=
group
end
end
...
...
app/models/repository.rb
View file @
e21257f7
...
...
@@ -945,9 +945,7 @@ class Repository
GitOperationService
.
new
(
user
,
self
).
with_branch
(
target_branch
)
do
|
start_commit
|
if
merge_request
merge_request
.
update
(
in_progress_merge_commit_sha:
their_commit
.
oid
)
end
merge_request
&
.
update
(
in_progress_merge_commit_sha:
their_commit
.
oid
)
their_commit
.
oid
end
...
...
app/models/user.rb
View file @
e21257f7
...
...
@@ -334,7 +334,7 @@ class User < ActiveRecord::Base
def
find_by_personal_access_token
(
token_string
)
personal_access_token
=
PersonalAccessToken
.
active
.
find_by_token
(
token_string
)
if
token_string
personal_access_token
.
user
if
personal_access_token
personal_access_token
&
.
user
end
# Returns a user for the given SSH key.
...
...
app/models/wiki_page.rb
View file @
e21257f7
...
...
@@ -69,16 +69,12 @@ class WikiPage
# The raw content of this page.
def
content
@attributes
[
:content
]
||=
if
@page
@page
.
text_data
end
@attributes
[
:content
]
||=
@page
&
.
text_data
end
# The processed/formatted content of this page.
def
formatted_content
@attributes
[
:formatted_content
]
||=
if
@page
@page
.
formatted_data
end
@attributes
[
:formatted_content
]
||=
@page
&
.
formatted_data
end
# The markup format for the page.
...
...
app/services/create_tag_service.rb
View file @
e21257f7
...
...
@@ -4,7 +4,7 @@ class CreateTagService < BaseService
return
error
(
'Tag name invalid'
)
unless
valid_tag
repository
=
project
.
repository
message
.
strip!
if
message
message
&
.
strip!
new_tag
=
nil
...
...
app/services/delete_tag_service.rb
View file @
e21257f7
...
...
@@ -9,7 +9,7 @@ class DeleteTagService < BaseService
if
repository
.
rm_tag
(
current_user
,
tag_name
)
release
=
project
.
releases
.
find_by
(
tag:
tag_name
)
release
.
destroy
if
release
release
&
.
destroy
push_data
=
build_push_data
(
tag
)
EventCreateService
.
new
.
push
(
project
,
current_user
,
push_data
)
...
...
app/services/issues/create_service.rb
View file @
e21257f7
...
...
@@ -15,7 +15,7 @@ module Issues
def
before_create
(
issuable
)
if
@recaptcha_verified
spam_log
=
current_user
.
spam_logs
.
find_by
(
id:
@spam_log_id
,
title:
issuable
.
title
)
spam_log
.
update!
(
recaptcha_verified:
true
)
if
spam_log
spam_log
&
.
update!
(
recaptcha_verified:
true
)
else
issuable
.
spam
=
spam_service
.
check
(
@api
)
issuable
.
spam_log
=
spam_service
.
spam_log
...
...
app/services/projects/create_service.rb
View file @
e21257f7
...
...
@@ -107,7 +107,7 @@ module Projects
project
.
push_rule
=
push_rule
end
@project
.
group
.
refresh_members_authorized_projects
if
@project
.
group
@project
.
group
&
.
refresh_members_authorized_projects
end
def
skip_wiki?
...
...
app/workers/authorized_projects_worker.rb
View file @
e21257f7
...
...
@@ -16,6 +16,6 @@ class AuthorizedProjectsWorker
def
perform
(
user_id
)
user
=
User
.
find_by
(
id:
user_id
)
user
.
refresh_authorized_projects
if
user
user
&
.
refresh_authorized_projects
end
end
lib/api/branches.rb
View file @
e21257f7
...
...
@@ -84,7 +84,7 @@ module API
branch
=
user_project
.
repository
.
find_branch
(
params
[
:branch
])
not_found!
(
"Branch"
)
unless
branch
protected_branch
=
user_project
.
protected_branches
.
find_by
(
name:
branch
.
name
)
protected_branch
.
destroy
if
protected_branch
protected_branch
&
.
destroy
present
branch
,
with:
Entities
::
RepoBranch
,
project:
user_project
end
...
...
lib/api/entities.rb
View file @
e21257f7
...
...
@@ -429,9 +429,7 @@ module API
expose
:author
,
using:
Entities
::
UserBasic
,
if:
->
(
event
,
options
)
{
event
.
author
}
expose
:author_username
do
|
event
,
options
|
if
event
.
author
event
.
author
.
username
end
event
.
author
&
.
username
end
end
...
...
lib/gitlab/ci/config/entry/configurable.rb
View file @
e21257f7
...
...
@@ -58,7 +58,7 @@ module Gitlab
def
helpers
(
*
nodes
)
nodes
.
each
do
|
symbol
|
define_method
(
"
#{
symbol
}
_defined?"
)
do
@entries
[
symbol
]
.
specified?
if
@entries
[
symbol
]
@entries
[
symbol
]
&
.
specified?
end
define_method
(
"
#{
symbol
}
_value"
)
do
...
...
lib/gitlab/email/message/repository_push.rb
View file @
e21257f7
...
...
@@ -46,7 +46,7 @@ module Gitlab
end
def
diffs_count
diffs
.
size
if
diffs
diffs
&
.
size
end
def
compare
...
...
@@ -58,7 +58,7 @@ module Gitlab
end
def
compare_timeout
diffs
.
overflow?
if
diffs
diffs
&
.
overflow?
end
def
reverse_compare?
...
...
lib/gitlab/git/blob_snippet.rb
View file @
e21257f7
...
...
@@ -13,7 +13,7 @@ module Gitlab
end
def
data
lines
.
join
(
"
\n
"
)
if
lines
lines
&
.
join
(
"
\n
"
)
end
def
name
...
...
lib/gitlab/metrics.rb
View file @
e21257f7
...
...
@@ -112,7 +112,7 @@ module Gitlab
def
self
.
tag_transaction
(
name
,
value
)
trans
=
current_transaction
trans
.
add_tag
(
name
,
value
)
if
trans
trans
&
.
add_tag
(
name
,
value
)
end
# Sets the action of the current transaction (if any)
...
...
@@ -121,7 +121,7 @@ module Gitlab
def
self
.
action
=
(
action
)
trans
=
current_transaction
trans
.
action
=
action
if
trans
trans
&
.
action
=
action
end
# Tracks an event.
...
...
@@ -130,7 +130,7 @@ module Gitlab
def
self
.
add_event
(
*
args
)
trans
=
current_transaction
trans
.
add_event
(
*
args
)
if
trans
trans
&
.
add_event
(
*
args
)
end
# Returns the prefix to use for the name of a series.
...
...
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