RubyInline 3.14.1 → 3.14.3

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: eadac7653c5cb624b0778ea6fabb5f5db8358785daf928d52137125547989542
4
- data.tar.gz: 05f475f961350b3ae11b88de02d41646288a18ca1193446f915923cae2ba6150
3
+ metadata.gz: 1544045e5ff822ae0df2440cf5aa07550bcd11c83b154023c19f1c71d86aa823
4
+ data.tar.gz: 4daa813b6195d059eabf8db6efdcd64434df4eba73fbc0cc39f935b93277853a
5
5
  SHA512:
6
- metadata.gz: d377fec0166d04b22bd4ba0c283f0cb9c72d1f998d6651030dc7a897dc40a0bcab17497defc4d5fd0f87af6eb5e170bd5c34b8950780a4f32c4137c3d58fe6af
7
- data.tar.gz: c59d0575650d5a607795a97f449679e7a7614fe0d827662603ea3d226912eebc81db35cdcf743c96f7e579086fd37472a33943f1caaba32116ffc8962deac2fc
6
+ metadata.gz: 9db62859fe6f7ffb8323bfa8996a6fdee2b4cd4e52f2bdac02b152add01c7f545f89cdb3d903400d8fe16892e71d1b6483ab37b8a90e56b2652a3e25e41dde90
7
+ data.tar.gz: ca820edac65e90c2e2dbf2c6acf39103f7a7fe7eed174cfe98ddec5a6b9ceac57e02f98d92f9f91297f06d385ce7f92f7ca334ad525619f9c4a466d1fb3e9207
checksums.yaml.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,16 @@
1
+ === 3.14.3 / 2026-02-02
2
+
3
+ * 1 bug fix:
4
+
5
+ * Fixed regexp to handle nested parens in mingw. (fenrir-naru)
6
+
7
+ === 3.14.2 / 2025-03-11
8
+
9
+ * 2 bug fixes:
10
+
11
+ * Fix for windows builds. (fenrir-naru)
12
+ * Ruby 3.4: Fixed breakage from ruby 3.4 call stack changes.
13
+
1
14
  === 3.14.1 / 2024-06-23
2
15
 
3
16
  * 1 bug fix:
data/README.txt CHANGED
@@ -63,7 +63,8 @@ See hoe for more details.
63
63
  class MyTest
64
64
  inline(:C) do |builder|
65
65
  builder.include '<iostream>'
66
- builder.add_compile_flags '-x c++', '-lstdc++'
66
+ builder.add_compile_flags '-x c++'
67
+ builder.add_link_flags '-lstdc++'
67
68
  builder.c '
68
69
  void hello(int i) {
69
70
  while (i-- > 0) {
data/lib/inline.rb CHANGED
@@ -65,7 +65,7 @@ class CompilationError < RuntimeError; end
65
65
  # the current namespace.
66
66
 
67
67
  module Inline
68
- VERSION = "3.14.1"
68
+ VERSION = "3.14.3"
69
69
 
70
70
  WINDOZE = /mswin|mingw/ =~ RUBY_PLATFORM
71
71
  DEV_NULL = (WINDOZE ? 'nul' : '/dev/null')
@@ -394,11 +394,20 @@ module Inline
394
394
 
395
395
  attr_accessor :struct_name
396
396
 
397
+ # 3.3: "test/test_inline.rb:88:in `new'"
398
+ # 3.4: "lib/inline.rb:846:in 'Class#new'"
399
+
400
+ STACK_RE = if RUBY_VERSION > "3.4" then
401
+ /in .+?[.#](inline|setup)/
402
+ else
403
+ /in .(inline|setup)/
404
+ end
405
+
397
406
  def initialize(mod)
398
407
  raise ArgumentError, "Class/Module arg is required" unless Module === mod
399
408
  # new (but not on some 1.8s) -> inline -> real_caller|eval
400
409
  stack = caller
401
- meth = stack.shift until meth =~ /in .(inline|test_|setup)/ or stack.empty?
410
+ meth = stack.shift until meth =~ STACK_RE or stack.empty?
402
411
  raise "Couldn't discover caller" if stack.empty?
403
412
  real_caller = stack.first
404
413
  real_caller = stack[3] if real_caller =~ /\(eval\)/
@@ -575,7 +584,7 @@ VALUE #{method}_equals(VALUE value) {
575
584
  nil
576
585
  end
577
586
 
578
- windoze = WINDOZE and RUBY_PLATFORM =~ /mswin/
587
+ windoze = (WINDOZE and RUBY_PLATFORM =~ /mswin/)
579
588
  sane = ! windoze
580
589
  cmd = [ RbConfig::CONFIG['LDSHARED'],
581
590
  flags,
@@ -599,7 +608,7 @@ VALUE #{method}_equals(VALUE value) {
599
608
  cmd = cmd.gsub(/-Wl,-soname,\$@/, "-Wl,-soname,#{File.basename so_name}")
600
609
 
601
610
  # strip off some makefile macros for mingw 1.9
602
- cmd = cmd.gsub(/\$\(.*\)/, '') if RUBY_PLATFORM =~ /mingw/
611
+ cmd = cmd.gsub(/\$(?<par>\((?:[^()]|\g<par>)*\))/, '') if RUBY_PLATFORM =~ /mingw/
603
612
 
604
613
  cmd += " 2> #{DEV_NULL}" if $TESTING and not $DEBUG
605
614
 
data/test/test_inline.rb CHANGED
@@ -83,9 +83,11 @@ end
83
83
  class TestInline
84
84
  class TestC < InlineTestCase
85
85
 
86
+ attr_accessor :builder
87
+
86
88
  def setup
87
89
  super
88
- @builder = Inline::C.new(self.class)
90
+ self.builder = Inline::C.new self.class
89
91
  end
90
92
 
91
93
 
@@ -98,17 +100,14 @@ class TestC < InlineTestCase
98
100
  end
99
101
 
100
102
  def test_initialize
101
- x = Inline::C.new(self.class)
102
- assert_equal TestInline::TestC, x.mod
103
- assert_equal [], x.src
104
- assert_equal({}, x.sig)
105
- assert_equal [], x.flags
106
- assert_equal [], x.libs
103
+ assert_equal TestInline::TestC, builder.mod
104
+ assert_equal [], builder.src
105
+ assert_equal({}, builder.sig)
106
+ assert_equal [], builder.flags
107
+ assert_equal [], builder.libs
107
108
  end
108
109
 
109
110
  def test_accessor
110
- builder = Inline::C.new self.class
111
-
112
111
  builder.struct_name = 'MyStruct'
113
112
  builder.accessor 'method_name', 'int'
114
113
 
@@ -146,8 +145,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
146
145
  end
147
146
 
148
147
  def test_accessor_member_name
149
- builder = Inline::C.new self.class
150
-
151
148
  builder.struct_name = 'MyStruct'
152
149
  builder.accessor 'method_name', 'int', 'member_name'
153
150
 
@@ -185,8 +182,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
185
182
  end
186
183
 
187
184
  def test_accessor_no_struct_name
188
- builder = Inline::C.new self.class
189
-
190
185
  e = assert_raises RuntimeError do
191
186
  builder.accessor 'method_name', 'int'
192
187
  end
@@ -195,8 +190,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
195
190
  end
196
191
 
197
192
  def test_add_type_converter
198
- builder = Inline::C.new self.class
199
-
200
193
  builder.add_type_converter 'my_type', 'ruby_type2my_type',
201
194
  'my_type2ruby_type'
202
195
 
@@ -205,8 +198,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
205
198
  end
206
199
 
207
200
  def test_alias_type_converter
208
- builder = Inline::C.new self.class
209
-
210
201
  builder.alias_type_converter 'long long', 'int64_t'
211
202
 
212
203
  assert_equal 'LL2NUM', builder.c2ruby('int64_t')
@@ -214,8 +205,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
214
205
  end
215
206
 
216
207
  def test_reader
217
- builder = Inline::C.new self.class
218
-
219
208
  builder.struct_name = 'MyStruct'
220
209
  builder.reader 'method_name', 'int'
221
210
 
@@ -238,8 +227,6 @@ static VALUE method_name(VALUE self) {
238
227
  end
239
228
 
240
229
  def test_reader_member_name
241
- builder = Inline::C.new self.class
242
-
243
230
  builder.struct_name = 'MyStruct'
244
231
  builder.reader 'method_name', 'int', 'member_name'
245
232
 
@@ -262,8 +249,6 @@ static VALUE method_name(VALUE self) {
262
249
  end
263
250
 
264
251
  def test_reader_no_struct_name
265
- builder = Inline::C.new self.class
266
-
267
252
  e = assert_raises RuntimeError do
268
253
  builder.reader 'method_name', 'int'
269
254
  end
@@ -272,8 +257,6 @@ static VALUE method_name(VALUE self) {
272
257
  end
273
258
 
274
259
  def test_remove_type_converter
275
- builder = Inline::C.new self.class
276
-
277
260
  builder.remove_type_converter 'long'
278
261
 
279
262
  assert_raises ArgumentError do
@@ -282,8 +265,6 @@ static VALUE method_name(VALUE self) {
282
265
  end
283
266
 
284
267
  def test_writer
285
- builder = Inline::C.new self.class
286
-
287
268
  builder.struct_name = 'MyStruct'
288
269
  builder.writer 'method_name', 'int'
289
270
 
@@ -309,8 +290,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
309
290
  end
310
291
 
311
292
  def test_writer_member_name
312
- builder = Inline::C.new self.class
313
-
314
293
  builder.struct_name = 'MyStruct'
315
294
  builder.writer 'method_name', 'int', 'member_name'
316
295
 
@@ -336,8 +315,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
336
315
  end
337
316
 
338
317
  def test_writer_no_struct_name
339
- builder = Inline::C.new self.class
340
-
341
318
  e = assert_raises RuntimeError do
342
319
  builder.writer 'method_name', 'int'
343
320
  end
@@ -346,55 +323,53 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
346
323
  end
347
324
 
348
325
  def test_ruby2c
349
- x = Inline::C.new(self.class)
350
- assert_equal 'NUM2CHR', x.ruby2c("char")
351
- assert_equal 'StringValuePtr', x.ruby2c("char *")
326
+ assert_equal 'NUM2CHR', builder.ruby2c("char")
327
+ assert_equal 'StringValuePtr', builder.ruby2c("char *")
352
328
 
353
- assert_equal "FI\X2INT", x.ruby2c("int")
354
- assert_equal 'NUM2UINT', x.ruby2c("unsigned")
355
- assert_equal 'NUM2UINT', x.ruby2c("unsigned int")
329
+ assert_equal "FI\X2INT", builder.ruby2c("int")
330
+ assert_equal 'NUM2UINT', builder.ruby2c("unsigned")
331
+ assert_equal 'NUM2UINT', builder.ruby2c("unsigned int")
356
332
 
357
- assert_equal 'NUM2LONG', x.ruby2c("long")
358
- assert_equal 'NUM2ULONG', x.ruby2c("unsigned long")
333
+ assert_equal 'NUM2LONG', builder.ruby2c("long")
334
+ assert_equal 'NUM2ULONG', builder.ruby2c("unsigned long")
359
335
 
360
- assert_equal 'NUM2LL', x.ruby2c("long long")
361
- assert_equal 'NUM2ULL', x.ruby2c("unsigned long long")
336
+ assert_equal 'NUM2LL', builder.ruby2c("long long")
337
+ assert_equal 'NUM2ULL', builder.ruby2c("unsigned long long")
362
338
 
363
- assert_equal 'NUM2DBL', x.ruby2c("double")
339
+ assert_equal 'NUM2DBL', builder.ruby2c("double")
364
340
 
365
- assert_equal 'NUM2OFFT', x.ruby2c("off_t")
341
+ assert_equal 'NUM2OFFT', builder.ruby2c("off_t")
366
342
 
367
- assert_equal '', x.ruby2c("VALUE")
343
+ assert_equal '', builder.ruby2c("VALUE")
368
344
 
369
345
  assert_raises ArgumentError do
370
- x.ruby2c('blah')
346
+ builder.ruby2c('blah')
371
347
  end
372
348
  end
373
349
 
374
350
  def test_c2ruby
375
- x = Inline::C.new(self.class)
376
- assert_equal 'CHR2FIX', x.c2ruby("char")
351
+ assert_equal 'CHR2FIX', builder.c2ruby("char")
377
352
 
378
- assert_equal 'rb_str_new2', x.c2ruby("char *")
353
+ assert_equal 'rb_str_new2', builder.c2ruby("char *")
379
354
 
380
- assert_equal 'INT2FIX', x.c2ruby("int")
381
- assert_equal 'UINT2NUM', x.c2ruby("unsigned int")
382
- assert_equal 'UINT2NUM', x.c2ruby("unsigned")
355
+ assert_equal 'INT2FIX', builder.c2ruby("int")
356
+ assert_equal 'UINT2NUM', builder.c2ruby("unsigned int")
357
+ assert_equal 'UINT2NUM', builder.c2ruby("unsigned")
383
358
 
384
- assert_equal 'LONG2NUM', x.c2ruby("long")
385
- assert_equal 'ULONG2NUM', x.c2ruby("unsigned long")
359
+ assert_equal 'LONG2NUM', builder.c2ruby("long")
360
+ assert_equal 'ULONG2NUM', builder.c2ruby("unsigned long")
386
361
 
387
- assert_equal 'LL2NUM', x.c2ruby("long long")
388
- assert_equal 'ULL2NUM', x.c2ruby("unsigned long long")
362
+ assert_equal 'LL2NUM', builder.c2ruby("long long")
363
+ assert_equal 'ULL2NUM', builder.c2ruby("unsigned long long")
389
364
 
390
- assert_equal 'rb_float_new', x.c2ruby("double")
365
+ assert_equal 'rb_float_new', builder.c2ruby("double")
391
366
 
392
- assert_equal 'OFFT2NUM', x.c2ruby("off_t")
367
+ assert_equal 'OFFT2NUM', builder.c2ruby("off_t")
393
368
 
394
- assert_equal '', x.c2ruby("VALUE")
369
+ assert_equal '', builder.c2ruby("VALUE")
395
370
 
396
371
  assert_raises ArgumentError do
397
- x.c2ruby('blah')
372
+ builder.c2ruby('blah')
398
373
  end
399
374
  end
400
375
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,18 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RubyInline
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.14.1
4
+ version: 3.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain:
11
10
  - |
12
11
  -----BEGIN CERTIFICATE-----
13
- MIIDPjCCAiagAwIBAgIBCDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
12
+ MIIDPjCCAiagAwIBAgIBCjANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
13
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTI0MDEwMjIxMjEyM1oXDTI1MDEwMTIxMjEyM1owRTETMBEGA1UE
14
+ GRYDY29tMB4XDTI2MDEwNzAxMDkxNFoXDTI3MDEwNzAxMDkxNFowRTETMBEGA1UE
16
15
  AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
17
16
  JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
18
17
  b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
@@ -22,14 +21,14 @@ cert_chain:
22
21
  qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
23
22
  gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
24
23
  HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
25
- AQCygvpmncmkiSs9r/Kceo4bBPDszhTv6iBi4LwMReqnFrpNLMOWJw7xi8x+3eL2
26
- XS09ZPNOt2zm70KmFouBMgOysnDY4k2dE8uF6B8JbZOO8QfalW+CoNBliefOTcn2
27
- bg5IOP7UoGM5lC174/cbDJrJnRG9bzig5FAP0mvsgA8zgTRXQzIUAZEo92D5K7p4
28
- B4/O998ho6BSOgYBI9Yk1ttdCtti6Y+8N9+fZESsjtWMykA+WXWeGUScHqiU+gH8
29
- S7043fq9EbQdBr2AXdj92+CDwuTfHI6/Hj5FVBDULufrJaan4xUgL70Hvc6pTTeW
30
- deKfBjgVAq7EYHu1AczzlUly
24
+ AQA/X8/PKTTc/IkYQEUL6XWtfK8fAfbuLJzmLcz6f2ZWrtBvPsYvqRuwI1bWUtil
25
+ 2ibJEfIuSIHX6BsUTX18+hlaIussf6EWq/YkE7e2BKmgQE42vSOZMce0kCEAPbx0
26
+ rQtqonfWTHQ8UbQ7GqCL3gDQ0QDD2B+HUlb4uaCZ2icxqa/eOtxMvHC2tj+h0xKY
27
+ xL84ipM5kr0bHGf9/MRZJWcw51urueNycBXu1Xh+pEN8qBmYsFRR4SIODLClybAO
28
+ 6cbm2PyPQgKNiqE4H+IQrDVHd9bJs1XgLElk3qoaJBWXc/5fy0J1imYb25UqmiHG
29
+ snGe1hrppvBRdcyEzvhfIPjI
31
30
  -----END CERTIFICATE-----
32
- date: 2024-06-23 00:00:00.000000000 Z
31
+ date: 1980-01-02 00:00:00.000000000 Z
33
32
  dependencies:
34
33
  - !ruby/object:Gem::Dependency
35
34
  name: ZenTest
@@ -51,34 +50,34 @@ dependencies:
51
50
  requirements:
52
51
  - - ">="
53
52
  - !ruby/object:Gem::Version
54
- version: '4.0'
53
+ version: '6.0'
55
54
  - - "<"
56
55
  - !ruby/object:Gem::Version
57
- version: '7'
56
+ version: '8'
58
57
  type: :development
59
58
  prerelease: false
60
59
  version_requirements: !ruby/object:Gem::Requirement
61
60
  requirements:
62
61
  - - ">="
63
62
  - !ruby/object:Gem::Version
64
- version: '4.0'
63
+ version: '6.0'
65
64
  - - "<"
66
65
  - !ruby/object:Gem::Version
67
- version: '7'
66
+ version: '8'
68
67
  - !ruby/object:Gem::Dependency
69
68
  name: hoe
70
69
  requirement: !ruby/object:Gem::Requirement
71
70
  requirements:
72
71
  - - "~>"
73
72
  - !ruby/object:Gem::Version
74
- version: '4.2'
73
+ version: '4.6'
75
74
  type: :development
76
75
  prerelease: false
77
76
  version_requirements: !ruby/object:Gem::Requirement
78
77
  requirements:
79
78
  - - "~>"
80
79
  - !ruby/object:Gem::Version
81
- version: '4.2'
80
+ version: '4.6'
82
81
  description: |-
83
82
  Inline allows you to write foreign code within your ruby code. It
84
83
  automatically determines if the code in question has changed and
@@ -88,6 +87,17 @@ description: |-
88
87
  You can even write extra builders that will allow you to write inlined
89
88
  code in any language. Use Inline::C as a template and look at
90
89
  Module#inline for the required API.
90
+
91
+ == Features/Problems:
92
+
93
+ * Quick and easy inlining of your C or C++ code embedded in your ruby script.
94
+ * Extendable to work with other languages.
95
+ * Automatic conversion between ruby and C basic types
96
+ * char, unsigned, unsigned int, char *, int, long, unsigned long
97
+ * inline_c_raw exists for when the automatic conversion isn't sufficient.
98
+ * Only recompiles if the inlined code has changed.
99
+ * Pretends to be secure.
100
+ * Only requires standard ruby libraries, nothing extra to download.
91
101
  email:
92
102
  - ryand-ruby@zenspider.com
93
103
  executables: []
@@ -113,9 +123,9 @@ homepage: http://www.zenspider.com/ZSS/Products/RubyInline/
113
123
  licenses:
114
124
  - MIT
115
125
  metadata:
126
+ documentation_uri: http://docs.seattlerb.org/RubyInline/
116
127
  homepage_uri: http://www.zenspider.com/ZSS/Products/RubyInline/
117
128
  source_code_uri: https://github.com/seattlerb/rubyinline
118
- post_install_message:
119
129
  rdoc_options:
120
130
  - "--main"
121
131
  - README.txt
@@ -133,8 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
143
  version: '0'
134
144
  requirements:
135
145
  - A POSIX environment and a compiler for your language.
136
- rubygems_version: 3.5.14
137
- signing_key:
146
+ rubygems_version: 3.7.2
138
147
  specification_version: 4
139
148
  summary: Inline allows you to write foreign code within your ruby code
140
149
  test_files: []
metadata.gz.sig CHANGED
Binary file