rspec-json_api 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6dbc4d7e9cad6a0077c93be19b454999442378eca8cce7b1496b2a4695014a0
4
- data.tar.gz: 976d1585d20673d2d91b0261242bd56a4290cfed483d085fa27b1f737c03e746
3
+ metadata.gz: 6be977d812080cea5feea8a9c9a0a429196c43c06b2aa64e0e742a44e0eb66fd
4
+ data.tar.gz: 77d21174747915fb1c33607eb331e4cfbd8ae9ed9dfa13936bd1cf2436de41af
5
5
  SHA512:
6
- metadata.gz: 290773425e56acd72ac1ba7c1c0832216412ba0d7ee974a7817b4fc2c82e4dbb6c6ca14072b13d53c005fd97b2658f3ef160191c8a944a7733ab74d23efb4b37
7
- data.tar.gz: b8e752a18818eb6815e567727d2ce2ba2cd4653c147e2aa6209f43ad3f70a95c8d96ae0b90579a8a56040c4880e9f32f51037bc9ff953963bf3b5625d373be9c
6
+ metadata.gz: ea7471b8cb4ed9e871917ec51f61426931c765f2c0c46f4bd0c2c5291b3af1fecd855646847897608eace564f734337d34290551b7fca82181b37f9a2eb856da
7
+ data.tar.gz: ef41fe2e7c32dfc6b605cfce7f847ef48a7c0f84878c32ca72178923a0f53e6f556541ef5d28cddb1cd795dc061be7016fa7970266ef369b3f0c693ffb41d9e7
data/.gitattributes ADDED
@@ -0,0 +1,28 @@
1
+ # Set default line ending behavior for all files
2
+ * text=lf
3
+
4
+ # Explicitly declare text files you want to always be normalized and converted
5
+ # to native line endings on checkout.
6
+ *.rb text=lf
7
+ *.rake text=lf
8
+ *.gemspec text=lf
9
+ Gemfile text=lf
10
+ Gemfile.lock text=lf
11
+ Rakefile text=lf
12
+ *.md text=lf
13
+ *.yml text=lf
14
+ *.yaml text=lf
15
+ *.json text=lf
16
+ *.txt text=lf
17
+ *.sh text=lf
18
+
19
+ # Denote all files that are truly binary and should not be modified.
20
+ *.png binary
21
+ *.jpg binary
22
+ *.jpeg binary
23
+ *.gif binary
24
+ *.ico binary
25
+ *.pdf binary
26
+ *.zip binary
27
+ *.tar binary
28
+ *.gz binary
@@ -1,20 +1,45 @@
1
- name: Ruby
2
-
3
- on: [push,pull_request]
4
-
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/checkout@v4
10
- - name: Set up Ruby
11
- uses: ruby/setup-ruby@v1
12
- with:
13
- ruby-version: 3.2.2
14
- bundler: 4.0.4
15
- - name: Bundle gems
16
- run: bundle install
17
- - name: Run rspec
18
- run: bundle exec rspec
19
- - name: Run rubocop
20
- run: bundle exec rubocop
1
+ name: Ruby
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ name: "rspec — Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }}"
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ # Covers the supported range from the floor (Ruby 3.2 / Rails 6.1) to
13
+ # the current ceiling (Ruby 3.4 / Rails 8.1). Curated pairs avoid
14
+ # Ruby/Rails combinations that are not mutually supported.
15
+ include:
16
+ - { ruby: "3.2", gemfile: rails_6_1 }
17
+ - { ruby: "3.2", gemfile: rails_7_1 }
18
+ - { ruby: "3.3", gemfile: rails_7_2 }
19
+ - { ruby: "3.3", gemfile: rails_8_0 }
20
+ - { ruby: "3.4", gemfile: rails_8_0 }
21
+ - { ruby: "3.4", gemfile: rails_8_1 }
22
+ env:
23
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby }}
30
+ bundler-cache: true
31
+ - name: Run rspec
32
+ run: bundle exec rspec
33
+
34
+ lint:
35
+ runs-on: ubuntu-latest
36
+ name: rubocop
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - name: Set up Ruby
40
+ uses: ruby/setup-ruby@v1
41
+ with:
42
+ ruby-version: "3.2"
43
+ bundler-cache: true
44
+ - name: Run rubocop
45
+ run: bundle exec rubocop
data/.gitignore CHANGED
@@ -9,3 +9,9 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ # built gem files
14
+ *.gem
15
+
16
+ # per-appraisal lockfiles (resolved fresh in CI)
17
+ gemfiles/*.gemfile.lock
data/.rubocop.yml CHANGED
@@ -1,50 +1,41 @@
1
- AllCops:
2
- TargetRubyVersion: 3.2
3
- NewCops: enable
4
- SuggestExtensions: false
5
- Exclude:
6
- - "README.md"
7
-
8
- Style/StringLiterals:
9
- Enabled: true
10
- EnforcedStyle: double_quotes
11
-
12
- Style/StringLiteralsInInterpolation:
13
- Enabled: true
14
- EnforcedStyle: double_quotes
15
-
16
- Layout/LineLength:
17
- Max: 120
18
-
19
- Metrics/BlockLength:
20
- Exclude:
21
- - "spec/**/*_spec.rb"
22
-
23
- Metrics/MethodLength:
24
- Exclude:
25
- - "lib/rspec/json_api/compare_hash.rb"
26
- - "lib/extensions/hash.rb"
27
-
28
- Metrics/AbcSize:
29
- Exclude:
30
- - "lib/rspec/json_api/compare_hash.rb"
31
- - "lib/rspec/json_api/matchers/match_json_schema.rb"
32
-
33
- Metrics/CyclomaticComplexity:
34
- Exclude:
35
- - "lib/rspec/json_api/compare_hash.rb"
36
-
37
- Metrics/PerceivedComplexity:
38
- Exclude:
39
- - "lib/rspec/json_api/compare_hash.rb"
40
-
41
- Style/Documentation:
42
- Enabled: false
43
-
44
- Naming/PredicatePrefix:
45
- Exclude:
46
- - "lib/rspec/json_api/matchers.rb"
47
-
48
- Naming/PredicateMethod:
49
- Exclude:
50
- - "lib/rspec/json_api/compare_hash.rb"
1
+ # Append to (rather than replace) RuboCop's default AllCops/Exclude, so the
2
+ # defaults such as vendor/**/* stay excluded. Without this, CI installs gems
3
+ # into vendor/bundle (bundler-cache) and RuboCop would lint third-party gems.
4
+ inherit_mode:
5
+ merge:
6
+ - Exclude
7
+
8
+ AllCops:
9
+ TargetRubyVersion: 3.2
10
+ NewCops: enable
11
+ SuggestExtensions: false
12
+ Exclude:
13
+ - "README.md"
14
+ - "vendor/**/*"
15
+ - "gemfiles/vendor/**/*"
16
+
17
+ Style/StringLiterals:
18
+ Enabled: true
19
+ EnforcedStyle: double_quotes
20
+
21
+ Style/StringLiteralsInInterpolation:
22
+ Enabled: true
23
+ EnforcedStyle: double_quotes
24
+
25
+ Layout/LineLength:
26
+ Max: 120
27
+
28
+ Metrics/BlockLength:
29
+ Exclude:
30
+ - "spec/**/*_spec.rb"
31
+
32
+ Style/Documentation:
33
+ Enabled: false
34
+
35
+ Naming/PredicatePrefix:
36
+ Exclude:
37
+ - "lib/rspec/json_api/matchers.rb"
38
+
39
+ Naming/PredicateMethod:
40
+ Exclude:
41
+ - "lib/rspec/json_api/schema_match.rb"
data/CHANGELOG.md CHANGED
@@ -1,28 +1,55 @@
1
- ## [Unreleased]
2
-
3
- ## [1.4.0] - 2026-01-23
4
-
5
- ### Changed
6
- - Updated Ruby version requirement from `>= 3.0.0` to `>= 3.2.0` (required for Rails 8.1 compatibility)
7
- - Maintained Rails compatibility: supports Rails `>= 6.1.4.1` including Rails 8.1
8
- - Maintained ActiveSupport compatibility: supports ActiveSupport `>= 6.1.4.1` including Rails 8.1
9
- - Maintained RSpec Rails compatibility: supports RSpec Rails `>= 5.0.2` (tested with Rails 8.1)
10
- - Updated Bundler from 2.2.19 to 4.0.4 (latest version as of January 2026)
11
- - Updated RuboCop to `~> 1.65` and updated TargetRubyVersion to 3.2
12
- - Updated Rake to `~> 13.2`
13
- - Updated Diffy to `~> 3.4`
14
- - Updated all transitive dependencies to latest compatible versions
15
- - Verified compatibility with Rails 8.1.2 while maintaining support for older Rails versions
16
- - Added `rubygems_mfa_required` metadata for enhanced security
17
- - Updated GitHub Actions CI workflow to use Ruby 3.2.2 and Bundler 4.0.4
18
-
19
- ### Fixed
20
- - Fixed RuboCop style violations (trailing commas, empty literals, symbol proc usage)
21
- - Fixed module function style (changed `extend self` to `module_function`)
22
- - Fixed line endings in Gemfile (CRLF to LF)
23
- - Fixed CI workflow bundler version mismatch
24
- - Fixed README typos and improved code examples consistency
25
-
26
- ## [0.1.0] - 2021-08-24
27
-
28
- - Initial release
1
+ ## [Unreleased]
2
+
3
+ ## [1.5.0] - 2026-06-05
4
+
5
+ ### Added
6
+ - CI compatibility matrix across Ruby 3.2–3.4 and Rails 6.1, 7.1, 7.2, 8.0 and 8.1 (`gemfiles/` + GitHub Actions matrix), so the advertised version support is actually tested.
7
+ - `RSpec::JsonApi::Constraints` module encapsulating the schema `Proc` options DSL.
8
+ - `RSpec::JsonApi::SchemaMatch` as the single comparison entry point, and `RSpec::JsonApi::Traversal` for the internal structural helpers.
9
+
10
+ ### Changed
11
+ - Depend on `railties` instead of the full `rails` meta-gem; the gem only uses ActiveSupport core extensions and `Rails::Generators`. Drops the dependency graph from 87 to 65 gems. The `>= 6.1.4.1` floor is unchanged.
12
+ - Unified array and hash comparison behind `SchemaMatch`; removed the duplicate `CompareArray` and `CompareHash` modules.
13
+ - Stopped monkey-patching core `Hash`/`Array`; `deep_keys`, `deep_key_paths`, `deep_sort` and `sanitize!` moved into the internal `Traversal` module.
14
+ - The failure diff is now built lazily, only when a match fails.
15
+ - An unsupported schema `Proc` option now raises `ArgumentError` instead of being silently ignored.
16
+ - Generators emit `# frozen_string_literal: true` and freeze the generated interface hash.
17
+
18
+ ### Fixed
19
+ - Require `uri` so the built-in types load on Ruby 4.0 (previously raised `NameError` on load).
20
+ - Anchor the `UUID` type with `\A...\z` so multiline strings no longer pass validation.
21
+ - Rescue invalid JSON in `match_json_schema` instead of raising `JSON::ParserError`.
22
+ - Avoid a `TypeError` when a schema expects a nested object but the actual value is a scalar.
23
+ - Enforce key structure for interface-array elements; an element with an extra null-valued key no longer matches.
24
+ - Reset the memoized diff at the start of `matches?` so a reused matcher reflects the current actual value.
25
+ - Use `Regexp#match?` for regex comparison so it returns a Boolean instead of a match index.
26
+
27
+ ### Removed
28
+ - Dead/broken `interface.erb` generator template.
29
+
30
+ ## [1.4.0] - 2026-01-23
31
+
32
+ ### Changed
33
+ - Updated Ruby version requirement from `>= 3.0.0` to `>= 3.2.0` (required for Rails 8.1 compatibility)
34
+ - Maintained Rails compatibility: supports Rails `>= 6.1.4.1` including Rails 8.1
35
+ - Maintained ActiveSupport compatibility: supports ActiveSupport `>= 6.1.4.1` including Rails 8.1
36
+ - Maintained RSpec Rails compatibility: supports RSpec Rails `>= 5.0.2` (tested with Rails 8.1)
37
+ - Updated Bundler from 2.2.19 to 4.0.4 (latest version as of January 2026)
38
+ - Updated RuboCop to `~> 1.65` and updated TargetRubyVersion to 3.2
39
+ - Updated Rake to `~> 13.2`
40
+ - Updated Diffy to `~> 3.4`
41
+ - Updated all transitive dependencies to latest compatible versions
42
+ - Verified compatibility with Rails 8.1.2 while maintaining support for older Rails versions
43
+ - Added `rubygems_mfa_required` metadata for enhanced security
44
+ - Updated GitHub Actions CI workflow to use Ruby 3.2.2 and Bundler 4.0.4
45
+
46
+ ### Fixed
47
+ - Fixed RuboCop style violations (trailing commas, empty literals, symbol proc usage)
48
+ - Fixed module function style (changed `extend self` to `module_function`)
49
+ - Fixed line endings in Gemfile (CRLF to LF)
50
+ - Fixed CI workflow bundler version mismatch
51
+ - Fixed README typos and improved code examples consistency
52
+
53
+ ## [0.1.0] - 2021-08-24
54
+
55
+ - Initial release
data/Gemfile CHANGED
@@ -1,14 +1,14 @@
1
- # frozen_string_literal: true
2
-
3
- # Bundler version: 4.0.4 (see Gemfile.lock BUNDLED WITH section)
4
- source "https://rubygems.org"
5
- git_source(:github) { |repo| "https://github.com/#{repo}.git" }
6
-
7
- # Specify your gem's dependencies in rspec-json_api.gemspec
8
- gemspec
9
-
10
- gem "activesupport", ">= 6.1.4.1"
11
- gem "diffy", "~> 3.4"
12
- gem "rake", "~> 13.2"
13
- gem "rspec-rails", ">= 5.0.2"
14
- gem "rubocop", "~> 1.65"
1
+ # frozen_string_literal: true
2
+
3
+ # Bundler version: 4.0.4 (see Gemfile.lock BUNDLED WITH section)
4
+ source "https://rubygems.org"
5
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
6
+
7
+ # Specify your gem's dependencies in rspec-json_api.gemspec
8
+ gemspec
9
+
10
+ gem "activesupport", ">= 6.1.4.1"
11
+ gem "diffy", "~> 3.4"
12
+ gem "rake", "~> 13.2"
13
+ gem "rspec-rails", ">= 5.0.2"
14
+ gem "rubocop", "~> 1.65"