diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-22 02:29:35 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 18:31:56 +0300 |
commit | 3dadf306ddc81183e74b048bc4119796852ed7ea (patch) | |
tree | f01d5e7eb9c5550bc34a42d9e88479cd3fef578d /lib/gitlab | |
parent | 547063b3ac096dff25309b6e0846b0d5f417c128 (diff) |
Enable Style/DotPosition
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/badge/build/status.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/badge/coverage/report.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/bitbucket_import/importer.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/checks/matching_merge_request.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/configurable.rb | 10 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/global.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/jobs.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/status/factory.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/trace_reader.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/git/encoding_helper.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/github_import/importer.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/github_import/user_formatter.rb | 14 |
12 files changed, 45 insertions, 45 deletions
diff --git a/lib/gitlab/badge/build/status.rb b/lib/gitlab/badge/build/status.rb index b762d85b6e5..3c65fd02e4c 100644 --- a/lib/gitlab/badge/build/status.rb +++ b/lib/gitlab/badge/build/status.rb @@ -19,9 +19,9 @@ module Gitlab end def status - @project.pipelines - .where(sha: @sha) - .latest_status(@ref) || 'unknown' + @project.pipelines. + where(sha: @sha). + latest_status(@ref) || 'unknown' end def metadata diff --git a/lib/gitlab/badge/coverage/report.rb b/lib/gitlab/badge/coverage/report.rb index 9a0482306b7..8a6564755ab 100644 --- a/lib/gitlab/badge/coverage/report.rb +++ b/lib/gitlab/badge/coverage/report.rb @@ -42,9 +42,9 @@ module Gitlab if @job.blank? @pipeline.coverage else - @pipeline.builds - .find_by(name: @job) - .try(:coverage) + @pipeline.builds. + find_by(name: @job). + try(:coverage) end end end diff --git a/lib/gitlab/bitbucket_import/importer.rb b/lib/gitlab/bitbucket_import/importer.rb index 44323b47dca..03a7981b1db 100644 --- a/lib/gitlab/bitbucket_import/importer.rb +++ b/lib/gitlab/bitbucket_import/importer.rb @@ -48,10 +48,10 @@ module Gitlab return users[username] if users.key?(username) - users[username] = User.select(:id) - .joins(:identities) - .find_by("identities.extern_uid = ? AND identities.provider = 'bitbucket'", username) - .try(:id) + users[username] = User.select(:id). + joins(:identities). + find_by("identities.extern_uid = ? AND identities.provider = 'bitbucket'", username). + try(:id) end def repo diff --git a/lib/gitlab/checks/matching_merge_request.rb b/lib/gitlab/checks/matching_merge_request.rb index 849848515da..bd295c25194 100644 --- a/lib/gitlab/checks/matching_merge_request.rb +++ b/lib/gitlab/checks/matching_merge_request.rb @@ -8,10 +8,10 @@ module Gitlab end def match? - @project.merge_requests - .with_state(:locked) - .where(in_progress_merge_commit_sha: @newrev, target_branch: @branch_name) - .exists? + @project.merge_requests. + with_state(:locked). + where(in_progress_merge_commit_sha: @newrev, target_branch: @branch_name). + exists? end end end diff --git a/lib/gitlab/ci/config/entry/configurable.rb b/lib/gitlab/ci/config/entry/configurable.rb index e05aca9881b..deaaf06bbd7 100644 --- a/lib/gitlab/ci/config/entry/configurable.rb +++ b/lib/gitlab/ci/config/entry/configurable.rb @@ -27,9 +27,9 @@ module Gitlab return unless valid? self.class.nodes.each do |key, factory| - factory - .value(@config[key]) - .with(key: key, parent: self) + factory. + value(@config[key]). + with(key: key, parent: self) @entries[key] = factory.create! end @@ -49,8 +49,8 @@ module Gitlab private # rubocop:disable Lint/UselessAccessModifier def entry(key, entry, metadata) - factory = Entry::Factory.new(entry) - .with(description: metadata[:description]) + factory = Entry::Factory.new(entry). + with(description: metadata[:description]) (@nodes ||= {}).merge!(key.to_sym => factory) end diff --git a/lib/gitlab/ci/config/entry/global.rb b/lib/gitlab/ci/config/entry/global.rb index a4ec8f0ff2f..8154beea21f 100644 --- a/lib/gitlab/ci/config/entry/global.rb +++ b/lib/gitlab/ci/config/entry/global.rb @@ -46,9 +46,9 @@ module Gitlab private def compose_jobs! - factory = Entry::Factory.new(Entry::Jobs) - .value(@config.except(*self.class.nodes.keys)) - .with(key: :jobs, parent: self, + factory = Entry::Factory.new(Entry::Jobs). + value(@config.except(*self.class.nodes.keys)). + with(key: :jobs, parent: self, description: 'Jobs definition for this pipeline') @entries[:jobs] = factory.create! diff --git a/lib/gitlab/ci/config/entry/jobs.rb b/lib/gitlab/ci/config/entry/jobs.rb index 5671a09480b..41de7dbbb3e 100644 --- a/lib/gitlab/ci/config/entry/jobs.rb +++ b/lib/gitlab/ci/config/entry/jobs.rb @@ -31,10 +31,10 @@ module Gitlab @config.each do |name, config| node = hidden?(name) ? Entry::Hidden : Entry::Job - factory = Entry::Factory.new(node) - .value(config || {}) - .metadata(name: name) - .with(key: name, parent: self, + factory = Entry::Factory.new(node). + value(config || {}). + metadata(name: name). + with(key: name, parent: self, description: "#{name} job definition.") @entries[name] = factory.create! diff --git a/lib/gitlab/ci/status/factory.rb b/lib/gitlab/ci/status/factory.rb index 15836c699c7..efe756cc585 100644 --- a/lib/gitlab/ci/status/factory.rb +++ b/lib/gitlab/ci/status/factory.rb @@ -17,10 +17,10 @@ module Gitlab end def core_status - Gitlab::Ci::Status - .const_get(@status.capitalize) - .new(@subject, @user) - .extend(self.class.common_helpers) + Gitlab::Ci::Status. + const_get(@status.capitalize). + new(@subject, @user). + extend(self.class.common_helpers) end def compound_extended_status diff --git a/lib/gitlab/ci/trace_reader.rb b/lib/gitlab/ci/trace_reader.rb index 1d7ddeb3e0f..dd6a84d7d1c 100644 --- a/lib/gitlab/ci/trace_reader.rb +++ b/lib/gitlab/ci/trace_reader.rb @@ -41,8 +41,8 @@ module Gitlab chunks.unshift(buf) end - chunks.join.lines.last(max_lines).join - .force_encoding(Encoding.default_external) + chunks.join.lines.last(max_lines).join. + force_encoding(Encoding.default_external) end end end diff --git a/lib/gitlab/git/encoding_helper.rb b/lib/gitlab/git/encoding_helper.rb index e57d228e688..874fd8fe6e2 100644 --- a/lib/gitlab/git/encoding_helper.rb +++ b/lib/gitlab/git/encoding_helper.rb @@ -49,9 +49,9 @@ module Gitlab private def clean(message) - message.encode("UTF-16BE", undef: :replace, invalid: :replace, replace: "") - .encode("UTF-8") - .gsub("\0".encode("UTF-8"), "") + message.encode("UTF-16BE", undef: :replace, invalid: :replace, replace: ""). + encode("UTF-8"). + gsub("\0".encode("UTF-8"), "") end end end diff --git a/lib/gitlab/github_import/importer.rb b/lib/gitlab/github_import/importer.rb index d95ff4fd104..a631425b3cf 100644 --- a/lib/gitlab/github_import/importer.rb +++ b/lib/gitlab/github_import/importer.rb @@ -178,9 +178,9 @@ module Gitlab def apply_labels(issuable, raw) return unless raw.labels.count > 0 - label_ids = raw.labels - .map { |attrs| @labels[attrs.name] } - .compact + label_ids = raw.labels. + map { |attrs| @labels[attrs.name] }. + compact issuable.update_attribute(:label_ids, label_ids) end diff --git a/lib/gitlab/github_import/user_formatter.rb b/lib/gitlab/github_import/user_formatter.rb index 04c2964da20..7f3bf0052a7 100644 --- a/lib/gitlab/github_import/user_formatter.rb +++ b/lib/gitlab/github_import/user_formatter.rb @@ -25,8 +25,8 @@ module Gitlab def find_by_email return nil unless email - User.find_by_any_email(email) - .try(:id) + User.find_by_any_email(email). + try(:id) end def find_by_external_uid @@ -34,11 +34,11 @@ module Gitlab identities = ::Identity.arel_table - User.select(:id) - .joins(:identities).where(identities[:provider].eq(:github) - .and(identities[:extern_uid].eq(id))) - .first - .try(:id) + User.select(:id). + joins(:identities).where(identities[:provider].eq(:github). + and(identities[:extern_uid].eq(id))). + first. + try(:id) end end end |