Class: FFI::Generator::Task
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- FFI::Generator::Task
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/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.
Constant Summary
Constants included from Rake::FileUtilsExt
Constants included from FileUtils
FileUtils::LN_SUPPORTED, FileUtils::RUBY
Instance Method Summary collapse
-
#initialize(rb_names, options = {}) ⇒ Task
constructor
A new instance of Task.
Methods included from Rake::FileUtilsExt
#nowrite, #rake_check_options, #rake_output_message, #verbose, #when_writing
Methods included from FileUtils
#ruby, #safe_ln, #sh, #split_all
Methods included from Rake::Cloneable
Constructor Details
#initialize(rb_names, options = {}) ⇒ Task
Returns a new instance of Task.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/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 |