Hoe::Inline

Hoe allows bundling of pre-compiled extensions in the package task.

To create a package for your current platform:

  rake package INLINE=1

This will force Hoe analize your Inline already compiled extensions and include them in your gem.

If somehow you need to force a specific platform:

  rake package INLINE=1 FORCE_PLATFORM=mswin32

This will set the +Gem::Specification+ platform to the one indicated in FORCE_PLATFORM (instead of default Gem::Platform::CURRENT)

Public Instance Methods

define_inline_tasks() click to toggle source

Define tasks for plugin.

    # File lib/hoe/inline.rb, line 24
24:   def define_inline_tasks
25:     extra_deps  << 'RubyInline'
26:     clean_globs << File.expand_path("~/.ruby_inline")
27:     task :test => :clean
28: 
29:     if ENV['INLINE'] then
30:       s.platform = ENV['FORCE_PLATFORM'] || Gem::Platform::CURRENT
31: 
32:       # Try collecting Inline extensions for +name+
33:       if defined?(Inline) then
34:         directory 'lib/inline'
35: 
36:         dlext = Config::CONFIG['DLEXT']
37: 
38:         Inline.registered_inline_classes.each do |cls|
39:           name = cls.name.gsub(/::/, '')
40:           # name of the extension is CamelCase
41:           alternate_name = if name =~ /[A-Z]/ then
42:                              name.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
43:                            elsif name =~ /_/ then
44:                              name.capitalize.gsub(/_([a-z])/) { $1.upcase }
45:                            end
46:           extensions = Dir.chdir(Inline::directory) {
47:             Dir["Inline_{#{name},#{alternate_name}}_*.#{dlext}"]
48:           }
49: 
50:           extensions.each do |ext|
51:             # add the inlined extension to the spec files
52:             s.files += ["lib/inline/#{ext}"]
53: 
54:             # include the file in the tasks
55:             file "lib/inline/#{ext}" => ["lib/inline"] do
56:               cp File.join(Inline::directory, ext), "lib/inline"
57:             end
58:           end
59:         end
60:       end
61:     end
62:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.