schemacop 3.0.21 → 3.0.23

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: 5e052fc48d690551076d72ec99fe2b3189e7e92861c70ea1b13d6ce2ab7e0f86
4
- data.tar.gz: e6bf934bc3c8489639b6f492a71d699f397b3ffcc67d573b18e19656b46648b5
3
+ metadata.gz: bb46676c0434b9f8bf65c4db36b60f246773349c693ff25e6682c520d847f6dc
4
+ data.tar.gz: 4de12ae503b4c052ad6ef01922a55f58ca4d70a7103c8d83a5730965bc25f541
5
5
  SHA512:
6
- metadata.gz: 1e916b157d4f36beebfc698f8680a3d8cc5283b49b7e95c56fe6c270851ae9c43fc3769bae7ea9829aca2d121774b8c809c1c9b271bd5ad901587498f9a43695
7
- data.tar.gz: 6faa79d40c4dcc045c33072f06327599fd98e853f1d3e416c4163df47326cc2ee13555b4fe6c2100b90e0604dc1e30e5d32ae3ca02515b4ce5545dc8bcd73bba
6
+ metadata.gz: 6bfd8e7c8b107fe7c517205d1eb3039d113bd220bed439902d36c27ee17251e3c364e5ba4f8550238d80f7d392a9c08326b4d0af3ebb1644259b501c402e7359
7
+ data.tar.gz: 57c30c35fd163caf9cb33cb5e97682a6030ce2bd0db5d66a61b92edd310d87148d3d0871013ccb704e7f0e8b3217b4ae42caa584e51695fda57583a3bd3bba5f
@@ -12,7 +12,7 @@ jobs:
12
12
  strategy:
13
13
  fail-fast: false
14
14
  matrix:
15
- ruby-version: ['2.6.2', '2.7.1', '3.0.1', '3.1.0']
15
+ ruby-version: ['2.6.2', '2.7.1', '3.0.1', '3.1.0', '3.2.0']
16
16
 
17
17
  steps:
18
18
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change log
2
2
 
3
+ ## 3.0.23 (2023-05-04)
4
+
5
+ * Improve formatting regular expressions for error messages and OpenAPI
6
+ documentation
7
+
8
+ ## 3.0.22 (2022-10-31)
9
+
10
+ * Fix `v3_default_options` being not applied to nodes
11
+
3
12
  ## 3.0.21 (2022-10-31)
4
13
 
5
14
  * Adapt option `ignore_obsolete_properties` of `HashNode` so that it can also
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright © 2016 - 2022 Sitrox
3
+ Copyright © 2016 - 2023 Sitrox
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -119,4 +119,4 @@ To run tests:
119
119
 
120
120
  ## Copyright
121
121
 
122
- Copyright © 2016 - 2022 Sitrox. See `LICENSE` for further details.
122
+ Copyright © 2016 - 2023 Sitrox. See `LICENSE` for further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.21
1
+ 3.0.23
@@ -28,9 +28,8 @@ module Schemacop
28
28
  klass = resolve_class(type)
29
29
  fail "Could not find node for type #{type.inspect}." unless klass
30
30
 
31
- node = klass.new(**options, &block)
32
-
33
31
  options = Schemacop.v3_default_options.slice(*klass.allowed_options).merge(options)
32
+ node = klass.new(**options, &block)
34
33
 
35
34
  if options.delete(:cast_str)
36
35
  format = NodeRegistry.name(klass)
data/lib/schemacop/v3.rb CHANGED
@@ -8,15 +8,18 @@ module Schemacop
8
8
  def self.sanitize_exp(exp)
9
9
  return exp if exp.is_a?(String)
10
10
 
11
- _start_slash, caret, exp, dollar, _end_slash, flags = exp.inspect.match(%r{^(/?)(\^)?(.*?)(\$)?(/?)([ixm]*)?$}).captures
12
- flags = flags.chars
11
+ # Convert expression to a string
12
+ exp = exp.inspect
13
13
 
14
- if flags.delete('i')
15
- exp = "(?i)(#{exp})"
14
+ # If regexp has flag /x, squish it
15
+ if exp.match(%r{/[a-wy-z]*?x[a-wy-z]*?})
16
+ exp = exp.squish
16
17
  end
17
18
 
18
- if flags.any?
19
- fail "Flags #{flags.inspect} are not supported by Schemacop."
19
+ _start_slash, caret, exp, dollar, _end_slash, flags = exp.match(%r{^(/?)(\^)?(.*?)(\$)?(/?)([ixm]*)?$}).captures
20
+
21
+ unless flags.blank?
22
+ exp = "(?#{flags})(#{exp})"
20
23
  end
21
24
 
22
25
  return "#{caret}#{exp}#{dollar}"
data/lib/schemacop.rb CHANGED
@@ -2,6 +2,7 @@
2
2
  require 'ruby2_keywords'
3
3
  require 'active_support/all'
4
4
  require 'set'
5
+ require 'uri'
5
6
 
6
7
  # Schemacop module
7
8
  module Schemacop
data/schemacop.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: schemacop 3.0.21 ruby lib
2
+ # stub: schemacop 3.0.23 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "schemacop".freeze
6
- s.version = "3.0.21"
6
+ s.version = "3.0.23"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
10
10
  s.authors = ["Sitrox".freeze]
11
- s.date = "2022-10-31"
11
+ s.date = "2023-04-05"
12
12
  s.files = [".github/workflows/ruby.yml".freeze, ".gitignore".freeze, ".releaser_config".freeze, ".rubocop.yml".freeze, ".yardopts".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "README_V2.md".freeze, "README_V3.md".freeze, "RUBY_VERSION".freeze, "Rakefile".freeze, "VERSION".freeze, "lib/schemacop.rb".freeze, "lib/schemacop/base_schema.rb".freeze, "lib/schemacop/exceptions.rb".freeze, "lib/schemacop/railtie.rb".freeze, "lib/schemacop/schema.rb".freeze, "lib/schemacop/schema2.rb".freeze, "lib/schemacop/schema3.rb".freeze, "lib/schemacop/scoped_env.rb".freeze, "lib/schemacop/v2.rb".freeze, "lib/schemacop/v2/caster.rb".freeze, "lib/schemacop/v2/collector.rb".freeze, "lib/schemacop/v2/dupper.rb".freeze, "lib/schemacop/v2/field_node.rb".freeze, "lib/schemacop/v2/node.rb".freeze, "lib/schemacop/v2/node_resolver.rb".freeze, "lib/schemacop/v2/node_supporting_field.rb".freeze, "lib/schemacop/v2/node_supporting_type.rb".freeze, "lib/schemacop/v2/node_with_block.rb".freeze, "lib/schemacop/v2/validator/array_validator.rb".freeze, "lib/schemacop/v2/validator/boolean_validator.rb".freeze, "lib/schemacop/v2/validator/float_validator.rb".freeze, "lib/schemacop/v2/validator/hash_validator.rb".freeze, "lib/schemacop/v2/validator/integer_validator.rb".freeze, "lib/schemacop/v2/validator/nil_validator.rb".freeze, "lib/schemacop/v2/validator/number_validator.rb".freeze, "lib/schemacop/v2/validator/object_validator.rb".freeze, "lib/schemacop/v2/validator/string_validator.rb".freeze, "lib/schemacop/v2/validator/symbol_validator.rb".freeze, "lib/schemacop/v3.rb".freeze, "lib/schemacop/v3/all_of_node.rb".freeze, "lib/schemacop/v3/any_of_node.rb".freeze, "lib/schemacop/v3/array_node.rb".freeze, "lib/schemacop/v3/boolean_node.rb".freeze, "lib/schemacop/v3/combination_node.rb".freeze, "lib/schemacop/v3/context.rb".freeze, "lib/schemacop/v3/dsl_scope.rb".freeze, "lib/schemacop/v3/global_context.rb".freeze, "lib/schemacop/v3/hash_node.rb".freeze, "lib/schemacop/v3/integer_node.rb".freeze, "lib/schemacop/v3/is_not_node.rb".freeze, "lib/schemacop/v3/node.rb".freeze, "lib/schemacop/v3/node_registry.rb".freeze, "lib/schemacop/v3/number_node.rb".freeze, "lib/schemacop/v3/numeric_node.rb".freeze, "lib/schemacop/v3/object_node.rb".freeze, "lib/schemacop/v3/one_of_node.rb".freeze, "lib/schemacop/v3/reference_node.rb".freeze, "lib/schemacop/v3/result.rb".freeze, "lib/schemacop/v3/string_node.rb".freeze, "lib/schemacop/v3/symbol_node.rb".freeze, "schemacop.gemspec".freeze, "test/lib/test_helper.rb".freeze, "test/schemas/nested/group.rb".freeze, "test/schemas/user.rb".freeze, "test/unit/schemacop/v2/casting_test.rb".freeze, "test/unit/schemacop/v2/collector_test.rb".freeze, "test/unit/schemacop/v2/custom_check_test.rb".freeze, "test/unit/schemacop/v2/custom_if_test.rb".freeze, "test/unit/schemacop/v2/defaults_test.rb".freeze, "test/unit/schemacop/v2/empty_test.rb".freeze, "test/unit/schemacop/v2/nil_dis_allow_test.rb".freeze, "test/unit/schemacop/v2/node_resolver_test.rb".freeze, "test/unit/schemacop/v2/short_forms_test.rb".freeze, "test/unit/schemacop/v2/types_test.rb".freeze, "test/unit/schemacop/v2/validator_array_test.rb".freeze, "test/unit/schemacop/v2/validator_boolean_test.rb".freeze, "test/unit/schemacop/v2/validator_float_test.rb".freeze, "test/unit/schemacop/v2/validator_hash_test.rb".freeze, "test/unit/schemacop/v2/validator_integer_test.rb".freeze, "test/unit/schemacop/v2/validator_nil_test.rb".freeze, "test/unit/schemacop/v2/validator_number_test.rb".freeze, "test/unit/schemacop/v2/validator_object_test.rb".freeze, "test/unit/schemacop/v2/validator_string_test.rb".freeze, "test/unit/schemacop/v2/validator_symbol_test.rb".freeze, "test/unit/schemacop/v3/all_of_node_test.rb".freeze, "test/unit/schemacop/v3/any_of_node_test.rb".freeze, "test/unit/schemacop/v3/array_node_test.rb".freeze, "test/unit/schemacop/v3/boolean_node_test.rb".freeze, "test/unit/schemacop/v3/global_context_test.rb".freeze, "test/unit/schemacop/v3/hash_node_test.rb".freeze, "test/unit/schemacop/v3/integer_node_test.rb".freeze, "test/unit/schemacop/v3/is_not_node_test.rb".freeze, "test/unit/schemacop/v3/node_test.rb".freeze, "test/unit/schemacop/v3/number_node_test.rb".freeze, "test/unit/schemacop/v3/object_node_test.rb".freeze, "test/unit/schemacop/v3/one_of_node_test.rb".freeze, "test/unit/schemacop/v3/reference_node_test.rb".freeze, "test/unit/schemacop/v3/string_node_test.rb".freeze, "test/unit/schemacop/v3/symbol_node_test.rb".freeze]
13
13
  s.homepage = "https://github.com/sitrox/schemacop".freeze
14
14
  s.licenses = ["MIT".freeze]
@@ -1,4 +1,5 @@
1
1
  require 'simplecov'
2
+
2
3
  SimpleCov.start do
3
4
  add_group 'v3', 'lib/schemacop/v3'
4
5
  add_group 'v2', 'lib/schemacop/v2'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schemacop
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.21
4
+ version: 3.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sitrox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-31 00:00:00.000000000 Z
11
+ date: 2023-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -292,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  - !ruby/object:Gem::Version
293
293
  version: '0'
294
294
  requirements: []
295
- rubygems_version: 3.3.11
295
+ rubygems_version: 3.4.6
296
296
  signing_key:
297
297
  specification_version: 4
298
298
  summary: Schemacop validates ruby structures consisting of nested hashes and arrays