rust_json_schema 0.2.1-arm64-darwin → 0.3.0-arm64-darwin

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: d1a32ad6dc1d30e4eb6782916d516ffe618503469daca0ffad7744002ba09ea8
4
- data.tar.gz: b446fede91907338f1bcfb73d1b585fc0d9180c9945095b72cb07439e82b21ba
3
+ metadata.gz: bd2ff6d65b0bed855456f28962c66ce46f571db4e7d5dfa1344ff48b16a66e75
4
+ data.tar.gz: 1fd9f38c4d76c99262c44e0b8c3f34843c87066c72813513f64c32de185b6562
5
5
  SHA512:
6
- metadata.gz: 14e56f7702e4e30578291f80d0cc23127058a48db79b78b9d05a3814e134e6baf2e09bef7f87a55098cf3809a83dea8574a98301386d6256c3354f2612a36ff7
7
- data.tar.gz: 713f76b05a94be1d81c82048b72e3665566f49a77e8daf8aaf69c33a4e1034f4dc95cf6883882026d7271654f6fa2f69f67dbf5eb497bb13364a6e8dd9f175a8
6
+ metadata.gz: afab030d1b2cd1c8e9b17bee8be2b48f1cf685c288de450d89a062aed644a24552c2ac354229629d38e9be3249a66524b36c13ce99d5e424592893d973ce7a02
7
+ data.tar.gz: 2aff8ad637e457eced699c709e4d49a70aeab1e0213e2c04850d8050d1a9da9c5b4718ec39fff6fa55be531aae8e49bea5bdc9f9018c598c0c9448a85dd558e8
data/README.md CHANGED
@@ -4,6 +4,9 @@
4
4
 
5
5
  `rust_json_schema` is a Ruby wrapper gem for Rust's [jsonschema-rs crate](https://github.com/Stranger6667/jsonschema-rs).
6
6
 
7
+ > [!IMPORTANT]
8
+ > This gem is built with `json_schema` crate version `0.19.1`, and therefore does not support any features for any potential future versions of the crate. I will review and accept PRs if you would like to work on adding support for newer versions of the crate. I generally am trying to keep things up to date but I am not cutting new releases for each new patch version of the crate.
9
+
7
10
  The minimum Ruby version required by this gem is 3.0, due to the runtime Rust libraries that make the extensions possible (and easy).
8
11
 
9
12
  This gem ships with precompiled binaries for Linux and macOS. Check the available gems on [Rubygems](https://rubygems.org/gems/rust_json_schema). Precompiled binaries do not exist for non-standard rubies like JRuby or TruffleRuby, nor do they exist for Windows. I will review and accept PRs if you would like to work on adding these build targets.
@@ -38,11 +41,7 @@ schema = <<~JSON
38
41
  }
39
42
  JSON
40
43
 
41
- validator = RustJSONSchema::Validator.new(
42
- schema,
43
- draft: :draft7,
44
- with_meta_schemas: false
45
- )
44
+ validator = RustJSONSchema::Validator.new(schema, draft: :draft7)
46
45
 
47
46
  errors = validator.validate('{ "foo": 1, "bar": "wadus" }')
48
47
  # => [
@@ -54,8 +53,7 @@ errors = validator.validate('{ "foo": 1, "bar": "wadus" }')
54
53
 
55
54
  ### Options
56
55
 
57
- - `:draft` - Select the JSON schema draft number to use. Valid options are `draft4`, `draft6`, `draft7`, `draft201909`, and `draft202012`. Supported drafts are entirely determined by the `jsonschema` crate. The default draft is also determined by the crate. If new versions of the crate support additional draft versions, a code change in this gem will be required. I'm open to PRs to solve this problem - I don't know enough Rust to tell if it's easily done. *Both `draft201909` and `draft202012` are reported to have "some keywords not implemented", so use them at your own risk.*
58
- - `:with_meta_schemas` - See [docs.rs/jsonschema CompilationOptions with_meta_schemas](https://docs.rs/jsonschema/0.17.1/jsonschema/struct.CompilationOptions.html#method.with_meta_schemas). `false` by default.
56
+ - `:draft` - Select the JSON schema draft number to use. Valid options are `draft4`, `draft6`, `draft7`, `draft201909`, and `draft202012`. Supported drafts are entirely determined by the `jsonschema` crate. The default draft is also determined by the crate. If new versions of the crate support additional draft versions, a code change in this gem will be required. I'm open to PRs to solve this problem - I don't know enough Rust to tell if it's easily done. _Both `draft201909` and `draft202012` are reported to have "some keywords not implemented", so use them at your own risk._
59
57
 
60
58
  Any additional options provided by the `jsonschema` crate are options I do not understand or may not make sense to implement in a wrapper library such as this.
61
59
 
@@ -70,7 +68,11 @@ Any additional options provided by the `jsonschema` crate are options I do not u
70
68
 
71
69
  ## Development
72
70
 
73
- TODO
71
+ The rust extension is located at `ext/rust_json_schema`, and can be compiled using the `rake-compiler` tasks, usually `bin/rake compile`. Don't attempt to `cargo build` the extension separately, that typically doesn't work. View other rake tasks with `bin/rake --tasks`.
72
+
73
+ You can run the tests with `bin/rspec`, but ensure any changes to the rust extension are compiled first.
74
+
75
+ To release a new version, update the version number in `version.rb`, tag the new commit with the version number, and push the tag to GitHub. The gem will be built and pushed to Rubygems automatically. This will also automatically build the platform-specific binaries and attach them to the release.
74
76
 
75
77
  ## Contributing
76
78
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RustJSONSchema
4
- VERSION = "0.2.1"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rust_json_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Taylor Thurlow
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-16 00:00:00.000000000 Z
11
+ date: 2024-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -57,13 +57,13 @@ files:
57
57
  - lib/rust_json_schema/3.3/rust_json_schema.bundle
58
58
  - lib/rust_json_schema/version.rb
59
59
  - sig/rust_json_schema.rbs
60
- homepage: https://github.com/taylorthurlow/rust_json_schema
60
+ homepage: https://github.com/taylorthurlow/rust_json_schema-rb
61
61
  licenses:
62
62
  - MIT
63
63
  metadata:
64
- homepage_uri: https://github.com/taylorthurlow/rust_json_schema
65
- source_code_uri: https://github.com/taylorthurlow/rust_json_schema
66
- changelog_uri: https://github.com/taylorthurlow/rust_json_schema/releases
64
+ homepage_uri: https://github.com/taylorthurlow/rust_json_schema-rb
65
+ source_code_uri: https://github.com/taylorthurlow/rust_json_schema-rb
66
+ changelog_uri: https://github.com/taylorthurlow/rust_json_schema-rb/releases
67
67
  post_install_message:
68
68
  rdoc_options: []
69
69
  require_paths: