summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Davis <ryand@zenspider.com>2008-10-24 14:41:53 -0800
committerRyan Davis <ryand@zenspider.com>2008-10-24 14:41:53 -0800
commit87a9f2e3646c1e594a2986e5ff8f8065dcc95ad2 (patch)
tree6649d7ea4f9ed6b2ad46b473a0fa155e66e07db9
parent60b9180edc2b96e681e0d73ec936d8c18c78e7cb (diff)
downloadhoe-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.rb37
1 files changed, 21 insertions, 16 deletions
diff --git a/lib/hoe.rb b/lib/hoe.rb
index e5e0421..1cd5fab 100644
--- a/lib/hoe.rb
+++ b/lib/hoe.rb
@@ -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