From 458265b78f571cf6291c6c077c00a6414b9e9fc3 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Wed, 11 May 2016 02:15:28 +0200 Subject: [PATCH] fix rubocop offenses for rubocop 0.40.0 --- lib/diaspora_federation/properties_dsl.rb | 2 + .../validators/rules/guid_spec.rb | 3 +- test/dummy/config/logging.rb | 55 ++++++++++--------- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/lib/diaspora_federation/properties_dsl.rb b/lib/diaspora_federation/properties_dsl.rb index 503da5a..5e2a341 100644 --- a/lib/diaspora_federation/properties_dsl.rb +++ b/lib/diaspora_federation/properties_dsl.rb @@ -144,7 +144,9 @@ module DiasporaFederation # @param [Symbol] alias_name alias name def define_alias(name, alias_name) class_prop_aliases[alias_name] = name + # rubocop:disable Style/Alias instance_eval { alias_method alias_name, name } + # rubocop:enable Style/Alias end # Raised, if the name is of an unexpected type diff --git a/spec/lib/diaspora_federation/validators/rules/guid_spec.rb b/spec/lib/diaspora_federation/validators/rules/guid_spec.rb index e2d48f8..c64f849 100644 --- a/spec/lib/diaspora_federation/validators/rules/guid_spec.rb +++ b/spec/lib/diaspora_federation/validators/rules/guid_spec.rb @@ -37,7 +37,8 @@ describe Validation::Rule::Guid do it "validates a long string with random characters and [-_@.:] (redmatrix)" do validator = Validation::Validator.new( - OpenStruct.new(guid: "1234567890ABCDefgh_ijkl-mnopqrSTUVwxyz@example.com:3000")) + OpenStruct.new(guid: "1234567890ABCDefgh_ijkl-mnopqrSTUVwxyz@example.com:3000") + ) validator.rule(:guid, :guid) expect(validator).to be_valid diff --git a/test/dummy/config/logging.rb b/test/dummy/config/logging.rb index c4b65e9..109a20a 100644 --- a/test/dummy/config/logging.rb +++ b/test/dummy/config/logging.rb @@ -13,41 +13,44 @@ Logging::Rails.configure do |config| # to the pattern layout. Color schemes should only be used with appenders # that write to STDOUT or STDERR; inserting terminal color codes into a file # is generally considered bad form. - Logging.color_scheme("bright", - levels: { - info: :green, - warn: :yellow, - error: :red, - fatal: %i(white on_red) - }, - date: :blue, - logger: :cyan, - message: :magenta - ) + Logging.color_scheme( + "bright", + levels: { + info: :green, + warn: :yellow, + error: :red, + fatal: %i(white on_red) + }, + date: :blue, + logger: :cyan, + message: :magenta + ) # Configure an appender that will write log events to STDOUT. A colorized # pattern layout is used to format the log events into strings before # writing. - Logging.appenders.stdout("stdout", - auto_flushing: true, - layout: Logging.layouts.pattern( - pattern: pattern, - color_scheme: "bright" - ) - ) if config.log_to.include? "stdout" + Logging.appenders.stdout( + "stdout", + auto_flushing: true, + layout: Logging.layouts.pattern( + pattern: pattern, + color_scheme: "bright" + ) + ) if config.log_to.include? "stdout" # Configure an appender that will write log events to a file. The file will # be rolled on a daily basis, and the past 7 rolled files will be kept. # Older files will be deleted. The default pattern layout is used when # formatting log events into strings. - Logging.appenders.rolling_file("file", - filename: config.paths["log"].first, - keep: 7, - age: "daily", - truncate: false, - auto_flushing: true, - layout: layout - ) if config.log_to.include? "file" + Logging.appenders.rolling_file( + "file", + filename: config.paths["log"].first, + keep: 7, + age: "daily", + truncate: false, + auto_flushing: true, + layout: layout + ) if config.log_to.include? "file" # Setup the root logger with the Rails log level and the desired set of # appenders. The list of appenders to use should be set in the environment