Module: Inliner

Defined in:
lib/ffi-inliner/inliner.rb,
lib/ffi-inliner/version.rb

Defined Under Namespace

Modules: Compilers Classes: Builder, FilenameManager

Constant Summary collapse

DEV_NULL =
if Config::CONFIG['target_os'] =~ /mswin|mingw/
  'nul'
else
  '/dev/null'
end
LIB_EXT =
if Config::CONFIG['target_os'] =~ /darwin/
  '.dylib'
elsif Config::CONFIG['target_os'] =~ /mswin|mingw/
  '.dll'
else
  '.so'
end
C_TO_FFI =
{
  'void' => :void,
  'char' => :char,
  'unsigned char' => :uchar,
  'int' => :int,
  'unsigned int' => :uint,
  'long' => :long,
  'unsigned long' => :ulong,
  'float' => :float,
  'double' => :double,
}
VERSION =
'0.2.4'
@@__inliner_directory =
File.expand_path(File.join('~/', '.ffi-inliner'))

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.directoryObject



32
33
34
# File 'lib/ffi-inliner/inliner.rb', line 32

def directory
  @@__inliner_directory
end

Instance Method Details

#inline(code = "", options = {}) {|builder| ... } ⇒ Object

Yields:

  • (builder)


287
288
289
290
291
292
# File 'lib/ffi-inliner/inliner.rb', line 287

def inline(code = "", options = {})
  __inliner_make_directory
  builder = Builder.new(self, code, options)
  yield builder if block_given?
  builder.build
end