rusty_json_schema 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cargo.toml +1 -1
- data/ext/Rakefile +42 -0
- data/ext/json_schema.so.x64-mingw32.default +0 -0
- data/{lib/ext/libjson_schema.dylib → ext/json_schema.so.x86_64-darwin-19.default} +0 -0
- data/ext/json_schema.so.x86_64-linux.default +0 -0
- data/lib/rusty_json_schema/binding.rb +1 -7
- data/lib/rusty_json_schema/version.rb +1 -1
- data/lib/tasks/thermite_dir_patch.rb +13 -0
- data/rusty_json_schema.gemspec +14 -2
- metadata +23 -11
- data/lib/ext/json_schema.d +0 -1
- data/lib/ext/json_schema.dll +0 -0
- data/lib/ext/json_schema.dll.exp +0 -0
- data/lib/ext/json_schema.dll.lib +0 -0
- data/lib/ext/json_schema.pdb +0 -0
- data/lib/ext/libjson_schema.d +0 -1
- data/lib/ext/libjson_schema.so +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 817092f70e5c85ce436572e1906c6af05da905499a743db1da6d6e5903def2d6
|
4
|
+
data.tar.gz: 1693e48e350045cefb6114a491291143205c419f9c760fd44e8f14046cafed87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 473b1be704fae2edf7c475d6c98ff545b6206472d51ddb7c98fe4f99604c126d14b4551c81ed583773d48e1dd54e41ca8f60113d6cd8e8eb09f62d17daeaf0a8
|
7
|
+
data.tar.gz: 4c43b2a45914901105008d8d80d5d60cc9378bc4d49df4882819e309b843a7b805d8e8f722515a5083e896403e249407b29bbc0f8505c567133b2a80972e0ac7
|
data/Cargo.toml
CHANGED
data/ext/Rakefile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "thermite/tasks"
|
4
|
+
require_relative "../lib/tasks/thermite_dir_patch"
|
5
|
+
|
6
|
+
project_dir = File.dirname(File.dirname(__FILE__))
|
7
|
+
thermite = Thermite::Tasks.new(cargo_project_path: project_dir,
|
8
|
+
ruby_project_path: project_dir,
|
9
|
+
optional_rust_extension: true)
|
10
|
+
|
11
|
+
namespace :thermite do
|
12
|
+
desc "Try to build extension if cargo is available or setup default lib"
|
13
|
+
task :build_or_default do
|
14
|
+
default_ext_path = "#{thermite.config.ruby_extension_path}.#{Gem::Platform.local}.default"
|
15
|
+
|
16
|
+
if thermite.cargo
|
17
|
+
profile = ENV.fetch("CARGO_PROFILE", "release")
|
18
|
+
thermite.run_cargo_rustc(profile)
|
19
|
+
|
20
|
+
FileUtils.cp(thermite.config.cargo_target_path(profile, thermite.config.cargo_shared_library),
|
21
|
+
thermite.config.ruby_extension_path)
|
22
|
+
elsif File.exist?(default_ext_path)
|
23
|
+
puts "NOTE: Defaults to pre-build binary #{default_ext_path.inspect} => your mileage may vary."
|
24
|
+
|
25
|
+
FileUtils.mv(default_ext_path,
|
26
|
+
thermite.config.ruby_extension_path)
|
27
|
+
|
28
|
+
thermite.inform_user_about_cargo
|
29
|
+
else
|
30
|
+
# Prebuild binary is not available for a given platform, install cargo to
|
31
|
+
# compile the gem
|
32
|
+
raise thermite.cargo_required_msg
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
desc "Cleanup cargo artifacts"
|
37
|
+
task :cargo_clean do
|
38
|
+
thermite.run_cargo_if_exists "clean", *thermite.cargo_manifest_path_args
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
task default: %w[thermite:build_or_default thermite:cargo_clean]
|
Binary file
|
Binary file
|
Binary file
|
@@ -9,13 +9,7 @@ module RustyJSONSchema
|
|
9
9
|
|
10
10
|
extend FFI::Library
|
11
11
|
|
12
|
-
|
13
|
-
case ::FFI::Platform::LIBSUFFIX
|
14
|
-
when "so", "dylib" then "libjson_schema"
|
15
|
-
when "dll" then "json_schema"
|
16
|
-
end
|
17
|
-
|
18
|
-
ffi_lib File.expand_path("../ext/#{lib_name}.#{::FFI::Platform::LIBSUFFIX}", __dir__)
|
12
|
+
ffi_lib File.expand_path("../../ext/json_schema.so", __dir__)
|
19
13
|
|
20
14
|
attach_function :new, :validator_new, [:string], Validator
|
21
15
|
attach_function :free, :validator_free, [Validator], :void
|
data/rusty_json_schema.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "lib/rusty_json_schema/version"
|
4
4
|
|
5
|
-
Gem::Specification.new do |spec|
|
5
|
+
Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
6
6
|
spec.name = "rusty_json_schema"
|
7
7
|
spec.version = RustyJSONSchema::VERSION
|
8
8
|
spec.authors = ["Leszek Zalewski"]
|
@@ -23,10 +23,22 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.metadata["source_code_uri"] = spec.homepage
|
24
24
|
spec.metadata["changelog_uri"] = "https://github.com/driv3r/rusty_json_schema/blob/main/CHANGELOG.md"
|
25
25
|
|
26
|
-
spec.files = Dir[
|
26
|
+
spec.files = Dir[
|
27
|
+
"lib/**/*",
|
28
|
+
"src/**/*.rs",
|
29
|
+
"rusty_json_schema.gemspec",
|
30
|
+
"Cargo.toml",
|
31
|
+
"LICENSE",
|
32
|
+
"README.md",
|
33
|
+
"ext/Rakefile",
|
34
|
+
"ext/*.default"
|
35
|
+
]
|
27
36
|
|
28
37
|
spec.require_paths = ["lib"]
|
29
38
|
|
39
|
+
spec.extensions << "ext/Rakefile"
|
40
|
+
spec.add_runtime_dependency "thermite", "~> 0"
|
41
|
+
|
30
42
|
# Uncomment to register a new dependency of your gem
|
31
43
|
spec.add_dependency "ffi", "~> 1.14"
|
32
44
|
spec.add_dependency "json", ">= 1.0"
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rusty_json_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leszek Zalewski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thermite
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: ffi
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,24 +59,22 @@ description: |2
|
|
45
59
|
email:
|
46
60
|
- leszekzalewski@fastmail.fm
|
47
61
|
executables: []
|
48
|
-
extensions:
|
62
|
+
extensions:
|
63
|
+
- ext/Rakefile
|
49
64
|
extra_rdoc_files: []
|
50
65
|
files:
|
51
66
|
- Cargo.toml
|
52
67
|
- README.md
|
53
|
-
-
|
54
|
-
-
|
55
|
-
-
|
56
|
-
-
|
57
|
-
- lib/ext/json_schema.pdb
|
58
|
-
- lib/ext/libjson_schema.d
|
59
|
-
- lib/ext/libjson_schema.dylib
|
60
|
-
- lib/ext/libjson_schema.so
|
68
|
+
- ext/Rakefile
|
69
|
+
- ext/json_schema.so.x64-mingw32.default
|
70
|
+
- ext/json_schema.so.x86_64-darwin-19.default
|
71
|
+
- ext/json_schema.so.x86_64-linux.default
|
61
72
|
- lib/rusty_json_schema.rb
|
62
73
|
- lib/rusty_json_schema/binding.rb
|
63
74
|
- lib/rusty_json_schema/nodes_array.rb
|
64
75
|
- lib/rusty_json_schema/validator.rb
|
65
76
|
- lib/rusty_json_schema/version.rb
|
77
|
+
- lib/tasks/thermite_dir_patch.rb
|
66
78
|
- rusty_json_schema.gemspec
|
67
79
|
- src/lib.rs
|
68
80
|
homepage: https://github.com/driv3r/rusty_json_schema
|
data/lib/ext/json_schema.d
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
D:\a\rusty_json_schema\rusty_json_schema\target\x86_64-pc-windows-msvc\release\json_schema.dll: D:\a\rusty_json_schema\rusty_json_schema\src\lib.rs
|
data/lib/ext/json_schema.dll
DELETED
Binary file
|
data/lib/ext/json_schema.dll.exp
DELETED
Binary file
|
data/lib/ext/json_schema.dll.lib
DELETED
Binary file
|
data/lib/ext/json_schema.pdb
DELETED
Binary file
|
data/lib/ext/libjson_schema.d
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
/home/runner/work/rusty_json_schema/rusty_json_schema/target/x86_64-unknown-linux-gnu/release/libjson_schema.so: /home/runner/work/rusty_json_schema/rusty_json_schema/src/lib.rs
|
data/lib/ext/libjson_schema.so
DELETED
Binary file
|