RubyInline 3.14.1 → 3.14.2

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: b0ed379c058318747902fe1ad1e7e8cccc2a938b342d785e216da8c407d87bff
4
+ data.tar.gz: 93e2afc3ce27acf75bc98e99c9f05eb1d2cae5d5c962de214b5d87c8f1d8de5d
5
5
  SHA512:
6
- metadata.gz: d377fec0166d04b22bd4ba0c283f0cb9c72d1f998d6651030dc7a897dc40a0bcab17497defc4d5fd0f87af6eb5e170bd5c34b8950780a4f32c4137c3d58fe6af
7
- data.tar.gz: c59d0575650d5a607795a97f449679e7a7614fe0d827662603ea3d226912eebc81db35cdcf743c96f7e579086fd37472a33943f1caaba32116ffc8962deac2fc
6
+ metadata.gz: b79b5bbf630f512d6ca8ee5f11e8454a48f95877df9c5d25f8b57360e1ff4f203f02e88f1eacf414f91cef89feab6a75177c5054e609205563d5b05b02eb00a1
7
+ data.tar.gz: db1dde8fc202d927ddca763fc518e4c4b8516b9b96f99660247ac933b9880ecfa3d6cd4e7c2a5b742432618d9eccb97b61752ff5464ec5ab64d97a78dd409337
checksums.yaml.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ === 3.14.2 / 2025-03-11
2
+
3
+ * 2 bug fixes:
4
+
5
+ * Fix for windows builds. (fenrir-naru)
6
+ * Ruby 3.4: Fixed breakage from ruby 3.4 call stack changes.
7
+
1
8
  === 3.14.1 / 2024-06-23
2
9
 
3
10
  * 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.2"
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,
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.2
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
+ MIIDPjCCAiagAwIBAgIBCTANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
13
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTI0MDEwMjIxMjEyM1oXDTI1MDEwMTIxMjEyM1owRTETMBEGA1UE
14
+ GRYDY29tMB4XDTI1MDEwNjIzMjcwMVoXDTI2MDEwNjIzMjcwMVowRTETMBEGA1UE
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
+ AQAC0WQJcPOWPFwkojhzweilRVjTJ19UiLhiBTw3C1wJO3LVdBkWDmnnhAmKuX4D
25
+ r7vjQvESlABGIPdutI1Yl7mrHQzTkfLfXvNN6MT0nLChPyIYauT6SZZxubwJrUfA
26
+ 7R0c2CJTIboZ0XaGpLsXqHEF1c29H7TV1QvVuqKAN2mCjh4N82QVn+ZKtys28AwT
27
+ 6GfQX2fqLoi4KSc7xIzHKaNzqxeOICmJofk9w5VZ2rRN6yes8jvFYwz9HR41wdj8
28
+ bwfinv7Yp5fA6AysuZLhCykyfDuZVRrUp0Vb68YCKsLjJly/Theak+euNTxvHsB+
29
+ al9oSgPPHICMEX65qvLywitx
31
30
  -----END CERTIFICATE-----
32
- date: 2024-06-23 00:00:00.000000000 Z
31
+ date: 2025-03-12 00:00:00.000000000 Z
33
32
  dependencies:
34
33
  - !ruby/object:Gem::Dependency
35
34
  name: ZenTest
@@ -115,7 +114,6 @@ licenses:
115
114
  metadata:
116
115
  homepage_uri: http://www.zenspider.com/ZSS/Products/RubyInline/
117
116
  source_code_uri: https://github.com/seattlerb/rubyinline
118
- post_install_message:
119
117
  rdoc_options:
120
118
  - "--main"
121
119
  - README.txt
@@ -133,8 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
131
  version: '0'
134
132
  requirements:
135
133
  - A POSIX environment and a compiler for your language.
136
- rubygems_version: 3.5.14
137
- signing_key:
134
+ rubygems_version: 3.6.3
138
135
  specification_version: 4
139
136
  summary: Inline allows you to write foreign code within your ruby code
140
137
  test_files: []
metadata.gz.sig CHANGED
Binary file