diff --git a/.rubocop.yml b/.rubocop.yml index f45e7e7..ebdc73a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,9 @@ inherit_gem: theforeman-rubocop: - default.yml +AllCops: + TargetRubyVersion: '2.7' + Layout/LineLength: Exclude: - 'test/**/*' diff --git a/config/routes.rb b/config/routes.rb index 8546445..8af7de7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,10 +12,8 @@ end namespace :api, defaults: { format: 'json' } do - scope '(:apiv)', module: :v2, - defaults: { apiv: 'v2' }, - apiv: /v1|v2/, - constraints: ApiConstraints.new(version: 2) do + scope '(:apiv)', module: :v2, defaults: { apiv: 'v2' }, + apiv: /v1|v2/, constraints: ApiConstraints.new(version: 2) do constraints(id: %r{[^/]+}) do resources :puppetdb_nodes, only: %i[index destroy] do collection do diff --git a/db/migrate/20221026123754_fix_puppetdb_settings_category_to_dsl.rb b/db/migrate/20221026123754_fix_puppetdb_settings_category_to_dsl.rb index b83ae05..6011228 100644 --- a/db/migrate/20221026123754_fix_puppetdb_settings_category_to_dsl.rb +++ b/db/migrate/20221026123754_fix_puppetdb_settings_category_to_dsl.rb @@ -2,8 +2,6 @@ class FixPuppetdbSettingsCategoryToDsl < ActiveRecord::Migration[6.0] def up - # rubocop:disable Rails/SkipsModelValidations Setting.where(category: 'Setting::Puppetdb').update_all(category: 'Setting') if column_exists?(:settings, :category) - # rubocop:enable Rails/SkipsModelValidations end end diff --git a/lib/tasks/puppetdb_foreman_tasks.rake b/lib/tasks/puppetdb_foreman_tasks.rake index 8602f55..9fdd9dd 100644 --- a/lib/tasks/puppetdb_foreman_tasks.rake +++ b/lib/tasks/puppetdb_foreman_tasks.rake @@ -32,4 +32,6 @@ end Rake::Task[:test].enhance ['test:puppetdb_foreman'] load 'tasks/jenkins.rake' -Rake::Task['jenkins:unit'].enhance ['test:puppetdb_foreman', 'puppetdb_foreman:rubocop'] if Rake::Task.task_defined?(:'jenkins:unit') +if Rake::Task.task_defined?(:'jenkins:unit') + Rake::Task['jenkins:unit'].enhance ['test:puppetdb_foreman', 'puppetdb_foreman:rubocop'] +end diff --git a/puppetdb_foreman.gemspec b/puppetdb_foreman.gemspec index 6bbe6ee..291c32a 100644 --- a/puppetdb_foreman.gemspec +++ b/puppetdb_foreman.gemspec @@ -7,7 +7,15 @@ Gem::Specification.new do |s| s.version = PuppetdbForeman::VERSION s.license = 'GPL-3.0' s.summary = 'This is a Foreman plugin to interact with PuppetDB.' - s.description = 'Disable hosts on PuppetDB after they are deleted or built in Foreman. Follow https://github.com/theforeman/puppetdb_foreman and raise an issue/submit a pull request if you need extra functionality. You can also find some help via the Foreman support pages (https://theforeman.org/support.html).' + + s.description = <<-DESC + Disable hosts on PuppetDB after they are deleted or built in Foreman. + Follow https://github.com/theforeman/puppetdb_foreman and raise an + issue/submit a pull request if you need extra functionality. You can also + find some help via the Foreman support pages + (https://theforeman.org/support.html). + DESC + s.authors = ['Daniel Lobato Garcia'] s.email = 'elobatocs@gmail.com' s.files = Dir['{app,db,config,lib}/**/*'] + ['LICENSE', 'Rakefile', 'README.md'] @@ -18,4 +26,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'rdoc' s.add_development_dependency 'theforeman-rubocop', '~> 0.1.2' s.add_development_dependency 'webmock' + + s.required_ruby_version = '>= 2.7', '< 4' end