Skip to content

Instantly share code, notes, and snippets.

/.rb Secret

Created August 21, 2017 19:19
Show Gist options
  • Save anonymous/1ddf03ac969b7b070bfef20477ecbc43 to your computer and use it in GitHub Desktop.
Save anonymous/1ddf03ac969b7b070bfef20477ecbc43 to your computer and use it in GitHub Desktop.
module Foo
module Symbols__
module ExtLibC
extend Fiddle::Importer
dllload "cygwin1.dll"
extern "int puts(const char*);"
end
end
def self.method_missing(m, *a, &b)
if Symbols__::ExtLibC.respond_to?(m)
Symbols__::ExtLibC.public_send(m, *a, &b)
else
super
end
end
end
p Foo.puts("Hello")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment