Run rubocop --fix-layout and remove encoding comments

This commit is contained in:
Patrick Gansterer 2021-03-01 15:27:26 +01:00
parent fa63e6e81d
commit ea2862fdef
283 changed files with 1164 additions and 1969 deletions

View file

@ -3,4 +3,4 @@ if defined? Bullet
# Bullet.alert = true
Bullet.bullet_logger = true
Bullet.console = true
end
end

View file

@ -2,6 +2,6 @@
# have it shown in all other languages too
::I18n.available_locales.each do |locale|
unless locale == ::I18n.default_locale
::I18n.backend.store_translations(locale, number: {currency: {format: {unit: nil}}})
::I18n.backend.store_translations(locale, number: { currency: { format: { unit: nil } } })
end
end

View file

@ -1,6 +1,5 @@
require 'exception_notification/rails'
require 'resque/failure/multiple'
require 'resque/failure/redis'
require 'exception_notification/resque'
@ -8,7 +7,6 @@ require 'exception_notification/resque'
Resque::Failure::Multiple.classes = [Resque::Failure::Redis, ExceptionNotification::Resque]
Resque::Failure.backend = Resque::Failure::Multiple
ExceptionNotification.configure do |config|
# Ignore additional exception types.
# ActiveRecord::RecordNotFound, Mongoid::Errors::DocumentNotFound, AbstractController::ActionNotFound and ActionController::RoutingError are already added.
@ -25,8 +23,8 @@ ExceptionNotification.configure do |config|
# Email notifier sends notifications by email.
if notification = FoodsoftConfig[:notification]
config.add_notifier :email, {
:email_prefix => notification[:email_prefix],
:sender_address => notification[:sender_address],
:email_prefix => notification[:email_prefix],
:sender_address => notification[:sender_address],
:exception_recipients => notification[:error_recipients],
}
end
@ -49,5 +47,4 @@ ExceptionNotification.configure do |config|
# :url => 'http://example.com:5555/hubot/path',
# :http_method => :post
# }
end

View file

@ -1,6 +1,5 @@
# extend the BigDecimal class
class String
# remove comma from decimal inputs
def self.delocalized_decimal(string)
if !string.blank? and string.is_a?(String)
@ -14,6 +13,6 @@ end
class Array
def cumulative_sum
csum = 0
self.map{|val| csum += val}
self.map { |val| csum += val }
end
end

View file

@ -14,4 +14,4 @@ ActiveSupport.use_standard_json_time_format = true
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
# if you're including raw json in an HTML page.
ActiveSupport.escape_html_entities_in_json = false
ActiveSupport.escape_html_entities_in_json = false

View file

@ -29,7 +29,7 @@ if defined? RubyUnits
# we use pc for piece, not parsec
RubyUnits::Unit.redefine!('parsec') do |unit|
unit.aliases = unit.aliases.reject {|u| u=='pc'}
unit.aliases = unit.aliases.reject { |u| u == 'pc' }
unit.display_name = 'parsec'
end
@ -37,7 +37,7 @@ if defined? RubyUnits
# default precision of 8 which same as all database definitions in db/migrate/20131213002332_*.rb
class Rational
alias orig_to_d to_d
def to_d(precision=8)
def to_d(precision = 8)
orig_to_d(precision)
end
end

View file

@ -10,6 +10,7 @@ module ActionDispatch
path = request.original_fullpath[script_name.size..-1]
slug = path.split('/', 2).first
return if slug.blank?
cookie[:path] = script_name + slug
end
orig_set_cookie request, session_id, cookie

View file

@ -6,7 +6,7 @@ SimpleForm.setup do |config|
# stack. The options given below are used to wrap the
# whole input.
config.wrappers :default, class: :input,
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
## Extensions enabled by default
# Any of these extensions can be disabled for a
# given input by passing: `f.input EXTENSION_NAME => false`.