lib/ffi/libfuse/callbacks.rb in ffi-libfuse-0.3.4 vs lib/ffi/libfuse/callbacks.rb in ffi-libfuse-0.4.0

- old
+ new

@@ -43,11 +43,12 @@ def respond_to_callback?(method, delegate) delegate.respond_to?(method) end - def wrap_callback(method, proc_wrapper = nil, wrapper: proc_wrapper, excludes: [], &block) + def wrap_callback(method, proc_wrapper = nil, wrapper: proc_wrapper, excludes: [], includes: nil, &block) return block if excludes.include?(method) + return block unless includes.nil? || includes.include?(method) # Wrapper proc takes fuse_method as first arg, but the resulting proc only takes the callback args # ie so wrappers should not yield the fuse_method onwards!! return proc { |*args| wrapper.call(method, *args, &block) } if wrapper.is_a?(Proc)