mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Autocorrect Style/GlobalStdStream offenses
This commit is contained in:
@@ -579,16 +579,6 @@ Style/ClassAndModuleChildren:
|
||||
- 'lib/open_food_network/locking.rb'
|
||||
- 'spec/models/spree/payment_method_spec.rb'
|
||||
|
||||
# Offense count: 6
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Style/GlobalStdStream:
|
||||
Exclude:
|
||||
- 'lib/tasks/data.rake'
|
||||
- 'lib/tasks/missing_payments.rake'
|
||||
- 'lib/tasks/sample_data/logging.rb'
|
||||
- 'lib/tasks/subscriptions/debug.rake'
|
||||
- 'lib/tasks/subscriptions/test.rake'
|
||||
|
||||
# Offense count: 10
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: AllowSplatArgument.
|
||||
|
||||
@@ -78,11 +78,11 @@ namespace :ofn do
|
||||
# Ask how many months back we want to search for
|
||||
puts "This task will search order cycle edited within (n) months of today's date.\n" \
|
||||
"Please enter a value for (n), or hit ENTER to use the default of three (3) months."
|
||||
input = check_default(STDIN.gets.chomp)
|
||||
input = check_default($stdin.gets.chomp)
|
||||
|
||||
while !is_integer?(input)
|
||||
puts "'#{input}' is not an integer. Please enter an integer."
|
||||
input = check_default(STDIN.gets.chomp)
|
||||
input = check_default($stdin.gets.chomp)
|
||||
end
|
||||
|
||||
Integer(input)
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace :ofn do
|
||||
details = Psych.load(entry.details)
|
||||
out << row(details, details.params)
|
||||
rescue StandardError
|
||||
Logger.new(STDERR).warn(entry)
|
||||
Logger.new($stderr).warn(entry)
|
||||
end
|
||||
|
||||
def headers
|
||||
|
||||
@@ -4,7 +4,7 @@ module Logging
|
||||
private
|
||||
|
||||
def log(message)
|
||||
@logger ||= ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
|
||||
@logger ||= ActiveSupport::TaggedLogging.new(Logger.new($stdout))
|
||||
@logger.tagged("ofn:sample_data") { @logger.info(message) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace :ofn do
|
||||
|
||||
def request_order_cycle_id
|
||||
puts "Please input Order Cycle ID to debug"
|
||||
input = STDIN.gets.chomp
|
||||
input = $stdin.gets.chomp
|
||||
exit if input.blank? || !Integer(input)
|
||||
Integer(input)
|
||||
end
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace :ofn do
|
||||
|
||||
def request_order_cycle_id
|
||||
puts "Please input Order Cycle ID to reset"
|
||||
input = STDIN.gets.chomp
|
||||
input = $stdin.gets.chomp
|
||||
exit if input.blank? || !Integer(input)
|
||||
Integer(input)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user