From a4c9b77c1efd2e9bacee0481dcb7d62c8922cdf8 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 28 Jul 2023 01:43:49 +0000 Subject: [PATCH] Apply RuboCop auto-correct --- .bundle/config | 4 ++++ Gemfile | 12 ++++++------ loggman.rb | 4 +--- mysql_database_config.rb | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 .bundle/config diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 0000000..2f52bad --- /dev/null +++ b/.bundle/config @@ -0,0 +1,4 @@ +--- +BUNDLE_PATH: "/home/runner/work/Ru-b2-SQL-Backups/Ru-b2-SQL-Backups/vendor/bundle" +BUNDLE_DEPLOYMENT: "true" +BUNDLE_JOBS: "4" diff --git a/Gemfile b/Gemfile index 172fa14..18908ea 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' - -gem 'rubocop', '1.46.0' -gem 'json', '2.6.3' +# frozen_string_literal: true + +source 'https://rubygems.org' + +gem 'json', '2.6.3' +gem 'rubocop', '1.46.0' diff --git a/loggman.rb b/loggman.rb index 6eafc23..729c868 100644 --- a/loggman.rb +++ b/loggman.rb @@ -58,9 +58,7 @@ class Loggman def delete_old_logs Dir.glob(File.join(@log_dir, "#{LOG_PREFIX}-*.log")).each do |logfile| - if Time.now - File.mtime(logfile) > MAX_LOG_AGE - FileUtils.rm(logfile) - end + FileUtils.rm(logfile) if Time.now - File.mtime(logfile) > MAX_LOG_AGE end end end diff --git a/mysql_database_config.rb b/mysql_database_config.rb index 609d860..8bd24e6 100644 --- a/mysql_database_config.rb +++ b/mysql_database_config.rb @@ -72,7 +72,7 @@ class MysqlDatabaseConfig private def prompt(message, default: nil) - print message.to_s + print message print " [#{default}]" if default print ': ' value = gets.chomp