File tree 1 file changed +31
-23
lines changed
src/qa/runner-assets/ruby
1 file changed +31
-23
lines changed Original file line number Diff line number Diff line change 3
3
module Qa ; end
4
4
5
5
module Qa ::Binding
6
- # From https://github.com/banister/binding_of_caller/issues/57
7
- # Thanks to Steve Shreeve <[email protected] >
8
-
9
- require 'fiddle/import'
10
-
11
- extend Fiddle ::Importer
6
+ begin
7
+ # From https://github.com/banister/binding_of_caller/issues/57
8
+ # Thanks to Steve Shreeve <[email protected] >
9
+
10
+ require 'fiddle/import'
11
+ rescue LoadError
12
+ class << self
13
+ def callers
14
+ [ ]
15
+ end
16
+ end
17
+ else
18
+ extend Fiddle ::Importer
12
19
13
- dlload Fiddle . dlopen ( nil )
20
+ dlload Fiddle . dlopen ( nil )
14
21
15
- DebugStruct = struct [
16
- "void* thread" ,
17
- "void* frame" ,
18
- "void* backtrace" ,
19
- "void* contexts" ,
20
- "long backtrace_size"
21
- ]
22
+ DebugStruct = struct [
23
+ "void* thread" ,
24
+ "void* frame" ,
25
+ "void* backtrace" ,
26
+ "void* contexts" ,
27
+ "long backtrace_size"
28
+ ]
22
29
23
- extern "void* rb_debug_inspector_open(void*, void*)"
24
- bind ( "void* callback(void*, void*)" ) do |ptr , _ |
25
- DebugStruct . new ( ptr ) . contexts
26
- end
30
+ extern "void* rb_debug_inspector_open(void*, void*)"
31
+ bind ( "void* callback(void*, void*)" ) do |ptr , _ |
32
+ DebugStruct . new ( ptr ) . contexts
33
+ end
27
34
28
- class << self
29
- def callers
30
- list_ptr = rb_debug_inspector_open ( self [ 'callback' ] , nil )
31
- list = list_ptr . to_value
32
- list . drop ( 4 ) . map { |ary | ary [ 2 ] } # grab proper bindings
35
+ class << self
36
+ def callers
37
+ list_ptr = rb_debug_inspector_open ( self [ 'callback' ] , nil )
38
+ list = list_ptr . to_value
39
+ list . drop ( 4 ) . map { |ary | ary [ 2 ] } # grab proper bindings
40
+ end
33
41
end
34
42
end
35
43
end
You can’t perform that action at this time.
0 commit comments