diff --git a/.bundle/Gemfile b/.bundle/Gemfile deleted file mode 100644 index 172fa14..0000000 --- a/.bundle/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' - -gem 'rubocop', '1.46.0' -gem 'json', '2.6.3' diff --git a/.bundle/Gemfile.lock b/.bundle/Gemfile.lock deleted file mode 100644 index 11291f2..0000000 --- a/.bundle/Gemfile.lock +++ /dev/null @@ -1,35 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - ast (2.4.2) - json (2.6.3) - parallel (1.22.1) - parser (3.2.1.0) - ast (~> 2.4.1) - rainbow (3.1.1) - regexp_parser (2.7.0) - rexml (3.2.5) - rubocop (1.46.0) - json (~> 2.3) - parallel (~> 1.10) - parser (>= 3.2.0.0) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.26.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.26.0) - parser (>= 3.2.1.0) - ruby-progressbar (1.11.0) - unicode-display_width (2.4.2) - -PLATFORMS - x64-mingw-ucrt - -DEPENDENCIES - json (= 2.6.3) - rubocop (= 1.46.0) - -BUNDLED WITH - 2.4.6 diff --git a/.bundle/config b/.bundle/config deleted file mode 100644 index 2f52bad..0000000 --- a/.bundle/config +++ /dev/null @@ -1,4 +0,0 @@ ---- -BUNDLE_PATH: "/home/runner/work/Ru-b2-SQL-Backups/Ru-b2-SQL-Backups/vendor/bundle" -BUNDLE_DEPLOYMENT: "true" -BUNDLE_JOBS: "4" diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..0f9e61f --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,18 @@ +# .rubocop.yml + +# Enable all cops + +# Target Ruby version + +AllCops: + DisabledByDefault: false + TargetRubyVersion: 3.2.2 + +# Add other configuration options as needed +# For example, you can exclude certain files or directories +# from being analyzed by Rubocop using the `Exclude` option. + +# AllCops: +# Exclude: +# - path/to/excluded/file.rb +# - path/to/excluded_directory/** diff --git a/rub2 b/rub2 old mode 100644 new mode 100755 index b646fc5..9e64d2b --- a/rub2 +++ b/rub2 @@ -13,7 +13,7 @@ logger = Loggman.new begin if ARGV[0] == '--restore' unless File.exist?(config_file) - logger.error("Configuration file does not exist. Please run the first time setup.") + logger.error('Configuration file does not exist. Please run the first time setup.') exit 1 end @@ -25,11 +25,11 @@ begin remote_backups = b2_enabled ? `./b2 ls #{config['b2']['bucket_name']}`.split("\n") : [] if local_backups.empty? && remote_backups.empty? - logger.error("No backup found. Please ensure a backup exists in the local directory or in the B2 bucket (if B2 is enabled).") + logger.error('No backup found. Please ensure a backup exists in the local directory or in the B2 bucket (if B2 is enabled).') exit 1 end - logger.info("Restoring backup...") + logger.info('Restoring backup...') restore = MysqlDatabaseRestore.new(config_file, logger) restore.restore else