Permalink
Browse files

Replaced shell call to readlink with library pathname.realpath

  • Loading branch information...
1 parent e406c4a commit 202ea55d4de7ec837b15c62a2be26ada1737a95e Troels committed Jul 12, 2009
Showing with 2 additions and 5 deletions.
  1. +2 −5 generators/handsoap/handsoap_generator.rb
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
require "#{File.dirname(__FILE__)}/../../lib/handsoap/parser.rb"
require "#{File.dirname(__FILE__)}/../../lib/handsoap/compiler.rb"
+require 'pathname'
# TODO
# options:
@@ -75,11 +76,7 @@ module Create
def file_contents(relative_destination, &block)
destination = destination_path(relative_destination)
temp_file = Tempfile.new("handsoap_generator")
- if RUBY_PLATFORM =~ /linux/
- canonical_path = `readlink -fn '#{source_path("/.")}'`
- else
- canonical_path = File.expand_path(source_path("/."))
- end
+ canonical_path = Pathname.new(source_path("/.")).realpath.to_s
temp_file_relative_path = relative_path(temp_file.path, canonical_path)
begin
yield temp_file

0 comments on commit 202ea55

Please sign in to comment.