Sha256: e610ca2f1fc5286a9a1c3b704d58579ce313a9ef266eeb4401e0aad531e44f29

Contents?: true

Size: 719 Bytes

Versions: 169

Compression:

Stored size: 719 Bytes

Contents

begin
  require 'ffi/struct_generator'
  require 'ffi/const_generator'
  require 'ffi/generator'
rescue LoadError
  # from Rakefile
  require 'lib/ffi/struct_generator'
  require 'lib/ffi/const_generator'
  require 'lib/ffi/generator'
end

require 'rake'
require 'rake/tasklib'
require 'tempfile'

##
# Rake task that calculates C structs for FFI::Struct.

class FFI::Generator::Task < Rake::TaskLib

  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.options.trace

        FFI::Generator.new ffi_name, rb_name
      end
    end
  end

end

Version data entries

169 entries across 167 versions & 13 rubygems

Version Path
ffi-1.2.0.pre3-x86-mingw32 lib/ffi/tools/generator_task.rb
ffi-1.2.0.pre3 lib/ffi/tools/generator_task.rb
classiccms-0.6.7 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb
ffi-1.2.0.pre2-x86-mingw32 lib/ffi/tools/generator_task.rb
ffi-1.2.0.pre2 lib/ffi/tools/generator_task.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/ffi-1.1.5/lib/ffi/tools/generator_task.rb
classiccms-0.6.6 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb
classiccms-0.6.5 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb
classiccms-0.6.4 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb
classiccms-0.6.3 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb
classiccms-0.6.2 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb
classiccms-0.6.1 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb
classiccms-0.6.0 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb
classiccms-0.5.17 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb
classiccms-0.5.16 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb
ffi-1.1.5-x86-mingw32 lib/ffi/tools/generator_task.rb
ffi-1.1.6.pre2-x86-mingw32 lib/ffi/tools/generator_task.rb
ffi-1.1.6.pre2 lib/ffi/tools/generator_task.rb
ffi-1.2.0.pre1 lib/ffi/tools/generator_task.rb
classiccms-0.5.15 vendor/bundle/gems/ffi-1.0.11/lib/ffi/tools/generator_task.rb