summaryrefslogtreecommitdiffhomepage
path: root/mrb_gems/basic_example/autogen.rb
blob: 0640254e0daa65077d8c4021f9d3d45c2aa81cb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require "FelBind"

mgem = FelBind::BindGem.new(gem_name: "basic_example")

mgem.add_class("BasicExample")

mgem.add_function(class_name: "BasicExample", function_name: "say_hello") do |func|
  func.content = "printf(\"Hello World\\n\");"
  func.return_call do |rc|
    rc.type = "nil"
  end
end

File.write("src/basic_example.c", mgem.build)