From 4ef0033953e943dc803d2f243f48cd1094fbe1b0 Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Wed, 4 Nov 2015 22:08:37 +0100 Subject: [PATCH] Rubocop: just use the simple symbol proc invocation mechanism --- .rubocop_todo.yml | 9 --------- app/controllers/users/omniauth_callbacks_controller.rb | 2 +- app/models/deploy.rb | 2 +- spec/models/deploy_spec.rb | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index eb9a8a5..74909e9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -275,12 +275,3 @@ Style/SingleSpaceBeforeFirstArg: # Configuration parameters: EnforcedStyle, SupportedStyles. Style/StringLiterals: Enabled: false - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -Style/SymbolProc: - Exclude: - - 'app/controllers/users/omniauth_callbacks_controller.rb' - - 'app/models/deploy.rb' - - 'spec/models/deploy_spec.rb' diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 8e02d35..1c3d50f 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -10,7 +10,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController # If they are, automatically create an account client = Octokit::Client.new(access_token: github_token) client.api_endpoint = Errbit::Config.github_api_url - org_ids = client.organizations.map { |org| org.id } + org_ids = client.organizations.map(&:id) if org_ids.include?(github_org_id) github_user = User.create(name: env["omniauth.auth"].extra.raw_info.name, email: env["omniauth.auth"].extra.raw_info.email) end diff --git a/app/models/deploy.rb b/app/models/deploy.rb index ad7581d..545af1a 100644 --- a/app/models/deploy.rb +++ b/app/models/deploy.rb @@ -19,7 +19,7 @@ class Deploy validates_presence_of :username, :environment def resolve_app_errs - app.problems.unresolved.in_env(environment).each { |problem| problem.resolve! } + app.problems.unresolved.in_env(environment).each(&:resolve!) end def short_revision diff --git a/spec/models/deploy_spec.rb b/spec/models/deploy_spec.rb index 4bdf0de..fab2e54 100644 --- a/spec/models/deploy_spec.rb +++ b/spec/models/deploy_spec.rb @@ -19,7 +19,7 @@ describe Deploy, type: 'model' do app = Fabricate(:app, :resolve_errs_on_deploy => false) @problems = 3.times.map { Fabricate(:err, :problem => Fabricate(:problem, :resolved => false, :app => app)) } Fabricate(:deploy, :app => app) - expect(app.reload.problems.none? { |problem| problem.resolved? }).to eq true + expect(app.reload.problems.none?(&:resolved?)).to eq true end end -- libgit2 0.21.2