lib/sprinkle/verifiers/symlink.rb in lachlan-sprinkle-0.0.8 vs lib/sprinkle/verifiers/symlink.rb in lachlan-sprinkle-0.0.9
- old
+ new
@@ -17,13 +17,14 @@
Sprinkle::Verify.register(Sprinkle::Verifiers::Symlink)
# Checks that <tt>symlink</tt> is a symbolic link. If <tt>file</tt> is
# given, it checks that <tt>symlink</tt> points to <tt>file</tt>
def has_symlink(symlink, file = nil)
+ symlink, file = symlink.to_s, file.to_s
if RUBY_PLATFORM =~ /win32/
raise NotImplementedError, "Win32 platform does not support checking for symbolic links"
else
- if file.nil?
+ if file.empty?
@commands << "test -L #{symlink}"
else
@commands << "test '#{file}' = `readlink #{symlink}`"
end
end
\ No newline at end of file