RubyInline 3.14.0 → 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: 14e2dd1d335589d1f389ba716c031d8778d02d0b2c74e35ad981168dd7d0999d
4
- data.tar.gz: 5b39db47e57df1e9494db491e778e121f0556b8827270ea6cbd63899c03f8f52
3
+ metadata.gz: b0ed379c058318747902fe1ad1e7e8cccc2a938b342d785e216da8c407d87bff
4
+ data.tar.gz: 93e2afc3ce27acf75bc98e99c9f05eb1d2cae5d5c962de214b5d87c8f1d8de5d
5
5
  SHA512:
6
- metadata.gz: 9cce3379d5f7876f9ed3f8736eb3ef90beeea58730fc9303c532efebaf629ea097481e06084a61ddb379319e599ca002385c458a8a183464a1f6199014f8c6b6
7
- data.tar.gz: 1650103a7b18af47316fd0983baa3877a36776e71732ac1ffa71cf715fa86415a9bd1ad7584efc74378a2db52c287e6243cedae4cbf025224aaf09136381f67c
6
+ metadata.gz: b79b5bbf630f512d6ca8ee5f11e8454a48f95877df9c5d25f8b57360e1ff4f203f02e88f1eacf414f91cef89feab6a75177c5054e609205563d5b05b02eb00a1
7
+ data.tar.gz: db1dde8fc202d927ddca763fc518e4c4b8516b9b96f99660247ac933b9880ecfa3d6cd4e7c2a5b742432618d9eccb97b61752ff5464ec5ab64d97a78dd409337
checksums.yaml.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,16 @@
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
+
8
+ === 3.14.1 / 2024-06-23
9
+
10
+ * 1 bug fix:
11
+
12
+ * Fix errors created when string literals are frozen.
13
+
1
14
  === 3.14.0 / 2023-06-28
2
15
 
3
16
  * 3 minor enhancements:
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
@@ -1,4 +1,4 @@
1
- #!/usr/local/bin/ruby -w
1
+ # frozen_string_literal: true
2
2
 
3
3
  ##
4
4
  # Ruby Inline is a framework for writing ruby extensions in foreign
@@ -65,7 +65,7 @@ class CompilationError < RuntimeError; end
65
65
  # the current namespace.
66
66
 
67
67
  module Inline
68
- VERSION = "3.14.0"
68
+ VERSION = "3.14.2"
69
69
 
70
70
  WINDOZE = /mswin|mingw/ =~ RUBY_PLATFORM
71
71
  DEV_NULL = (WINDOZE ? 'nul' : '/dev/null')
@@ -338,7 +338,7 @@ module Inline
338
338
  ext << nil
339
339
 
340
340
  @sig.keys.sort.each do |name|
341
- method = ''
341
+ method = []
342
342
  arity, singleton, method_name = @sig[name]
343
343
  if singleton then
344
344
  if method_name == 'allocate' then
@@ -351,7 +351,7 @@ module Inline
351
351
  method << " rb_define_method(c, \"#{method_name}\", "
352
352
  end
353
353
  method << "(VALUE(*)(ANYARGS))#{name}, #{arity});"
354
- ext << method
354
+ ext << method.join
355
355
  end
356
356
 
357
357
  ext << @init_extra.join("\n") unless @init_extra.empty?
@@ -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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  $TESTING = true
2
4
 
3
5
  $0 = __FILE__ if $0 =~ /-e|\(eval\)|^$/
@@ -81,9 +83,11 @@ end
81
83
  class TestInline
82
84
  class TestC < InlineTestCase
83
85
 
86
+ attr_accessor :builder
87
+
84
88
  def setup
85
89
  super
86
- @builder = Inline::C.new(self.class)
90
+ self.builder = Inline::C.new self.class
87
91
  end
88
92
 
89
93
 
@@ -96,17 +100,14 @@ class TestC < InlineTestCase
96
100
  end
97
101
 
98
102
  def test_initialize
99
- x = Inline::C.new(self.class)
100
- assert_equal TestInline::TestC, x.mod
101
- assert_equal [], x.src
102
- assert_equal({}, x.sig)
103
- assert_equal [], x.flags
104
- 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
105
108
  end
106
109
 
107
110
  def test_accessor
108
- builder = Inline::C.new self.class
109
-
110
111
  builder.struct_name = 'MyStruct'
111
112
  builder.accessor 'method_name', 'int'
112
113
 
@@ -144,8 +145,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
144
145
  end
145
146
 
146
147
  def test_accessor_member_name
147
- builder = Inline::C.new self.class
148
-
149
148
  builder.struct_name = 'MyStruct'
150
149
  builder.accessor 'method_name', 'int', 'member_name'
151
150
 
@@ -183,8 +182,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
183
182
  end
184
183
 
185
184
  def test_accessor_no_struct_name
186
- builder = Inline::C.new self.class
187
-
188
185
  e = assert_raises RuntimeError do
189
186
  builder.accessor 'method_name', 'int'
190
187
  end
@@ -193,8 +190,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
193
190
  end
194
191
 
195
192
  def test_add_type_converter
196
- builder = Inline::C.new self.class
197
-
198
193
  builder.add_type_converter 'my_type', 'ruby_type2my_type',
199
194
  'my_type2ruby_type'
200
195
 
@@ -203,8 +198,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
203
198
  end
204
199
 
205
200
  def test_alias_type_converter
206
- builder = Inline::C.new self.class
207
-
208
201
  builder.alias_type_converter 'long long', 'int64_t'
209
202
 
210
203
  assert_equal 'LL2NUM', builder.c2ruby('int64_t')
@@ -212,8 +205,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
212
205
  end
213
206
 
214
207
  def test_reader
215
- builder = Inline::C.new self.class
216
-
217
208
  builder.struct_name = 'MyStruct'
218
209
  builder.reader 'method_name', 'int'
219
210
 
@@ -236,8 +227,6 @@ static VALUE method_name(VALUE self) {
236
227
  end
237
228
 
238
229
  def test_reader_member_name
239
- builder = Inline::C.new self.class
240
-
241
230
  builder.struct_name = 'MyStruct'
242
231
  builder.reader 'method_name', 'int', 'member_name'
243
232
 
@@ -260,8 +249,6 @@ static VALUE method_name(VALUE self) {
260
249
  end
261
250
 
262
251
  def test_reader_no_struct_name
263
- builder = Inline::C.new self.class
264
-
265
252
  e = assert_raises RuntimeError do
266
253
  builder.reader 'method_name', 'int'
267
254
  end
@@ -270,8 +257,6 @@ static VALUE method_name(VALUE self) {
270
257
  end
271
258
 
272
259
  def test_remove_type_converter
273
- builder = Inline::C.new self.class
274
-
275
260
  builder.remove_type_converter 'long'
276
261
 
277
262
  assert_raises ArgumentError do
@@ -280,8 +265,6 @@ static VALUE method_name(VALUE self) {
280
265
  end
281
266
 
282
267
  def test_writer
283
- builder = Inline::C.new self.class
284
-
285
268
  builder.struct_name = 'MyStruct'
286
269
  builder.writer 'method_name', 'int'
287
270
 
@@ -307,8 +290,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
307
290
  end
308
291
 
309
292
  def test_writer_member_name
310
- builder = Inline::C.new self.class
311
-
312
293
  builder.struct_name = 'MyStruct'
313
294
  builder.writer 'method_name', 'int', 'member_name'
314
295
 
@@ -334,8 +315,6 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
334
315
  end
335
316
 
336
317
  def test_writer_no_struct_name
337
- builder = Inline::C.new self.class
338
-
339
318
  e = assert_raises RuntimeError do
340
319
  builder.writer 'method_name', 'int'
341
320
  end
@@ -344,55 +323,53 @@ static VALUE method_name_equals(VALUE self, VALUE _value) {
344
323
  end
345
324
 
346
325
  def test_ruby2c
347
- x = Inline::C.new(self.class)
348
- assert_equal 'NUM2CHR', x.ruby2c("char")
349
- assert_equal 'StringValuePtr', x.ruby2c("char *")
326
+ assert_equal 'NUM2CHR', builder.ruby2c("char")
327
+ assert_equal 'StringValuePtr', builder.ruby2c("char *")
350
328
 
351
- assert_equal "FI\X2INT", x.ruby2c("int")
352
- assert_equal 'NUM2UINT', x.ruby2c("unsigned")
353
- 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")
354
332
 
355
- assert_equal 'NUM2LONG', x.ruby2c("long")
356
- assert_equal 'NUM2ULONG', x.ruby2c("unsigned long")
333
+ assert_equal 'NUM2LONG', builder.ruby2c("long")
334
+ assert_equal 'NUM2ULONG', builder.ruby2c("unsigned long")
357
335
 
358
- assert_equal 'NUM2LL', x.ruby2c("long long")
359
- 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")
360
338
 
361
- assert_equal 'NUM2DBL', x.ruby2c("double")
339
+ assert_equal 'NUM2DBL', builder.ruby2c("double")
362
340
 
363
- assert_equal 'NUM2OFFT', x.ruby2c("off_t")
341
+ assert_equal 'NUM2OFFT', builder.ruby2c("off_t")
364
342
 
365
- assert_equal '', x.ruby2c("VALUE")
343
+ assert_equal '', builder.ruby2c("VALUE")
366
344
 
367
345
  assert_raises ArgumentError do
368
- x.ruby2c('blah')
346
+ builder.ruby2c('blah')
369
347
  end
370
348
  end
371
349
 
372
350
  def test_c2ruby
373
- x = Inline::C.new(self.class)
374
- assert_equal 'CHR2FIX', x.c2ruby("char")
351
+ assert_equal 'CHR2FIX', builder.c2ruby("char")
375
352
 
376
- assert_equal 'rb_str_new2', x.c2ruby("char *")
353
+ assert_equal 'rb_str_new2', builder.c2ruby("char *")
377
354
 
378
- assert_equal 'INT2FIX', x.c2ruby("int")
379
- assert_equal 'UINT2NUM', x.c2ruby("unsigned int")
380
- 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")
381
358
 
382
- assert_equal 'LONG2NUM', x.c2ruby("long")
383
- assert_equal 'ULONG2NUM', x.c2ruby("unsigned long")
359
+ assert_equal 'LONG2NUM', builder.c2ruby("long")
360
+ assert_equal 'ULONG2NUM', builder.c2ruby("unsigned long")
384
361
 
385
- assert_equal 'LL2NUM', x.c2ruby("long long")
386
- 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")
387
364
 
388
- assert_equal 'rb_float_new', x.c2ruby("double")
365
+ assert_equal 'rb_float_new', builder.c2ruby("double")
389
366
 
390
- assert_equal 'OFFT2NUM', x.c2ruby("off_t")
367
+ assert_equal 'OFFT2NUM', builder.c2ruby("off_t")
391
368
 
392
- assert_equal '', x.c2ruby("VALUE")
369
+ assert_equal '', builder.c2ruby("VALUE")
393
370
 
394
371
  assert_raises ArgumentError do
395
- x.c2ruby('blah')
372
+ builder.c2ruby('blah')
396
373
  end
397
374
  end
398
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.0
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
- MIIDPjCCAiagAwIBAgIBBzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
12
+ MIIDPjCCAiagAwIBAgIBCTANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
13
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTIzMDEwMTA3NTExN1oXDTI0MDEwMTA3NTExN1owRTETMBEGA1UE
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
- AQAkg3y+PBnBAPWdxxITm5sPHqdWQgSyCpRA20o4LTuWr8BWhSXBkfQNa7cY6fOn
26
- xyM34VPzBFbExv6XOGDfOMFBVaYTHuN9peC/5/umL7kLl+nflXzL2QA7K6LYj5Bg
27
- sM574Onr0dZDM6Vn69bzQ7rBIFDfK/OhlPzqKZad4nsdcsVH8ODCiT+ATMIZyz5K
28
- WCnNtqlyiWXI8tdTpahDgcUwfcN/oN7v4K8iU5IbLJX6HQ5DKgmKjfb6XyMth16k
29
- ROfWo9Uyp8ba/j9eVG14KkYRaLydAY1MNQk2yd3R5CGfeOpD1kttxjoypoUJ2dOG
30
- nsNBRuQJ1UfiCG97a6DNm+Fr
24
+ AQAC0WQJcPOWPFwkojhzweilRVjTJ19UiLhiBTw3C1wJO3LVdBkWDmnnhAmKuX4D
25
+ r7vjQvESlABGIPdutI1Yl7mrHQzTkfLfXvNN6MT0nLChPyIYauT6SZZxubwJrUfA
26
+ 7R0c2CJTIboZ0XaGpLsXqHEF1c29H7TV1QvVuqKAN2mCjh4N82QVn+ZKtys28AwT
27
+ 6GfQX2fqLoi4KSc7xIzHKaNzqxeOICmJofk9w5VZ2rRN6yes8jvFYwz9HR41wdj8
28
+ bwfinv7Yp5fA6AysuZLhCykyfDuZVRrUp0Vb68YCKsLjJly/Theak+euNTxvHsB+
29
+ al9oSgPPHICMEX65qvLywitx
31
30
  -----END CERTIFICATE-----
32
- date: 2023-06-28 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
@@ -71,14 +70,14 @@ dependencies:
71
70
  requirements:
72
71
  - - "~>"
73
72
  - !ruby/object:Gem::Version
74
- version: '4.0'
73
+ version: '4.2'
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.0'
80
+ version: '4.2'
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
@@ -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.4.10
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