Top Level Namespace

Defined Under Namespace

Modules: Hacks

Instance Method Summary collapse

Instance Method Details

#make_c(constants, structs) ⇒ Object



7
8
9
10
11
12
13
# File 'ext/hacks/extconf.rb', line 7

def make_c constants, structs
  erb_file = File.join File.dirname(__FILE__), "hacks.c.erb"
  erb = ERB.new(File.binread(erb_file), trim_mode: "-")
  c = erb.result(binding)
  c_file = File.join File.dirname(__FILE__), "hacks.c"
  File.binwrite c_file, c
end