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

activate_inline_deps() click to toggle source
    # File lib/hoe/inline.rb, line 25
25:   def activate_inline_deps
26:     dependency "RubyInline", "~> 3.9"
27:   end
define_inline_tasks() click to toggle source

Define tasks for plugin.

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

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.