@@ -37,7 +37,7 @@ def self.type_to_nfi(type)
37
37
when Fiddle ::TYPE_DOUBLE
38
38
'DOUBLE'
39
39
else
40
- raise "#{ type } not implemented"
40
+ raise NotImplementedError , "#{ type } not implemented"
41
41
end
42
42
end
43
43
@@ -48,7 +48,7 @@ def self.int_type(size)
48
48
when SIZEOF_LONG
49
49
Fiddle ::TYPE_LONG
50
50
else
51
- raise
51
+ raise NotImplementedError
52
52
end
53
53
end
54
54
@@ -66,7 +66,7 @@ def self.convert_ruby_to_native(type, val)
66
66
elsif val . is_a? ( Integer )
67
67
val
68
68
else
69
- raise "#{ val . inspect } to pointer"
69
+ raise NotImplementedError , "#{ val . inspect } to pointer"
70
70
end
71
71
when Fiddle ::TYPE_INT
72
72
Integer ( val )
@@ -75,7 +75,7 @@ def self.convert_ruby_to_native(type, val)
75
75
when Fiddle ::TYPE_FLOAT , Fiddle ::TYPE_DOUBLE
76
76
Float ( val )
77
77
else
78
- raise "#{ val . inspect } to type #{ type } "
78
+ raise NotImplementedError , "#{ val . inspect } to type #{ type } "
79
79
end
80
80
end
81
81
@@ -88,7 +88,7 @@ def self.convert_native_to_ruby(type, val)
88
88
when Fiddle ::TYPE_INT , Fiddle ::TYPE_FLOAT , Fiddle ::TYPE_DOUBLE
89
89
val
90
90
else
91
- raise "#{ val . inspect } from type #{ type } "
91
+ raise NotImplementedError , "#{ val . inspect } from type #{ type } "
92
92
end
93
93
end
94
94
@@ -152,11 +152,11 @@ class DLError < StandardError
152
152
BUILD_RUBY_PLATFORM = RUBY_PLATFORM
153
153
154
154
def self . dlwrap ( *args )
155
- raise 'not implemented'
155
+ raise NotImplementedError
156
156
end
157
157
158
158
def self . dlunwrap ( *args )
159
- raise 'not implemented'
159
+ raise NotImplementedError
160
160
end
161
161
162
162
def self . malloc ( size )
@@ -205,19 +205,19 @@ def initialize(ret, args, abi = Function::DEFAULT)
205
205
end
206
206
207
207
def to_i ( *args )
208
- raise 'not implemented'
208
+ raise NotImplementedError
209
209
end
210
210
211
211
end
212
212
213
213
class Handle
214
214
215
215
def self . sym ( *args )
216
- raise 'not implemented'
216
+ raise NotImplementedError
217
217
end
218
218
219
219
def self . []( *args )
220
- raise 'not implemented'
220
+ raise NotImplementedError
221
221
end
222
222
223
223
RTLD_LAZY = Truffle ::Config [ 'platform.dlopen.RTLD_LAZY' ]
@@ -234,11 +234,11 @@ def initialize(library = nil, flags = RTLD_LAZY | RTLD_GLOBAL)
234
234
end
235
235
236
236
def to_i ( *args )
237
- raise 'not implemented'
237
+ raise NotImplementedError
238
238
end
239
239
240
240
def close ( *args )
241
- raise 'not implemented'
241
+ raise NotImplementedError
242
242
end
243
243
244
244
def sym ( name )
@@ -250,32 +250,32 @@ def sym(name)
250
250
alias_method :[] , :sym
251
251
252
252
def disable_close ( *args )
253
- raise 'not implemented'
253
+ raise NotImplementedError
254
254
end
255
255
256
256
def enable_close ( *args )
257
- raise 'not implemented'
257
+ raise NotImplementedError
258
258
end
259
259
260
260
def close_enabled? ( *args )
261
- raise 'not implemented'
261
+ raise NotImplementedError
262
262
end
263
263
264
264
end
265
265
266
266
class Pointer
267
267
268
268
def self . malloc ( *args )
269
- raise 'not implemented'
269
+ raise NotImplementedError
270
270
end
271
271
272
272
def self . to_ptr ( val )
273
273
if val . is_a? ( IO )
274
- raise 'not implemented'
274
+ raise NotImplementedError
275
275
elsif val . is_a? ( String )
276
276
ptr = Pointer . new ( Truffle ::CExt . string_pointer_to_native ( val ) , val . bytesize )
277
277
elsif val . respond_to? ( :to_ptr )
278
- raise 'not implemented'
278
+ raise NotImplementedError
279
279
else
280
280
ptr = Pointer . new ( Integer ( val ) )
281
281
end
@@ -294,75 +294,75 @@ def initialize(address, size = 0, freefunc = nil)
294
294
end
295
295
296
296
def free = ( *args )
297
- raise 'not implemented'
297
+ raise NotImplementedError
298
298
end
299
299
300
300
def free ( *args )
301
- raise 'not implemented'
301
+ raise NotImplementedError
302
302
end
303
303
304
304
def to_i ( *args )
305
305
@pointer . address
306
306
end
307
307
308
308
def to_int ( *args )
309
- raise 'not implemented'
309
+ raise NotImplementedError
310
310
end
311
311
312
312
def to_value ( *args )
313
- raise 'not implemented'
313
+ raise NotImplementedError
314
314
end
315
315
316
316
def ptr ( *args )
317
- raise 'not implemented'
317
+ raise NotImplementedError
318
318
end
319
319
320
320
def +@( *args )
321
- raise 'not implemented'
321
+ raise NotImplementedError
322
322
end
323
323
324
324
def ref ( *args )
325
- raise 'not implemented'
325
+ raise NotImplementedError
326
326
end
327
327
328
328
def -@( *args )
329
- raise 'not implemented'
329
+ raise NotImplementedError
330
330
end
331
331
332
332
def null? ( *args )
333
- raise 'not implemented'
333
+ raise NotImplementedError
334
334
end
335
335
336
336
def to_s ( *args )
337
- raise 'not implemented'
337
+ raise NotImplementedError
338
338
end
339
339
340
340
def to_str ( *args )
341
- raise 'not implemented'
341
+ raise NotImplementedError
342
342
end
343
343
344
344
def inspect ( *args )
345
- raise 'not implemented'
345
+ raise NotImplementedError
346
346
end
347
347
348
348
def <=>( *args )
349
- raise 'not implemented'
349
+ raise NotImplementedError
350
350
end
351
351
352
352
def ==( *args )
353
- raise 'not implemented'
353
+ raise NotImplementedError
354
354
end
355
355
356
356
def eql? ( *args )
357
- raise 'not implemented'
357
+ raise NotImplementedError
358
358
end
359
359
360
360
def +( *args )
361
- raise 'not implemented'
361
+ raise NotImplementedError
362
362
end
363
363
364
364
def -( *args )
365
- raise 'not implemented'
365
+ raise NotImplementedError
366
366
end
367
367
368
368
def []( start , length = nil )
@@ -374,15 +374,15 @@ def [](start, length = nil)
374
374
end
375
375
376
376
def []=( *args )
377
- raise 'not implemented'
377
+ raise NotImplementedError
378
378
end
379
379
380
380
def size ( *args )
381
- raise 'not implemented'
381
+ raise NotImplementedError
382
382
end
383
383
384
384
def size = ( *args )
385
- raise 'not implemented'
385
+ raise NotImplementedError
386
386
end
387
387
388
388
NULL = Pointer . new ( 0 )
0 commit comments