generators/handsoap/handsoap_generator.rb in troelskn-handsoap-0.2.4 vs generators/handsoap/handsoap_generator.rb in troelskn-handsoap-0.2.5
- old
+ new
@@ -51,10 +51,15 @@
module Commands #:nodoc:
module Create
def file_contents(relative_destination, &block)
destination = destination_path(relative_destination)
temp_file = Tempfile.new("handsoap_generator")
- temp_file_relative_path = relative_path(temp_file.path, File.expand_path(source_path("/.")))
+ if RUBY_PLATFORM =~ /win32/
+ canonical_path = File.expand_path(source_path("/."))
+ else
+ canonical_path = `readlink -fn '#{source_path("/.")}'`
+ end
+ temp_file_relative_path = relative_path(temp_file.path, canonical_path)
begin
yield temp_file
temp_file.close
return self.file(temp_file_relative_path, relative_destination)
ensure