Commit 99a4f6bf 99a4f6bf4d8dd21650d0a255d7922830281626c4 by Nicolas Perriault

fixes #232 - symlink resolution in ruby version

1 parent 95a3bcac
......@@ -12,6 +12,7 @@ XXXX-XX-XX, v1.0.0
- fixed [#236](https://github.com/n1k0/casperjs/issues/236) - Casper.exit return `this` after calling `phantom.exit()` that may caused PhantomJS to hang
- fixed [#231](https://github.com/n1k0/casperjs/pull/231) - added `--pre` and `--post` options to the `casperjs test` command to load test files before and after the execution of testsuite
- fixed [#222](https://github.com/n1k0/casperjs/pull/222) & [#211](https://github.com/n1k0/casperjs/issues/211) - Change mouse event to include an X + Y value for click position
- fixed [#232](https://github.com/n1k0/casperjs/issues/232) - symlink resolution in the ruby version of the `casperjs` executable
- added [`ClientUtils.getDocumentHeight()`](http://casperjs.org/api.html#clientutils.getDocumentHeight)
- added a `--no-colors` option to the `casper test` command to skip output coloration
......
......@@ -2,8 +2,14 @@
# Ruby Wrapper for CasperJs
# by hannyu
def resolve(file_path)
while File.symlink?(file_path) do
file_path = File.dirname(file_path) + '/' + File.readlink(file_path)
end
file_path
end
CASPER_PATH = File.dirname(File.dirname(File.expand_path(__FILE__)))
CASPER_PATH = File.dirname(File.dirname(File.expand_path(resolve(__FILE__))))
PHANTOMJS_NATIVE_ARGS = [
'--cookies-file',
......@@ -33,7 +39,7 @@ ARGV.each do |arg|
is_found = false
PHANTOMJS_NATIVE_ARGS.each do |pna|
if arg.start_with? pna
PHANTOMJS_ARGS << arg
PHANTOMJS_ARGS << arg
is_found = true
break
end
......@@ -54,4 +60,3 @@ if system(CASPER_COMMAND.join(" ")).nil?
end
exit $?.exitstatus
......