rust_json_schema 0.1.1-x86_64-linux → 0.1.2-x86_64-linux

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: ed875d1520e782d339da205e717e3096608c3c72b3cbebd9a2804d2a6e4fda27
4
- data.tar.gz: 9374e434c3546812b2681bb6d13997e95602d5270f05ff98062fb572a4a9a386
3
+ metadata.gz: 949b8bd842cd56d63dad882907673ae3cb157e0ce505d24e82c9a9e14278ed72
4
+ data.tar.gz: 4210809034c4be8ff29c5f64fc62deacfdb240a9cf6244da24f414e8dc1d40c3
5
5
  SHA512:
6
- metadata.gz: 12719f58bf15a60bdf26a581f8ae86910d14b1ea4da98a8a743b0f6f7ce71afdab3cb231017a27bccafb80829ed2833c374e0c1b36e15855182ef1f943dad9cc
7
- data.tar.gz: 9f611191c75f6d9a4f421c9fe5acbbe910b0fb15b64e2aa2ec47ce338b2c7a5fa125f1cf657c4f07ed2f675b06ffb9f5cc216a19f9ccb82c5bd46dbaff54e8a1
6
+ metadata.gz: 73af925bcca98e89864c6b2ee9dfcd7358951ece87b7ed8f49a5cd51d3cdfd52e88e60984a9634cc6b172c36a14c431478a78d8f0cd5390b854dc93ccce377b9
7
+ data.tar.gz: 8bd9f184bfec474ad452e358dac683e8df57e020aba22573575c1ea339a2971548136c88902b4a48788271eeb5d97619b14a6e3ce0ba1f497400c91f757c0be5
data/README.md CHANGED
@@ -1,14 +1,16 @@
1
1
  # `rust_json_schema`
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/rust_json_schema.svg)](https://rubygems.org/gems/rust_json_schema)
4
+
3
5
  `rust_json_schema` is a Ruby wrapper gem for Rust's [jsonschema-rs crate](https://github.com/Stranger6667/jsonschema-rs).
4
6
 
7
+ This gem ships with precompiled binaries for Linux and macOS. Check the available gems on [Rubygems](https://rubygems.org/gems/rust_json_schema).
8
+
5
9
  ## Warning
6
10
 
7
11
  I do not have any significant Rust programming experience, but this gem satisifies a need for a performant JSON Schema validation tool in Ruby land. While I intend to use this gem in a production environment, consider this code and library entirely experimental, at least until a 1.0 release, if it ever comes to that.
8
12
 
9
- [rusty_json_schema](https://github.com/driv3r/rusty_json_schema) is a direct source of inspiration (and in some cases, literal copy and paste, like some fixtures/specs). Now that [bundler has explicit support for rust-backed Ruby gems](https://bundler.io/blog/2023/01/31/rust-gem-skeleton.html) as of early 2023, the Rust library code is a lot simpler that it previously needed to be, largely thanks to [magnus crate](https://github.com/matsadler/magnus) and the [rb-sys gem](https://github.com/oxidize-rb/rb-sys/tree/main/gem).
10
-
11
- Eventually I intend to ship common platform binaries as part of this gem, eliminating the need for a Rust toolchain on client machines, but that is not yet the case.
13
+ [rusty_json_schema](https://github.com/driv3r/rusty_json_schema) is a direct source of inspiration (and in some cases, literal copy and paste, like some fixtures/specs). Now that [bundler has explicit support for rust-backed Ruby gems](https://bundler.io/blog/2023/01/31/rust-gem-skeleton.html) as of early 2023, the Rust library code is a lot simpler that it previously needed to be, largely thanks to [magnus crate](https://github.com/matsadler/magnus) and the [rb-sys gem](https://github.com/oxidize-rb/rb-sys/tree/main/gem), and by extension, the [oxidize-rb team](https://github.com/oxidize-rb).
12
14
 
13
15
  ## Installation
14
16
 
@@ -28,9 +30,9 @@ validator = RustJSONSchema::Validator.new(<<~JSON)
28
30
  "properties": {
29
31
  "foo": { "type": "string" },
30
32
  "bar": { "type": "integer" },
31
- "baz": {},
33
+ "baz": {}
32
34
  },
33
- "required": ["foo", "baz"],
35
+ "required": ["foo", "baz"]
34
36
  }
35
37
  JSON
36
38
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RustJSONSchema
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -2,14 +2,6 @@
2
2
 
3
3
  require_relative "rust_json_schema/version"
4
4
 
5
- # Tries to require the extension for the given Ruby version first
6
- begin
7
- RUBY_VERSION =~ /(\d+\.\d+)/
8
- require "rust_json_schema/#{Regexp.last_match(1)}/rust_json_schema"
9
- rescue LoadError
10
- require_relative "rust_json_schema/rust_json_schema"
11
- end
12
-
13
5
  module RustJSONSchema
14
6
  class Error < StandardError; end
15
7
 
@@ -17,3 +9,11 @@ module RustJSONSchema
17
9
 
18
10
  class SchemaParseError < Error; end
19
11
  end
12
+
13
+ # Tries to require the extension for the given Ruby version first
14
+ begin
15
+ RUBY_VERSION =~ /(\d+\.\d+)/
16
+ require "rust_json_schema/#{Regexp.last_match(1)}/rust_json_schema"
17
+ rescue LoadError
18
+ require_relative "rust_json_schema/rust_json_schema"
19
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rust_json_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Taylor Thurlow