Comparing changes

v0.7.1 v0.7.2
7 commits 11 files changed

Commits

73916d7 chore: bump version for release mo khan 2024-12-06 00:52:38
6c57b7a chore: fix Gemfile.lock mo khan 2024-12-06 00:44:54
3577cab chore: upgrade to minimum Ruby 3.1 mo khan 2024-12-06 00:41:15
f11258f chore: update gems mo khan 2024-12-06 00:23:40
1d90ed6 fix: convert variable to string mo khan 2024-12-06 00:21:36
cdeaf93 chore: add latest rubies to test matrix mo khan 2024-12-05 23:55:50
.github/workflows/ci.yml
@@ -9,7 +9,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: ['2.7', '3.0', '3.1']
+        ruby-version: ['3.1', '3.2', '3.3', '3.4']
     steps:
       - uses: actions/checkout@v2
       - name: Set up Ruby
@@ -25,7 +25,7 @@ jobs:
       - uses: actions/checkout@v2
       - uses: ruby/setup-ruby@v1
         with:
-          ruby-version: '3.0'
+          ruby-version: '3.1'
           bundler-cache: true
       - name: Running style checks…
         run: sh bin/style
@@ -35,7 +35,7 @@ jobs:
       - uses: actions/checkout@v2
       - uses: ruby/setup-ruby@v1
         with:
-          ruby-version: '3.0'
+          ruby-version: '3.1'
           bundler-cache: true
       - name: Running audit…
         run: sh bin/audit
lib/scim/kit/v2/attributable.rb
@@ -66,10 +66,8 @@ module Scim
 
         # yields each attribute to the provided block
         # @param [Block] the block to yield each attribute to.
-        def each
-          dynamic_attributes.each do |_name, attribute|
-            yield attribute
-          end
+        def each(&block)
+          dynamic_attributes.each_value(&block)
         end
 
         private
lib/scim/kit/v2/messages.rb
@@ -5,12 +5,12 @@ module Scim
     module V2
       module Messages
         CORE = 'urn:ietf:params:scim:api:messages:2.0'
-        BULK_REQUEST = "#{CORE}:BulkRequest"
-        BULK_RESPONSE = "#{CORE}:BulkResponse"
-        ERROR = "#{CORE}:Error"
-        LIST_RESPONSE = "#{CORE}:ListResponse"
-        PATCH_OP = "#{CORE}:PatchOp"
-        SEARCH_REQUEST = "#{CORE}:SearchRequest"
+        BULK_REQUEST = "#{CORE}:BulkRequest".freeze
+        BULK_RESPONSE = "#{CORE}:BulkResponse".freeze
+        ERROR = "#{CORE}:Error".freeze
+        LIST_RESPONSE = "#{CORE}:ListResponse".freeze
+        PATCH_OP = "#{CORE}:PatchOp".freeze
+        SEARCH_REQUEST = "#{CORE}:SearchRequest".freeze
       end
     end
   end
lib/scim/kit/v2/schemas.rb
@@ -6,14 +6,14 @@ module Scim
       module Schemas
         ROOT = 'urn:ietf:params:scim:schemas'
 
-        CORE = "#{ROOT}:core:2.0"
-        EXTENSION = "#{ROOT}:extension"
-        ENTERPRISE_USER = "#{EXTENSION}:enterprise:2.0:User"
-        GROUP = "#{CORE}:Group"
-        RESOURCE_TYPE = "#{CORE}:ResourceType"
-        SCHEMA = "#{CORE}:Schema"
-        SERVICE_PROVIDER_CONFIGURATION = "#{CORE}:ServiceProviderConfig"
-        USER = "#{CORE}:User"
+        CORE = "#{ROOT}:core:2.0".freeze
+        EXTENSION = "#{ROOT}:extension".freeze
+        ENTERPRISE_USER = "#{EXTENSION}:enterprise:2.0:User".freeze
+        GROUP = "#{CORE}:Group".freeze
+        RESOURCE_TYPE = "#{CORE}:ResourceType".freeze
+        SCHEMA = "#{CORE}:Schema".freeze
+        SERVICE_PROVIDER_CONFIGURATION = "#{CORE}:ServiceProviderConfig".freeze
+        USER = "#{CORE}:User".freeze
       end
     end
   end
lib/scim/kit/v2.rb
@@ -29,7 +29,7 @@ module Scim
     module V2
       BASE64 = %r(
         \A([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\Z
-      )x.freeze
+      )x
       BOOLEAN_VALUES = [true, false].freeze
       DATATYPES = {
         string: 'string',
@@ -68,7 +68,7 @@ module Scim
             false
           end
         },
-        reference: ->(x) { x =~ /\A#{URI::DEFAULT_PARSER.make_regexp(%w[http https])}\z/ },
+        reference: ->(x) { x&.to_s =~ /\A#{URI::DEFAULT_PARSER.make_regexp(%w[http https])}\z/ },
         string: ->(x) { x.is_a?(String) }
       }.freeze
 
lib/scim/kit/version.rb
@@ -2,6 +2,6 @@
 
 module Scim
   module Kit
-    VERSION = '0.7.1'
+    VERSION = '0.7.2'
   end
 end
lib/scim/kit.rb
@@ -25,7 +25,7 @@ module Scim
     TYPE_ERROR = ArgumentError.new(:type)
 
     def self.logger
-      @logger ||= Logger.new(STDOUT)
+      @logger ||= Logger.new($stdout)
     end
 
     def self.logger=(logger)
.rubocop.yml
@@ -7,7 +7,7 @@ AllCops:
     - 'pkg/**/*'
     - 'tmp/**/*'
     - 'vendor/**/*'
-  TargetRubyVersion: 2.7
+  TargetRubyVersion: 3.1
 
 Layout/ArgumentAlignment:
   EnforcedStyle: with_fixed_indentation
@@ -23,6 +23,7 @@ Layout/LineLength:
     - 'spec/**/*.rb'
   IgnoredPatterns:
     - '^#*'
+  Max: 80
 
 Layout/MultilineMethodCallIndentation:
   Enabled: true
@@ -37,6 +38,10 @@ Lint/AmbiguousBlockAssociation:
   Exclude:
     - 'spec/**/*.rb'
 
+Lint/EmptyFile:
+  Exclude:
+    - 'lib/scim/kit/v2/templates/nil_class.json.jbuilder'
+
 Lint/RaiseException:
   Enabled: true
 
@@ -64,6 +69,9 @@ Naming/FileName:
 Naming/RescuedExceptionsVariableName:
   PreferredName: error
 
+Style/AccessorGrouping:
+  Enabled: false
+
 Style/Documentation:
   Enabled: false
 
@@ -83,6 +91,9 @@ Style/IfUnlessModifier:
 Style/StringLiterals:
   EnforcedStyle: 'single_quotes'
 
+Style/SymbolProc:
+  Enabled: false
+
 Style/TrailingCommaInArrayLiteral:
   Enabled: false
 
CHANGELOG.md
@@ -1,4 +1,4 @@
-Version 0.7.1
+Version 0.7.2
 
 # Changelog
 All notable changes to this project will be documented in this file.
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+## [0.7.2] - 2024-12-05
+### Fixed
+- Change references to string during validation
+
 ## [0.7.1] - 2022-12-12
 ### Fixed
 - Add support for duplicate attribute names
@@ -85,7 +89,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - \_assign does not coerce values by default.
 - errors are merged together instead of overwritten during attribute validation.
 
-[Unreleased]: https://github.com/xlgmokha/scim-kit/compare/v0.7.1...HEAD
+[Unreleased]: https://github.com/xlgmokha/scim-kit/compare/v0.7.2...HEAD
+[0.7.2]: https://github.com/xlgmokha/scim-kit/compare/v0.7.1...v0.7.2
 [0.7.1]: https://github.com/xlgmokha/scim-kit/compare/v0.7.0...v0.7.1
 [0.7.0]: https://github.com/xlgmokha/scim-kit/compare/v0.6.0...v0.7.0
 [0.6.0]: https://github.com/xlgmokha/scim-kit/compare/v0.5.3...v0.6.0
Gemfile.lock
@@ -1,7 +1,7 @@
 PATH
   remote: .
   specs:
-    scim-kit (0.7.1)
+    scim-kit (0.7.2)
       activemodel (>= 6.1, < 8.0)
       net-hippie (~> 1.0)
       parslet (~> 2.0)
@@ -11,108 +11,150 @@ PATH
 GEM
   remote: https://rubygems.org/
   specs:
-    actionview (7.0.4)
-      activesupport (= 7.0.4)
+    actionview (7.2.2)
+      activesupport (= 7.2.2)
       builder (~> 3.1)
-      erubi (~> 1.4)
-      rails-dom-testing (~> 2.0)
-      rails-html-sanitizer (~> 1.1, >= 1.2.0)
-    activemodel (7.0.4)
-      activesupport (= 7.0.4)
-    activesupport (7.0.4)
-      concurrent-ruby (~> 1.0, >= 1.0.2)
+      erubi (~> 1.11)
+      rails-dom-testing (~> 2.2)
+      rails-html-sanitizer (~> 1.6)
+    activemodel (7.2.2)
+      activesupport (= 7.2.2)
+    activesupport (7.2.2)
+      base64
+      benchmark (>= 0.3)
+      bigdecimal
+      concurrent-ruby (~> 1.0, >= 1.3.1)
+      connection_pool (>= 2.2.5)
+      drb
       i18n (>= 1.6, < 2)
+      logger (>= 1.4.2)
       minitest (>= 5.1)
-      tzinfo (~> 2.0)
-    addressable (2.8.1)
-      public_suffix (>= 2.0.2, < 6.0)
+      securerandom (>= 0.3)
+      tzinfo (~> 2.0, >= 2.0.5)
+    addressable (2.8.7)
+      public_suffix (>= 2.0.2, < 7.0)
     ast (2.4.2)
-    builder (3.2.4)
-    bundler-audit (0.9.1)
+    base64 (0.2.0)
+    benchmark (0.4.0)
+    bigdecimal (3.1.8)
+    builder (3.3.0)
+    bundler-audit (0.9.2)
       bundler (>= 1.2.0, < 3)
       thor (~> 1.0)
-    concurrent-ruby (1.1.10)
-    crack (0.4.5)
+    concurrent-ruby (1.3.4)
+    connection_pool (2.4.1)
+    crack (1.0.0)
+      bigdecimal
       rexml
     crass (1.0.6)
-    diff-lcs (1.5.0)
-    erubi (1.11.0)
-    ffaker (2.21.0)
-    hashdiff (1.0.1)
-    i18n (1.12.0)
+    diff-lcs (1.5.1)
+    drb (2.2.1)
+    erubi (1.13.0)
+    ffaker (2.23.0)
+    hashdiff (1.1.2)
+    i18n (1.14.6)
       concurrent-ruby (~> 1.0)
-    jbuilder (2.11.5)
+    jbuilder (2.13.0)
       actionview (>= 5.0.0)
       activesupport (>= 5.0.0)
-    loofah (2.18.0)
+    json (2.9.0)
+    language_server-protocol (3.17.0.3)
+    logger (1.6.2)
+    loofah (2.23.1)
       crass (~> 1.0.2)
-      nokogiri (>= 1.5.9)
-    mini_portile2 (2.8.0)
-    minitest (5.16.3)
-    net-hippie (1.1.1)
-    nokogiri (1.13.10)
-      mini_portile2 (~> 2.8.0)
+      nokogiri (>= 1.12.0)
+    minitest (5.25.4)
+    net-hippie (1.2.0)
+      logger (~> 1.0)
+    nokogiri (1.16.8-aarch64-linux)
       racc (~> 1.4)
-    nokogiri (1.13.10-x86_64-linux)
+    nokogiri (1.16.8-arm-linux)
       racc (~> 1.4)
-    parallel (1.21.0)
-    parser (3.1.0.0)
+    nokogiri (1.16.8-arm64-darwin)
+      racc (~> 1.4)
+    nokogiri (1.16.8-x86-linux)
+      racc (~> 1.4)
+    nokogiri (1.16.8-x86_64-darwin)
+      racc (~> 1.4)
+    nokogiri (1.16.8-x86_64-linux)
+      racc (~> 1.4)
+    parallel (1.26.3)
+    parser (3.3.6.0)
       ast (~> 2.4.1)
+      racc
     parslet (2.0.0)
-    public_suffix (5.0.0)
-    racc (1.6.0)
-    rails-dom-testing (2.0.3)
-      activesupport (>= 4.2.0)
+    public_suffix (6.0.1)
+    racc (1.8.1)
+    rails-dom-testing (2.2.0)
+      activesupport (>= 5.0.0)
+      minitest
       nokogiri (>= 1.6)
-    rails-html-sanitizer (1.4.3)
-      loofah (~> 2.3)
+    rails-html-sanitizer (1.6.1)
+      loofah (~> 2.21)
+      nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
     rainbow (3.1.1)
-    rake (13.0.6)
-    regexp_parser (2.2.0)
-    rexml (3.2.5)
-    rspec (3.12.0)
-      rspec-core (~> 3.12.0)
-      rspec-expectations (~> 3.12.0)
-      rspec-mocks (~> 3.12.0)
-    rspec-core (3.12.0)
-      rspec-support (~> 3.12.0)
-    rspec-expectations (3.12.0)
+    rake (13.2.1)
+    regexp_parser (2.9.3)
+    rexml (3.3.9)
+    rspec (3.13.0)
+      rspec-core (~> 3.13.0)
+      rspec-expectations (~> 3.13.0)
+      rspec-mocks (~> 3.13.0)
+    rspec-core (3.13.2)
+      rspec-support (~> 3.13.0)
+    rspec-expectations (3.13.3)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.12.0)
-    rspec-mocks (3.12.0)
+      rspec-support (~> 3.13.0)
+    rspec-mocks (3.13.2)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.12.0)
-    rspec-support (3.12.0)
-    rubocop (0.93.1)
+      rspec-support (~> 3.13.0)
+    rspec-support (3.13.2)
+    rubocop (1.69.1)
+      json (~> 2.3)
+      language_server-protocol (>= 3.17.0)
       parallel (~> 1.10)
-      parser (>= 2.7.1.5)
+      parser (>= 3.3.0.2)
       rainbow (>= 2.2.2, < 4.0)
-      regexp_parser (>= 1.8)
-      rexml
-      rubocop-ast (>= 0.6.0)
+      regexp_parser (>= 2.9.3, < 3.0)
+      rubocop-ast (>= 1.36.2, < 2.0)
       ruby-progressbar (~> 1.7)
-      unicode-display_width (>= 1.4.0, < 2.0)
-    rubocop-ast (1.15.1)
-      parser (>= 3.0.1.1)
-    rubocop-rspec (1.44.1)
-      rubocop (~> 0.87)
-      rubocop-ast (>= 0.7.1)
-    ruby-progressbar (1.11.0)
-    thor (1.2.1)
-    tilt (2.0.11)
+      unicode-display_width (>= 2.4.0, < 4.0)
+    rubocop-ast (1.36.2)
+      parser (>= 3.3.1.0)
+    rubocop-capybara (2.21.0)
+      rubocop (~> 1.41)
+    rubocop-factory_bot (2.26.1)
+      rubocop (~> 1.61)
+    rubocop-rspec (2.31.0)
+      rubocop (~> 1.40)
+      rubocop-capybara (~> 2.17)
+      rubocop-factory_bot (~> 2.22)
+      rubocop-rspec_rails (~> 2.28)
+    rubocop-rspec_rails (2.29.1)
+      rubocop (~> 1.61)
+    ruby-progressbar (1.13.0)
+    securerandom (0.4.0)
+    thor (1.3.2)
+    tilt (2.4.0)
     tilt-jbuilder (0.7.1)
       jbuilder
       tilt (>= 1.3.0, < 3)
-    tzinfo (2.0.5)
+    tzinfo (2.0.6)
       concurrent-ruby (~> 1.0)
-    unicode-display_width (1.8.0)
-    webmock (3.18.1)
+    unicode-display_width (3.1.2)
+      unicode-emoji (~> 4.0, >= 4.0.4)
+    unicode-emoji (4.0.4)
+    webmock (3.24.0)
       addressable (>= 2.8.0)
       crack (>= 0.3.2)
       hashdiff (>= 0.4.0, < 2.0.0)
 
 PLATFORMS
-  ruby
+  aarch64-linux
+  arm-linux
+  arm64-darwin
+  x86-linux
+  x86_64-darwin
   x86_64-linux
 
 DEPENDENCIES
@@ -120,10 +162,10 @@ DEPENDENCIES
   ffaker (~> 2.7)
   rake (~> 13.0)
   rspec (~> 3.0)
-  rubocop (~> 0.52)
-  rubocop-rspec (~> 1.22)
+  rubocop (~> 1.0)
+  rubocop-rspec (~> 2.0)
   scim-kit!
   webmock (~> 3.5)
 
 BUNDLED WITH
-   2.3.6
+   2.5.23
scim-kit.gemspec
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
     File.basename(file)
   end
   spec.require_paths = ['lib']
-  spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
+  spec.required_ruby_version = Gem::Requirement.new('>= 3.1.0')
   spec.metadata['yard.run'] = 'yri'
 
   spec.add_dependency 'activemodel', '>= 6.1', '< 8.0'
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency 'ffaker', '~> 2.7'
   spec.add_development_dependency 'rake', '~> 13.0'
   spec.add_development_dependency 'rspec', '~> 3.0'
-  spec.add_development_dependency 'rubocop', '~> 0.52'
-  spec.add_development_dependency 'rubocop-rspec', '~> 1.22'
+  spec.add_development_dependency 'rubocop', '~> 1.0'
+  spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
   spec.add_development_dependency 'webmock', '~> 3.5'
 end