From 4031f1eb7a1314cc8fb084bb822f6acd9f5f30ea Mon Sep 17 00:00:00 2001 From: VetheonGames <76892542+VetheonGames@users.noreply.github.com> Date: Thu, 27 Jul 2023 19:11:58 -0600 Subject: [PATCH 1/6] Update RuboCop-Auto-correct.yml Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com> --- .github/workflows/RuboCop-Auto-correct.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/RuboCop-Auto-correct.yml b/.github/workflows/RuboCop-Auto-correct.yml index dd10ca1..84c3aa3 100644 --- a/.github/workflows/RuboCop-Auto-correct.yml +++ b/.github/workflows/RuboCop-Auto-correct.yml @@ -2,7 +2,7 @@ name: RuboCop Auto-correct on: push: - branches: [ "main" ] + branches: [ "development" ] jobs: autocorrect: @@ -34,8 +34,9 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.RUBOCOP_CHECKS }} title: "Apply RuboCop auto-correct" branch: "rubocop-autocorrect-${{ github.run_number }}" + base: "development" delete-branch: true body: "This PR applies RuboCop auto-corrections to the codebase." -- 2.45.1 From 8b9df3af4207eeefd92331b3130c4057ce0d117f Mon Sep 17 00:00:00 2001 From: VetheonGames <76892542+VetheonGames@users.noreply.github.com> Date: Thu, 27 Jul 2023 19:12:33 -0600 Subject: [PATCH 2/6] Update RuboCop-Auto-correct.yml Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com> --- .github/workflows/RuboCop-Auto-correct.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/RuboCop-Auto-correct.yml b/.github/workflows/RuboCop-Auto-correct.yml index dd10ca1..84c3aa3 100644 --- a/.github/workflows/RuboCop-Auto-correct.yml +++ b/.github/workflows/RuboCop-Auto-correct.yml @@ -2,7 +2,7 @@ name: RuboCop Auto-correct on: push: - branches: [ "main" ] + branches: [ "development" ] jobs: autocorrect: @@ -34,8 +34,9 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.RUBOCOP_CHECKS }} title: "Apply RuboCop auto-correct" branch: "rubocop-autocorrect-${{ github.run_number }}" + base: "development" delete-branch: true body: "This PR applies RuboCop auto-corrections to the codebase." -- 2.45.1 From 8c683e01a1dc293e37616ff890108da3eb189676 Mon Sep 17 00:00:00 2001 From: VetheonGames <76892542+VetheonGames@users.noreply.github.com> Date: Thu, 27 Jul 2023 19:32:40 -0600 Subject: [PATCH 3/6] Update RuboCop-Auto-correct.yml Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com> --- .github/workflows/RuboCop-Auto-correct.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RuboCop-Auto-correct.yml b/.github/workflows/RuboCop-Auto-correct.yml index 84c3aa3..f794977 100644 --- a/.github/workflows/RuboCop-Auto-correct.yml +++ b/.github/workflows/RuboCop-Auto-correct.yml @@ -38,5 +38,5 @@ jobs: title: "Apply RuboCop auto-correct" branch: "rubocop-autocorrect-${{ github.run_number }}" base: "development" - delete-branch: true + delete-branch: false body: "This PR applies RuboCop auto-corrections to the codebase." -- 2.45.1 From 43997e2c99aa49b83e7d47c523fa6f6af4832784 Mon Sep 17 00:00:00 2001 From: VetheonGames <76892542+VetheonGames@users.noreply.github.com> Date: Thu, 27 Jul 2023 19:39:52 -0600 Subject: [PATCH 4/6] Update RuboCop-Auto-correct.yml Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com> --- .github/workflows/RuboCop-Auto-correct.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RuboCop-Auto-correct.yml b/.github/workflows/RuboCop-Auto-correct.yml index f794977..84c3aa3 100644 --- a/.github/workflows/RuboCop-Auto-correct.yml +++ b/.github/workflows/RuboCop-Auto-correct.yml @@ -38,5 +38,5 @@ jobs: title: "Apply RuboCop auto-correct" branch: "rubocop-autocorrect-${{ github.run_number }}" base: "development" - delete-branch: false + delete-branch: true body: "This PR applies RuboCop auto-corrections to the codebase." -- 2.45.1 From fc77d56cc870ac60879f0ffb3fd2e16fbdd62408 Mon Sep 17 00:00:00 2001 From: VetheonGames <76892542+VetheonGames@users.noreply.github.com> Date: Thu, 27 Jul 2023 19:43:32 -0600 Subject: [PATCH 5/6] Update RuboCop-Auto-correct.yml Signed-off-by: VetheonGames <76892542+VetheonGames@users.noreply.github.com> --- .github/workflows/RuboCop-Auto-correct.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/RuboCop-Auto-correct.yml b/.github/workflows/RuboCop-Auto-correct.yml index 84c3aa3..b7f68f7 100644 --- a/.github/workflows/RuboCop-Auto-correct.yml +++ b/.github/workflows/RuboCop-Auto-correct.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - token: ${{ secrets.RUBOCOP_CHECKS }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Ruby uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4 # v1.127.0 with: @@ -34,7 +34,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: - token: ${{ secrets.RUBOCOP_CHECKS }} + token: ${{ secrets.GITHUB_TOKEN }} title: "Apply RuboCop auto-correct" branch: "rubocop-autocorrect-${{ github.run_number }}" base: "development" -- 2.45.1 From a4c9b77c1efd2e9bacee0481dcb7d62c8922cdf8 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 28 Jul 2023 01:43:49 +0000 Subject: [PATCH 6/6] 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 -- 2.45.1