rake_helper.rb in fjson-0.0.4 vs rake_helper.rb in fjson-0.0.5
- old
+ new
@@ -1,24 +1,27 @@
-def setup_extension(dir, extension=nil)
- ext_dir = "ext/#{dir}"
- extension = File.basename(dir) if extension.nil?
+def setup_extension(extension_path, extension=nil)
+ ext_dir = "ext/#{extension_path}"
+ extension = File.basename(extension_path) if extension.nil?
ext_so = "#{ext_dir}/#{extension}.#{Config::CONFIG['DLEXT']}"
desc "Builds the #{extension} extension"
task extension.to_sym => ["#{ext_dir}/Rakefile", ext_so ]
file "#{ext_dir}/Rakefile" => ["#{ext_dir}/extconf.rb"] do
extconf "#{ext_dir}"
end
+ create_so_file_tasks(ext_dir, ext_so)
+end
+
+def create_so_file_tasks(ext_dir, ext_so)
ext_files = FileList[
"#{ext_dir}/*.c",
"#{ext_dir}/*.h",
"#{ext_dir}/extconf.rb",
"#{ext_dir}/Rakefile",
"lib"
]
- ext_subdir = File.dirname(dir)
file ext_so => ext_files do
rake ext_dir
end
end