foreman_host_extra_validator 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cd1faf2a634cac57b3603ab51bed47ca72cd9da17ed55d7497d9d108030b61e
4
- data.tar.gz: a4802142256b0e139ebc923b1d6615735f40aae117d3968cc0f2ac04bacf5441
3
+ metadata.gz: 36132263f96590065236ecd8cbd20de5e3544dcd3be281079570b65e03dab92f
4
+ data.tar.gz: 86e61c1c2e2d7c4a13bc5a7c4343e20970a1274e75c7c41710046bc92a4619ac
5
5
  SHA512:
6
- metadata.gz: b092cf27e78b4e20ef904026148bda130ab76b05d2d944581ade639c34e939009ffc38d8796971803b863311f123511c8c7787a69f4ce73435e9dc0bdccb439e
7
- data.tar.gz: e3fa88d65f80b9885e4c3209c0b29c28c5642d36c5ecb28958c6c812555bea96bfa7dc1fd70668247411b2faae3bb02d61f212a1db450bf34bcff155894b070a
6
+ metadata.gz: c6eee9182c810167fe4c8bbd99ed00dbfb34c2b235959007630c033fe9440f606dbb391cbdb8bb20502475fad9ffe76e87e4cb5ae7a5495b0525f7ca30ad8f38
7
+ data.tar.gz: 79b1b06725fe738c03de51b5efd6a8e8212b3f709635f846f21ce9c234e32077bfd54ed4d0745c3be6001cd8196e198792afa8a9dea542a5c77e2b8fa987ccef
@@ -1,5 +1,5 @@
1
1
  class FixExtraValidationSettingsCategoryToDsl < ActiveRecord::Migration[6.0]
2
2
  def up
3
- Setting.where(category: 'Setting::ForemanHostExtraValidator').update_all(category: 'Setting')
3
+ Setting.where(category: 'Setting::ForemanHostExtraValidator').update_all(category: 'Setting') if column_exists?(:settings, :category)
4
4
  end
5
5
  end
@@ -4,6 +4,13 @@ module ForemanHostExtraValidator
4
4
 
5
5
  config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
6
6
 
7
+ # Add any db migrations
8
+ initializer 'foreman_host_extra_validator.load_app_instance_data' do |app|
9
+ ForemanHostExtraValidator::Engine.paths['db/migrate'].existent.each do |path|
10
+ app.config.paths['db/migrate'] << path
11
+ end
12
+ end
13
+
7
14
  initializer 'foreman_host_extra_validator.register_plugin', :before => :finisher_hook do |_app|
8
15
  Foreman::Plugin.register :foreman_host_extra_validator do
9
16
  requires_foreman '>= 3.0.0'
@@ -11,7 +18,7 @@ module ForemanHostExtraValidator
11
18
  settings do
12
19
  category(:host_extra_validator, N_('Host Extra Validator')) do
13
20
  setting('host_name_validation_regex',
14
- description: N_('Default regex the name of a host is validated against'),
21
+ description: N_('Default regex the name of a host is validated against'),
15
22
  type: :string,
16
23
  default: '^[a-zA-Z0-9\-_]+$',
17
24
  full_name: N_('Regular expresssion'))
@@ -1,3 +1,3 @@
1
1
  module ForemanHostExtraValidator
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -2,7 +2,6 @@ require 'test_plugin_helper'
2
2
 
3
3
  class ForemanHostExtraValidatorTest < ActiveSupport::TestCase
4
4
  setup do
5
- Setting::ForemanHostExtraValidator.load_defaults
6
5
  disable_orchestration
7
6
  User.current = FactoryBot.build(:user, :admin)
8
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_host_extra_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-24 00:00:00.000000000 Z
11
+ date: 2024-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop