diff options
author | Ryan Davis <ryand@zenspider.com> | 2008-10-24 14:41:53 -0800 |
---|---|---|
committer | Ryan Davis <ryand@zenspider.com> | 2008-10-24 14:41:53 -0800 |
commit | 87a9f2e3646c1e594a2986e5ff8f8065dcc95ad2 (patch) | |
tree | 6649d7ea4f9ed6b2ad46b473a0fa155e66e07db9 | |
parent | 60b9180edc2b96e681e0d73ec936d8c18c78e7cb (diff) | |
download | hoe-87a9f2e3646c1e594a2986e5ff8f8065dcc95ad2.tar.gz |
Trying to get suitable replacement of inline packaging for Luis
[git-p4: depot-paths = "//src/hoe/dev/": change = 4422]
-rw-r--r-- | lib/hoe.rb | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -534,27 +534,32 @@ class Hoe # Allow automatic inclusion of compiled extensions if ENV['INLINE'] then s.platform = ENV['FORCE_PLATFORM'] || Gem::Platform::CURRENT - # name of the extension is CamelCase - alternate_name = if name =~ /[A-Z]/ then - name.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '') - elsif name =~ /_/ then - name.capitalize.gsub(/_([a-z])/) { $1.upcase } - end # Try collecting Inline extensions for +name+ if defined?(Inline) then directory 'lib/inline' - extensions = Dir.chdir(Inline::directory) { - Dir["Inline_{#{name},#{alternate_name}}_*.#{DLEXT}"] - } - extensions.each do |ext| - # add the inlined extension to the spec files - s.files += ["lib/inline/#{ext}"] - - # include the file in the tasks - file "lib/inline/#{ext}" => ["lib/inline"] do - cp File.join(Inline::directory, ext), "lib/inline" + Inline.registered_inline_classes.each do |cls| + name = cls.name # TODO: what about X::Y::Z? + # name of the extension is CamelCase + alternate_name = if name =~ /[A-Z]/ then + name.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '') + elsif name =~ /_/ then + name.capitalize.gsub(/_([a-z])/) { $1.upcase } + end + + extensions = Dir.chdir(Inline::directory) { + Dir["Inline_{#{name},#{alternate_name}}_*.#{DLEXT}"] + } + + extensions.each do |ext| + # add the inlined extension to the spec files + s.files += ["lib/inline/#{ext}"] + + # include the file in the tasks + file "lib/inline/#{ext}" => ["lib/inline"] do + cp File.join(Inline::directory, ext), "lib/inline" + end end end end |