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 ...@@ -12,6 +12,7 @@ XXXX-XX-XX, v1.0.0
12 - fixed [#236](https://github.com/n1k0/casperjs/issues/236) - Casper.exit return `this` after calling `phantom.exit()` that may caused PhantomJS to hang 12 - fixed [#236](https://github.com/n1k0/casperjs/issues/236) - Casper.exit return `this` after calling `phantom.exit()` that may caused PhantomJS to hang
13 - 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 13 - 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
14 - 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 14 - 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
15 - fixed [#232](https://github.com/n1k0/casperjs/issues/232) - symlink resolution in the ruby version of the `casperjs` executable
15 - added [`ClientUtils.getDocumentHeight()`](http://casperjs.org/api.html#clientutils.getDocumentHeight) 16 - added [`ClientUtils.getDocumentHeight()`](http://casperjs.org/api.html#clientutils.getDocumentHeight)
16 - added a `--no-colors` option to the `casper test` command to skip output coloration 17 - added a `--no-colors` option to the `casper test` command to skip output coloration
17 18
......
...@@ -2,8 +2,14 @@ ...@@ -2,8 +2,14 @@
2 # Ruby Wrapper for CasperJs 2 # Ruby Wrapper for CasperJs
3 # by hannyu 3 # by hannyu
4 4
5 def resolve(file_path)
6 while File.symlink?(file_path) do
7 file_path = File.dirname(file_path) + '/' + File.readlink(file_path)
8 end
9 file_path
10 end
5 11
6 CASPER_PATH = File.dirname(File.dirname(File.expand_path(__FILE__))) 12 CASPER_PATH = File.dirname(File.dirname(File.expand_path(resolve(__FILE__))))
7 13
8 PHANTOMJS_NATIVE_ARGS = [ 14 PHANTOMJS_NATIVE_ARGS = [
9 '--cookies-file', 15 '--cookies-file',
...@@ -54,4 +60,3 @@ if system(CASPER_COMMAND.join(" ")).nil? ...@@ -54,4 +60,3 @@ if system(CASPER_COMMAND.join(" ")).nil?
54 end 60 end
55 61
56 exit $?.exitstatus 62 exit $?.exitstatus
57
......