Class: FFI::Generator::Task
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Rake::TaskLib
|
|
Instance Chain:
self,
Rake::TaskLib
|
|
Inherits: |
Rake::TaskLib
|
Defined in: | lib/ffi/tools/generator_task.rb |
Overview
Add Rake tasks that generate files with C structs for ::FFI::Struct
and C constants.
The generated files are also added to the ‘clear’ task.
Class Method Summary
- .new(rb_names, options = {}) ⇒ Task constructor
Constructor Details
.new(rb_names, options = {}) ⇒ Task
# File 'lib/ffi/tools/generator_task.rb', line 18
def initialize(rb_names, ={}) task :clean do rm_f rb_names end rb_names.each do |rb_name| ffi_name = "#{rb_name}.ffi" file rb_name => ffi_name do |t| puts "Generating #{rb_name}..." if Rake.application. .trace FFI::Generator.new ffi_name, rb_name, end end end