Skip to content

Commit

Permalink
Fix rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Nov 5, 2023
1 parent c6655cd commit 0f631c0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

strategy:
matrix:
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2']
ruby: ['2.7', '3.0', '3.1', '3.2']
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require:
- rubocop-minitest

AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 2.7
TargetRailsVersion: 5.2
NewCops: enable

Expand Down
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in redmine_plugin_kit.gemspec
gemspec

group :development, :test do
gem 'bundler', require: false
gem 'rake', require: false
gem 'sqlite3', require: false
end
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you are a Redmine developer, feel free and offer PRs with your Improvements.
## Requirements

- Redmine `>= 4.1.0` (including upcoming)
- Ruby `>= 2.6` (only maintained ruby versions are supported)
- Ruby `>= 2.7` (only maintained ruby versions are supported)

## Installation

Expand Down
2 changes: 1 addition & 1 deletion lib/redmine_plugin_kit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def false?(value)
end

def textarea_cols(text, min: 8, max: 20)
[[min, text.to_s.length / 50].max, max].min
[[min, text.to_s.length / 50].max, max].min # rubocop: disable Style/ComparableClamp
end
end
end
5 changes: 2 additions & 3 deletions lib/redmine_plugin_kit/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ class ExistingControllerPatchForHelper < StandardError; end
attr_accessor :plugin_id, :debug

class << self
def to_prepare(*args, &block)
def to_prepare(...)
if Rails.version > '6.0'
# INFO: https://www.redmine.org/issues/36245
Rails.logger.info 'after_plugins_loaded hook should be used instead'
else
# ActiveSupport::Reloader.to_prepare(*args, &block)
Rails.configuration.to_prepare(*args, &block)
Rails.configuration.to_prepare(...)
end
end

Expand Down
6 changes: 1 addition & 5 deletions redmine_plugin_kit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ Gem::Specification.new do |spec|
f.match %r{^((test|spec|features)/|Gemfile)}
end
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 2.6'
spec.required_ruby_version = '>= 2.7'

spec.add_runtime_dependency 'deface', '1.9.0'
spec.add_runtime_dependency 'rails'

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'sqlite3'
end

0 comments on commit 0f631c0

Please sign in to comment.