Sha256: 51c8c8ec4615b367a7cc1251f35805718bfdeea3ccd41e408f7e0c99abba6b73

Contents?: true

Size: 482 Bytes

Versions: 3

Compression:

Stored size: 482 Bytes

Contents

#!/usr/local/bin/ruby17 -w

begin
  require 'rubygems'
rescue LoadError
  $: << 'lib'
end
require 'inline'

class MyTest

  inline do |builder|
    builder.include_ruby_last

    builder.add_compile_flags %q(-x c++)
    builder.add_link_flags %q(-lstdc++)

    builder.include "<iostream>"
    builder.include '"ruby/version.h"'

    builder.c "
static
void
hello(int i) {
  while (i-- > 0) {
    std::cout << \"hello\" << std::endl;
  }
}
"
  end
end

t = MyTest.new()

t.hello(3)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
RubyInline-3.14.1 example2.rb
RubyInline-3.14.0 example2.rb
RubyInline-3.13.0 example2.rb