enveloperb 0.1.5 → 0.1.5.4.g10f5d39

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,12 +6,12 @@ edition = "2021"
6
6
  [dependencies]
7
7
  enveloper = { git = "https://github.com/cipherstash/enveloper", branch = "main" }
8
8
  lazy_static = "^0.2.2"
9
- rutie = { version = "0.8.4", features = ["no-link"] }
9
+ rb-sys = "0.8.0"
10
+ rutie = { git = "https://github.com/mpalmer/rutie", branch = "rb_sys" }
10
11
  tokio = { version = "^1.17.0", features = [ "rt-multi-thread" ] }
11
12
  aws-config = "0.10.1"
12
13
  aws-sdk-kms = "0.10.1"
13
14
  aws-types = { version = "0.10.1", features = [ "hardcoded-credentials" ] }
14
15
 
15
16
  [lib]
16
- name = "enveloperb"
17
17
  crate-type = ["cdylib"]
@@ -0,0 +1,4 @@
1
+ require "mkmf"
2
+ require "rb_sys/mkmf"
3
+
4
+ create_rust_makefile("enveloperb/enveloperb")
@@ -173,8 +173,8 @@ methods!(
173
173
 
174
174
  #[allow(non_snake_case)]
175
175
  #[no_mangle]
176
- pub extern "C" fn Init_libenveloperb() {
177
- Module::new("Enveloperb").define(|envmod| {
176
+ pub extern "C" fn Init_enveloperb() {
177
+ Module::from_existing("Enveloperb").define(|envmod| {
178
178
  envmod.define_nested_class("Simple", None).define(|klass| {
179
179
  klass.singleton_class().def_private("_new", enveloperb_simple_new);
180
180
  klass.def_private("_encrypt", enveloperb_simple_encrypt);
data/lib/enveloperb.rb CHANGED
@@ -1,12 +1,14 @@
1
- require "fiddle"
1
+ module Enveloperb
2
+ end
2
3
 
3
4
  begin
4
- Fiddle::Function.new(Fiddle.dlopen("#{__dir__}/#{RbConfig::CONFIG["ruby_version"]}/libenveloperb.#{RbConfig::CONFIG["SOEXT"]}")["Init_libenveloperb"], [], Fiddle::TYPE_VOIDP).call
5
- rescue Fiddle::DLError
5
+ RUBY_VERSION =~ /(\d+\.\d+)/
6
+ require_relative "./#{RUBY_VERSION}/enveloperb"
7
+ rescue LoadError
6
8
  begin
7
- Fiddle::Function.new(Fiddle.dlopen("#{__dir__}/libenveloperb.#{RbConfig::CONFIG["SOEXT"]}")["Init_libenveloperb"], [], Fiddle::TYPE_VOIDP).call
8
- rescue Fiddle::DLError
9
- raise LoadError, "Failed to initialize libenveloperb.#{RbConfig::CONFIG["SOEXT"]}; either it hasn't been built, or was built incorrectly for your system"
9
+ require_relative "./enveloperb.#{RbConfig::CONFIG["DLEXT"]}"
10
+ rescue LoadError
11
+ raise LoadError, "Failed to load enveloperb.#{RbConfig::CONFIG["DLEXT"]}; either it hasn't been built, or was built incorrectly for your system"
10
12
  end
11
13
  end
12
14
 
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enveloperb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.5.4.g10f5d39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-02 00:00:00.000000000 Z
11
+ date: 2022-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: fiddle
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.1'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.1'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: bundler
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -72,20 +58,42 @@ dependencies:
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: '10.4'
76
- - - ">="
61
+ version: '13.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
77
67
  - !ruby/object:Gem::Version
78
- version: 10.4.2
68
+ version: '13.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake-compiler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.2'
79
76
  type: :development
80
77
  prerelease: false
81
78
  version_requirements: !ruby/object:Gem::Requirement
82
79
  requirements:
83
80
  - - "~>"
84
81
  - !ruby/object:Gem::Version
85
- version: '10.4'
86
- - - ">="
82
+ version: '1.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake-compiler-dock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
87
88
  - !ruby/object:Gem::Version
88
- version: 10.4.2
89
+ version: '1.2'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.2'
89
97
  - !ruby/object:Gem::Dependency
90
98
  name: rb-inotify
91
99
  requirement: !ruby/object:Gem::Requirement
@@ -100,6 +108,20 @@ dependencies:
100
108
  - - "~>"
101
109
  - !ruby/object:Gem::Version
102
110
  version: '0.9'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rb_sys
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.1'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.1'
103
125
  - !ruby/object:Gem::Dependency
104
126
  name: redcarpet
105
127
  requirement: !ruby/object:Gem::Requirement
@@ -161,21 +183,23 @@ email:
161
183
  - matt@cipherstash.com
162
184
  executables: []
163
185
  extensions:
164
- - ext/Rakefile
186
+ - ext/enveloperb/extconf.rb
165
187
  extra_rdoc_files: []
166
188
  files:
167
189
  - CODE_OF_CONDUCT.md
168
190
  - CONTRIBUTING.md
169
- - Cargo.toml
170
191
  - LICENCE
171
192
  - README.md
172
193
  - enveloperb.gemspec
173
- - ext/Rakefile
194
+ - ext/enveloperb/.gitignore
195
+ - ext/enveloperb/Cargo.lock
196
+ - ext/enveloperb/Cargo.toml
197
+ - ext/enveloperb/extconf.rb
198
+ - ext/enveloperb/src/lib.rs
174
199
  - lib/enveloperb.rb
175
200
  - lib/enveloperb/awskms.rb
176
201
  - lib/enveloperb/encrypted_record.rb
177
202
  - lib/enveloperb/simple.rb
178
- - src/lib.rs
179
203
  homepage: https://github.com/cipherstash/enveloperb
180
204
  licenses: []
181
205
  metadata: {}
@@ -190,9 +214,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
214
  version: 2.7.0
191
215
  required_rubygems_version: !ruby/object:Gem::Requirement
192
216
  requirements:
193
- - - ">="
217
+ - - ">"
194
218
  - !ruby/object:Gem::Version
195
- version: '0'
219
+ version: 1.3.1
196
220
  requirements: []
197
221
  rubygems_version: 3.1.6
198
222
  signing_key:
data/ext/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- task :build do
2
- extra_flags = if RbConfig::CONFIG["SOEXT"] == "dylib"
3
- ["--", "-C", "link-args=-flat_namespace -undefined suppress"]
4
- else
5
- []
6
- end
7
-
8
- sh *(["cargo", "rustc", "--release"] + extra_flags)
9
- mv "../target/release/libenveloperb.#{RbConfig::CONFIG["SOEXT"]}", "../lib" rescue nil
10
- end
11
-
12
- task default: :build