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
Jérome Perrin
gitlab-ce
Commits
2b075f16
Commit
2b075f16
authored
Oct 03, 2015
by
Guilherme Garnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rubocop warnings in app
parent
0406455c
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
29 additions
and
42 deletions
+29
-42
app/controllers/ci/lints_controller.rb
app/controllers/ci/lints_controller.rb
+1
-1
app/controllers/omniauth_callbacks_controller.rb
app/controllers/omniauth_callbacks_controller.rb
+2
-2
app/controllers/projects/wikis_controller.rb
app/controllers/projects/wikis_controller.rb
+1
-1
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+1
-1
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-1
app/models/ci/build.rb
app/models/ci/build.rb
+3
-3
app/models/ci/project.rb
app/models/ci/project.rb
+1
-1
app/models/merge_request_diff.rb
app/models/merge_request_diff.rb
+3
-5
app/models/project.rb
app/models/project.rb
+2
-2
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+10
-15
app/models/repository.rb
app/models/repository.rb
+1
-1
app/models/user.rb
app/models/user.rb
+1
-7
app/services/files/base_service.rb
app/services/files/base_service.rb
+1
-1
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+1
-1
No files found.
app/controllers/ci/lints_controller.rb
View file @
2b075f16
...
@@ -18,7 +18,7 @@ module Ci
...
@@ -18,7 +18,7 @@ module Ci
rescue
Ci
::
GitlabCiYamlProcessor
::
ValidationError
=>
e
rescue
Ci
::
GitlabCiYamlProcessor
::
ValidationError
=>
e
@error
=
e
.
message
@error
=
e
.
message
@status
=
false
@status
=
false
rescue
Exception
=>
e
rescue
Exception
@error
=
"Undefined error"
@error
=
"Undefined error"
@status
=
false
@status
=
false
end
end
...
...
app/controllers/omniauth_callbacks_controller.rb
View file @
2b075f16
...
@@ -71,7 +71,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
...
@@ -71,7 +71,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
redirect_to
omniauth_error_path
(
oauth
[
'provider'
],
error:
error_message
)
and
return
redirect_to
omniauth_error_path
(
oauth
[
'provider'
],
error:
error_message
)
and
return
end
end
end
end
rescue
Gitlab
::
OAuth
::
SignupDisabledError
=>
e
rescue
Gitlab
::
OAuth
::
SignupDisabledError
label
=
Gitlab
::
OAuth
::
Provider
.
label_for
(
oauth
[
'provider'
])
label
=
Gitlab
::
OAuth
::
Provider
.
label_for
(
oauth
[
'provider'
])
message
=
"Signing in using your
#{
label
}
account without a pre-existing GitLab account is not allowed."
message
=
"Signing in using your
#{
label
}
account without a pre-existing GitLab account is not allowed."
...
...
app/controllers/projects/wikis_controller.rb
View file @
2b075f16
...
@@ -98,7 +98,7 @@ class Projects::WikisController < Projects::ApplicationController
...
@@ -98,7 +98,7 @@ class Projects::WikisController < Projects::ApplicationController
# Call #wiki to make sure the Wiki Repo is initialized
# Call #wiki to make sure the Wiki Repo is initialized
@project_wiki
.
wiki
@project_wiki
.
wiki
rescue
ProjectWiki
::
CouldNotCreateWikiError
=>
ex
rescue
ProjectWiki
::
CouldNotCreateWikiError
flash
[
:notice
]
=
"Could not create Wiki Repository at this time. Please try again later."
flash
[
:notice
]
=
"Could not create Wiki Repository at this time. Please try again later."
redirect_to
project_path
(
@project
)
redirect_to
project_path
(
@project
)
return
false
return
false
...
...
app/finders/issuable_finder.rb
View file @
2b075f16
...
@@ -39,7 +39,7 @@ class IssuableFinder
...
@@ -39,7 +39,7 @@ class IssuableFinder
items
=
by_assignee
(
items
)
items
=
by_assignee
(
items
)
items
=
by_author
(
items
)
items
=
by_author
(
items
)
items
=
by_label
(
items
)
items
=
by_label
(
items
)
items
=
sort
(
items
)
sort
(
items
)
end
end
def
group
def
group
...
...
app/helpers/application_helper.rb
View file @
2b075f16
...
@@ -35,7 +35,7 @@ module ApplicationHelper
...
@@ -35,7 +35,7 @@ module ApplicationHelper
def
project_icon
(
project_id
,
options
=
{})
def
project_icon
(
project_id
,
options
=
{})
project
=
project
=
if
project_id
.
is_a?
(
Project
)
if
project_id
.
is_a?
(
Project
)
project
=
project
_id
project_id
else
else
Project
.
find_with_namespace
(
project_id
)
Project
.
find_with_namespace
(
project_id
)
end
end
...
...
app/models/ci/build.rb
View file @
2b075f16
...
@@ -140,7 +140,7 @@ module Ci
...
@@ -140,7 +140,7 @@ module Ci
def
trace_html
def
trace_html
html
=
Ci
::
Ansi2html
::
convert
(
trace
)
if
trace
.
present?
html
=
Ci
::
Ansi2html
::
convert
(
trace
)
if
trace
.
present?
html
||
=
''
html
||
''
end
end
def
started?
def
started?
...
@@ -211,7 +211,7 @@ module Ci
...
@@ -211,7 +211,7 @@ module Ci
if
coverage
.
present?
if
coverage
.
present?
coverage
.
to_f
coverage
.
to_f
end
end
rescue
=>
ex
rescue
# if bad regex or something goes wrong we dont want to interrupt transition
# if bad regex or something goes wrong we dont want to interrupt transition
# so we just silentrly ignore error for now
# so we just silentrly ignore error for now
end
end
...
...
app/models/ci/project.rb
View file @
2b075f16
...
@@ -184,7 +184,7 @@ module Ci
...
@@ -184,7 +184,7 @@ module Ci
# If service is available but missing in db
# If service is available but missing in db
# we should create an instance. Ex `create_gitlab_ci_service`
# we should create an instance. Ex `create_gitlab_ci_service`
se
rvice
=
se
lf
.
send
:"create_
#{
service_name
}
_service"
if
service
.
nil?
self
.
send
:"create_
#{
service_name
}
_service"
if
service
.
nil?
end
end
end
end
...
...
app/models/merge_request_diff.rb
View file @
2b075f16
...
@@ -144,12 +144,10 @@ class MergeRequestDiff < ActiveRecord::Base
...
@@ -144,12 +144,10 @@ class MergeRequestDiff < ActiveRecord::Base
# Collect array of Git::Diff objects
# Collect array of Git::Diff objects
# between target and source branches
# between target and source branches
def
unmerged_diffs
def
unmerged_diffs
diffs
=
compare_result
.
diffs
compare_result
.
diffs
||
[]
diffs
||=
[]
rescue
Gitlab
::
Git
::
Diff
::
TimeoutError
diffs
rescue
Gitlab
::
Git
::
Diff
::
TimeoutError
=>
ex
self
.
state
=
:timeout
self
.
state
=
:timeout
diffs
=
[]
[]
end
end
def
repository
def
repository
...
...
app/models/project.rb
View file @
2b075f16
...
@@ -413,7 +413,7 @@ class Project < ActiveRecord::Base
...
@@ -413,7 +413,7 @@ class Project < ActiveRecord::Base
if
template
.
nil?
if
template
.
nil?
# If no template, we should create an instance. Ex `create_gitlab_ci_service`
# If no template, we should create an instance. Ex `create_gitlab_ci_service`
se
rvice
=
se
lf
.
send
:"create_
#{
service_name
}
_service"
self
.
send
:"create_
#{
service_name
}
_service"
else
else
Service
.
create_from_template
(
self
.
id
,
template
)
Service
.
create_from_template
(
self
.
id
,
template
)
end
end
...
@@ -738,7 +738,7 @@ class Project < ActiveRecord::Base
...
@@ -738,7 +738,7 @@ class Project < ActiveRecord::Base
def
create_wiki
def
create_wiki
ProjectWiki
.
new
(
self
,
self
.
owner
).
wiki
ProjectWiki
.
new
(
self
,
self
.
owner
).
wiki
true
true
rescue
ProjectWiki
::
CouldNotCreateWikiError
=>
ex
rescue
ProjectWiki
::
CouldNotCreateWikiError
errors
.
add
(
:base
,
'Failed create wiki'
)
errors
.
add
(
:base
,
'Failed create wiki'
)
false
false
end
end
...
...
app/models/project_services/hipchat_service.rb
View file @
2b075f16
...
@@ -85,7 +85,6 @@ class HipchatService < Service
...
@@ -85,7 +85,6 @@ class HipchatService < Service
def
create_message
(
data
)
def
create_message
(
data
)
object_kind
=
data
[
:object_kind
]
object_kind
=
data
[
:object_kind
]
message
=
\
case
object_kind
case
object_kind
when
"push"
,
"tag_push"
when
"push"
,
"tag_push"
create_push_message
(
data
)
create_push_message
(
data
)
...
@@ -167,8 +166,6 @@ class HipchatService < Service
...
@@ -167,8 +166,6 @@ class HipchatService < Service
obj_attr
=
data
[
:object_attributes
]
obj_attr
=
data
[
:object_attributes
]
obj_attr
=
HashWithIndifferentAccess
.
new
(
obj_attr
)
obj_attr
=
HashWithIndifferentAccess
.
new
(
obj_attr
)
merge_request_id
=
obj_attr
[
:iid
]
merge_request_id
=
obj_attr
[
:iid
]
source_branch
=
obj_attr
[
:source_branch
]
target_branch
=
obj_attr
[
:target_branch
]
state
=
obj_attr
[
:state
]
state
=
obj_attr
[
:state
]
description
=
obj_attr
[
:description
]
description
=
obj_attr
[
:description
]
title
=
obj_attr
[
:title
]
title
=
obj_attr
[
:title
]
...
@@ -194,8 +191,6 @@ class HipchatService < Service
...
@@ -194,8 +191,6 @@ class HipchatService < Service
data
=
HashWithIndifferentAccess
.
new
(
data
)
data
=
HashWithIndifferentAccess
.
new
(
data
)
user_name
=
data
[
:user
][
:name
]
user_name
=
data
[
:user
][
:name
]
repo_attr
=
HashWithIndifferentAccess
.
new
(
data
[
:repository
])
obj_attr
=
HashWithIndifferentAccess
.
new
(
data
[
:object_attributes
])
obj_attr
=
HashWithIndifferentAccess
.
new
(
data
[
:object_attributes
])
note
=
obj_attr
[
:note
]
note
=
obj_attr
[
:note
]
note_url
=
obj_attr
[
:url
]
note_url
=
obj_attr
[
:url
]
...
...
app/models/repository.rb
View file @
2b075f16
...
@@ -549,7 +549,7 @@ class Repository
...
@@ -549,7 +549,7 @@ class Repository
# Run GitLab post receive hook
# Run GitLab post receive hook
post_receive_hook
=
Gitlab
::
Git
::
Hook
.
new
(
'post-receive'
,
path_to_repo
)
post_receive_hook
=
Gitlab
::
Git
::
Hook
.
new
(
'post-receive'
,
path_to_repo
)
status
=
post_receive_hook
.
trigger
(
gl_id
,
oldrev
,
newrev
,
ref
)
post_receive_hook
.
trigger
(
gl_id
,
oldrev
,
newrev
,
ref
)
else
else
# Remove tmp ref and return error to user
# Remove tmp ref and return error to user
rugged
.
references
.
delete
(
tmp_ref
)
rugged
.
references
.
delete
(
tmp_ref
)
...
...
app/models/user.rb
View file @
2b075f16
...
@@ -701,13 +701,7 @@ class User < ActiveRecord::Base
...
@@ -701,13 +701,7 @@ class User < ActiveRecord::Base
end
end
def
manageable_namespaces
def
manageable_namespaces
@manageable_namespaces
||=
@manageable_namespaces
||=
[
namespace
]
+
owned_groups
+
masters_groups
begin
namespaces
=
[]
namespaces
<<
namespace
namespaces
+=
owned_groups
namespaces
+=
masters_groups
end
end
end
def
namespaces
def
namespaces
...
...
app/services/files/base_service.rb
View file @
2b075f16
...
@@ -21,7 +21,7 @@ module Files
...
@@ -21,7 +21,7 @@ module Files
create_target_branch
create_target_branch
end
end
if
sha
=
commit
if
commit
success
success
else
else
error
(
"Something went wrong. Your changes were not committed"
)
error
(
"Something went wrong. Your changes were not committed"
)
...
...
app/services/projects/create_service.rb
View file @
2b075f16
...
@@ -62,7 +62,7 @@ module Projects
...
@@ -62,7 +62,7 @@ module Projects
after_create_actions
if
@project
.
persisted?
after_create_actions
if
@project
.
persisted?
@project
@project
rescue
=>
ex
rescue
@project
.
errors
.
add
(
:base
,
"Can't save project. Please try again later"
)
@project
.
errors
.
add
(
:base
,
"Can't save project. Please try again later"
)
@project
@project
end
end
...
...
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