summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-25 15:37:04 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-25 15:37:04 +0000
commitf729f6044717635ca2dfbe054fa863d068de5c98 (patch)
treeafa470aade5624c207ef79da6c88283ff1b720e7 /app
parentde9d51eea36a084376715f043ce3fc218ffd9855 (diff)
parent69454e36f77db6f6e1c45c04c39acf670fe443e4 (diff)
downloadgitlab-ce-f729f6044717635ca2dfbe054fa863d068de5c98.tar.gz
Merge branch 'more-rubocop-styles' into 'master'
More rubocop styles See merge request !449
Diffstat (limited to 'app')
-rw-r--r--app/helpers/gitlab_markdown_helper.rb6
-rw-r--r--app/helpers/merge_requests_helper.rb2
-rw-r--r--app/helpers/submodule_helper.rb7
-rw-r--r--app/mailers/notify.rb2
-rw-r--r--app/models/project_services/asana_service.rb2
5 files changed, 11 insertions, 8 deletions
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index f8e104b0827..08221aaa2f8 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -29,7 +29,7 @@ module GitlabMarkdownHelper
end
def markdown(text, options={})
- unless (@markdown and options == @options)
+ unless @markdown && options == @options
@options = options
gitlab_renderer = Redcarpet::Render::GitlabHTML.new(self,
user_color_scheme_class,
@@ -182,7 +182,7 @@ module GitlabMarkdownHelper
def file_exists?(path)
return false if path.nil?
- return @repository.blob_at(current_sha, path).present? || @repository.tree(current_sha, path).entries.any?
+ @repository.blob_at(current_sha, path).present? || @repository.tree(current_sha, path).entries.any?
end
# Check if the path is pointing to a directory(tree) or a file(blob)
@@ -190,7 +190,7 @@ module GitlabMarkdownHelper
def local_path(path)
return "tree" if @repository.tree(current_sha, path).entries.any?
return "raw" if @repository.blob_at(current_sha, path).image?
- return "blob"
+ "blob"
end
def current_sha
diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb
index 51b60770e0b..54462fd00e3 100644
--- a/app/helpers/merge_requests_helper.rb
+++ b/app/helpers/merge_requests_helper.rb
@@ -17,7 +17,7 @@ module MergeRequestsHelper
end
def new_mr_from_push_event(event, target_project)
- return {
+ {
merge_request: {
source_project_id: event.project.id,
target_project_id: target_project.id,
diff --git a/app/helpers/submodule_helper.rb b/app/helpers/submodule_helper.rb
index 525266fb3b5..241462e5e4c 100644
--- a/app/helpers/submodule_helper.rb
+++ b/app/helpers/submodule_helper.rb
@@ -49,7 +49,7 @@ module SubmoduleHelper
def standard_links(host, namespace, project, commit)
base = [ 'https://', host, '/', namespace, '/', project ].join('')
- return base, [ base, '/tree/', commit ].join('')
+ [base, [ base, '/tree/', commit ].join('')]
end
def relative_self_links(url, commit)
@@ -58,7 +58,10 @@ module SubmoduleHelper
else
base = [ @project.group.path, '/', url[/([^\/]*)\.git/, 1] ].join('')
end
- return namespace_project_path(base.namespace, base),
+
+ [
+ namespace_project_path(base.namespace, base),
namespace_project_tree_path(base.namespace, base, commit)
+ ]
end
end
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index ee27879cf40..8fcdd3bc853 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -148,7 +148,7 @@ class Notify < ActionMailer::Base
headers['References'] = message_id(model)
headers['X-GitLab-Project'] = "#{@project.name} | " if @project
- if (headers[:subject])
+ if headers[:subject]
headers[:subject].prepend('Re: ')
end
diff --git a/app/models/project_services/asana_service.rb b/app/models/project_services/asana_service.rb
index d52214cdd69..e6e16058d41 100644
--- a/app/models/project_services/asana_service.rb
+++ b/app/models/project_services/asana_service.rb
@@ -82,7 +82,7 @@ automatically inspected. Leave blank to include all branches.'
branch_restriction = restrict_to_branch.to_s
# check the branch restriction is poplulated and branch is not included
- if branch_restriction.length > 0 && branch_restriction.index(branch) == nil
+ if branch_restriction.length > 0 && branch_restriction.index(branch).nil?
return
end