fix rubocop offenses for rubocop 0.40.0

This commit is contained in:
Benjamin Neff 2016-05-11 02:15:28 +02:00
parent e6f36a8fe6
commit 458265b78f
3 changed files with 33 additions and 27 deletions

View file

@ -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

View file

@ -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

View file

@ -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