Class: FFI::Compiler::ExportTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- FFI::Compiler::ExportTask
- Defined in:
- lib/ffi-compiler/export_task.rb
Instance Method Summary collapse
- #export(rb_file) ⇒ Object
- #export_all ⇒ Object
-
#initialize(rb_dir, out_dir, options = {}) ⇒ ExportTask
constructor
A new instance of ExportTask.
Constructor Details
#initialize(rb_dir, out_dir, options = {}) ⇒ ExportTask
Returns a new instance of ExportTask.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ffi-compiler/export_task.rb', line 9 def initialize(rb_dir, out_dir, = {}) @rb_dir = rb_dir @out_dir = out_dir @gem_spec = [:gem_spec] @exports = [] if block_given? yield self define_tasks! end end |
Instance Method Details
#export(rb_file) ⇒ Object
21 22 23 |
# File 'lib/ffi-compiler/export_task.rb', line 21 def export(rb_file) @exports << { :rb_file => File.join(@rb_dir, rb_file), :header => File.join(@out_dir, File.basename(rb_file).sub(/\.rb$/, '.h')) } end |
#export_all ⇒ Object
25 26 27 28 29 |
# File 'lib/ffi-compiler/export_task.rb', line 25 def export_all Dir["#@rb_dir/**/*rb"].each do |rb_file| @exports << { :rb_file => rb_file, :header => File.join(@out_dir, File.basename(rb_file).sub(/\.rb$/, '.h')) } end end |