diff options
author | Ciro Santilli <ciro.santilli@gmail.com> | 2014-09-26 02:07:40 +0400 |
---|---|---|
committer | Ciro Santilli <ciro.santilli@gmail.com> | 2014-10-03 11:18:46 +0400 |
commit | 2e9f5de86896e53e9cf34aef52bbc2ad08019a21 (patch) | |
tree | 48c469b4e8a9f4596f978a2602e4d3b5cfbece86 /lib | |
parent | a3d90c5045ae322a013484165cdebcd764dc5d69 (diff) |
Add parenthesis to function def with arguments.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/helpers.rb | 2 | ||||
-rw-r--r-- | lib/event_filter.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/backend/shell.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/diff/parser.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/inline_diff.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/logger.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/reference_extractor.rb | 12 | ||||
-rw-r--r-- | lib/gitlab/satellite/satellite.rb | 2 |
8 files changed, 18 insertions, 18 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 3a619169eca..3262884f6d3 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -71,7 +71,7 @@ module API forbidden! unless current_user.is_admin? end - def authorize! action, subject + def authorize!(action, subject) unless abilities.allowed?(current_user, action, subject) forbidden! end diff --git a/lib/event_filter.rb b/lib/event_filter.rb index 9b4b8c3801a..163937c02cf 100644 --- a/lib/event_filter.rb +++ b/lib/event_filter.rb @@ -23,7 +23,7 @@ class EventFilter end end - def initialize params + def initialize(params) @params = if params params.dup else @@ -31,7 +31,7 @@ class EventFilter end end - def apply_filter events + def apply_filter(events) return events unless params.present? filter = params.dup @@ -50,7 +50,7 @@ class EventFilter events = events.where(action: actions) end - def options key + def options(key) filter = params.dup if filter.include? key @@ -62,7 +62,7 @@ class EventFilter filter end - def active? key + def active?(key) params.include? key end end diff --git a/lib/gitlab/backend/shell.rb b/lib/gitlab/backend/shell.rb index 907373ab991..f95bbde5b39 100644 --- a/lib/gitlab/backend/shell.rb +++ b/lib/gitlab/backend/shell.rb @@ -213,7 +213,7 @@ module Gitlab FileUtils.rm_r(satellites_path, force: true) end - def url_to_repo path + def url_to_repo(path) Gitlab.config.gitlab_shell.ssh_path_prefix + "#{path}.git" end diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb index 9d6309954a4..f7c1f20d762 100644 --- a/lib/gitlab/diff/parser.rb +++ b/lib/gitlab/diff/parser.rb @@ -72,7 +72,7 @@ module Gitlab end end - def html_escape str + def html_escape(str) replacements = { '&' => '&', '>' => '>', '<' => '<', '"' => '"', "'" => ''' } str.gsub(/[&"'><]/, replacements) end diff --git a/lib/gitlab/inline_diff.rb b/lib/gitlab/inline_diff.rb index 89c8e0680c3..3517ecdf5cf 100644 --- a/lib/gitlab/inline_diff.rb +++ b/lib/gitlab/inline_diff.rb @@ -5,7 +5,7 @@ module Gitlab START = "#!idiff-start!#" FINISH = "#!idiff-finish!#" - def processing diff_arr + def processing(diff_arr) indexes = _indexes_of_changed_lines diff_arr indexes.each do |index| @@ -52,7 +52,7 @@ module Gitlab diff_arr end - def _indexes_of_changed_lines diff_arr + def _indexes_of_changed_lines(diff_arr) chain_of_first_symbols = "" diff_arr.each_with_index do |line, i| chain_of_first_symbols += line[0] @@ -68,7 +68,7 @@ module Gitlab indexes end - def replace_markers line + def replace_markers(line) line.gsub!(START, "<span class='idiff'>") line.gsub!(FINISH, "</span>") line diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb index 64cf3303ea3..8a73ec5038a 100644 --- a/lib/gitlab/logger.rb +++ b/lib/gitlab/logger.rb @@ -15,7 +15,7 @@ module Gitlab tail_output.split("\n") end - def self.read_latest_for filename + def self.read_latest_for(filename) path = Rails.root.join("log", filename) tail_output, _ = Gitlab::Popen.popen(%W(tail -n 2000 #{path})) tail_output.split("\n") diff --git a/lib/gitlab/reference_extractor.rb b/lib/gitlab/reference_extractor.rb index 1eda614807f..73b19ad55d5 100644 --- a/lib/gitlab/reference_extractor.rb +++ b/lib/gitlab/reference_extractor.rb @@ -9,38 +9,38 @@ module Gitlab @users, @issues, @merge_requests, @snippets, @commits = [], [], [], [], [] end - def analyze string + def analyze(string) parse_references(string.dup) end # Given a valid project, resolve the extracted identifiers of the requested type to # model objects. - def users_for project + def users_for(project) users.map do |identifier| project.users.where(username: identifier).first end.reject(&:nil?) end - def issues_for project + def issues_for(project) issues.map do |identifier| project.issues.where(iid: identifier).first end.reject(&:nil?) end - def merge_requests_for project + def merge_requests_for(project) merge_requests.map do |identifier| project.merge_requests.where(iid: identifier).first end.reject(&:nil?) end - def snippets_for project + def snippets_for(project) snippets.map do |identifier| project.snippets.where(id: identifier).first end.reject(&:nil?) end - def commits_for project + def commits_for(project) repo = project.repository return [] if repo.nil? diff --git a/lib/gitlab/satellite/satellite.rb b/lib/gitlab/satellite/satellite.rb index f34d661c9fc..1de84309d15 100644 --- a/lib/gitlab/satellite/satellite.rb +++ b/lib/gitlab/satellite/satellite.rb @@ -11,7 +11,7 @@ module Gitlab @project = project end - def log message + def log(message) Gitlab::Satellite::Logger.error(message) end |