Commit a5a2cd52 a5a2cd52107bafb4de6106384747e0ed0c1aa34e by Nicolas Perriault

removed deprecated batchbin & rubybin directories

1 parent a6f082c0
@ECHO OFF
set CASPER_PATH=%~dp0..
set CASPER_BIN=%CASPER_PATH%\bin\
set ARGV=%*
call phantomjs "%CASPER_BIN%bootstrap.js" --casper-path="%CASPER_PATH%" --cli %ARGV%
\ No newline at end of file
......@@ -12,7 +12,7 @@ Prerequisites
.. index:: PhantomJS, Python, SlimerJS
- PhantomJS_ 1.8.1 or greater. Installation instructions can be found `here <http://phantomjs.org/download.html>`_
- PhantomJS_ 1.8.2 or greater. Installation instructions can be found `here <http://phantomjs.org/download.html>`_
- Python_ 2.6 or greater for ``casperjs`` in the ``bin/`` directory
- .NET Framework 3.5 or greater (or Mono_ 2.10.8 or greater) for ``casperjs.exe`` in the ``bin/`` directory
......@@ -20,14 +20,6 @@ Prerequisites
- **Experimental:** as of 1.1-beta1, SlimerJS_ 0.8 or greater to run your tests against Gecko (Firefox) instead of Webkit. To see PhantomJS API compatibility of SlimerJS, please `refer to this page <https://github.com/laurentj/slimerjs/blob/master/API_COMPAT.md>`_.
.. warning::
.. deprecated:: 1.1
The `Ruby <http://ruby-lang.org/>`_ version of the ``casperjs`` executable also available in the ``rubybin/`` directory has been deprecated as of 1.1-beta, and is not compatible with SlimerJS_.
The batch version of the ``casperjs`` executable also available in the ``batchbin/`` directory has been deprecated as of 1.1-beta, and is not compatible with SlimerJS_.
.. index:: Homebrew
Installing from Homebrew (OSX)
......@@ -64,7 +56,7 @@ You can install CasperJS using `npm <http://npmjs.org/>`_::
.. note::
The `-g` flag makes the `casperjs` executable available system-wide.
The ``-g`` flag makes the ``casperjs`` executable available system-wide.
.. warning::
......@@ -91,9 +83,9 @@ Once PhantomJS and CasperJS installed on your machine, you should obtain somethi
.. code-block:: text
$ phantomjs --version
1.8.1
1.9.2
$ casperjs
CasperJS version 1.1.0-DEV at /Users/niko/Sites/casperjs, using phantomjs version 1.8.1
CasperJS version 1.1.0-DEV at /Users/niko/Sites/casperjs, using phantomjs version 1.9.2
# ...
Or if SlimerJS is your thing:
......@@ -113,16 +105,16 @@ Installing from an archive
You can download tagged archives of CasperJS code:
**Latest stable version:**
- https://github.com/n1k0/casperjs/zipball/1.0.3 (zip)
- https://github.com/n1k0/casperjs/tarball/1.0.3 (tar.gz)
**Latest development version (master branch):**
- https://github.com/n1k0/casperjs/zipball/master (zip)
- https://github.com/n1k0/casperjs/tarball/master (tar.gz)
**Latest stable version:**
- https://github.com/n1k0/casperjs/zipball/1.0.3 (zip)
- https://github.com/n1k0/casperjs/tarball/1.0.3 (tar.gz)
Operations are then the same as with a git checkout.
......@@ -140,8 +132,6 @@ Phantomjs installation additions
Casperjs installation additions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**CasperJS, as of 1.1-beta3, ships with a .NET application so you don't need Python nor Ruby to use it.**
.. versionadded:: 1.1-beta3
- Append ``";C:\casperjs\bin"`` to your ``PATH`` environment variable.
......@@ -153,34 +143,8 @@ You can now run any regular casper scripts that way:
C:> casperjs myscript.js
Earlier versions of CasperJS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**CasperJS, as of 1.0.0-RC3, ships with a Batch script so you don't need Python nor Ruby to use it.**
- Append ``";C:\casperjs\batchbin"`` to your ``PATH`` environment variable.
- Modify this path appropriately if you installed CasperJS to a different location.
You can now run any regular casper scripts that way:
.. code-block:: text
C:> casperjs.bat myscript.js
**Before 1.0.0-RC3, you had to setup your casper scripts that way::**
phantom.casperPath = 'C:\\casperjs-1.1';
phantom.injectJs(phantom.casperPath + '\\bin\\bootstrap.js');
var casper = require('casper').create();
// do stuff
Run the script using the ``phantom.exe`` program:
.. code-block:: text
C:> phantomjs.exe myscript.js
Colorized output
~~~~~~~~~~~~~~~~
.. note::
......
#!/usr/bin/env ruby
# Ruby Wrapper for CasperJs
# by hannyu
def resolve(file_path)
while File.symlink?(file_path) do
file_path = File.readlink(file_path)
end
file_path
end
CASPER_PATH = File.dirname(File.dirname(File.expand_path(resolve(__FILE__))))
PHANTOMJS_NATIVE_ARGS = [
'--cookies-file',
'--config',
'--debug',
'--disk-cache',
'--ignore-ssl-errors',
'--load-images',
'--load-plugins',
'--local-storage-path',
'--local-storage-quota',
'--local-to-remote-url-access',
'--max-disk-cache-size',
'--output-encoding',
'--proxy',
'--proxy-auth',
'--proxy-type',
'--remote-debugger-port',
'--remote-debugger-autorun',
'--script-encoding',
'--ssl-protocol',
'--web-security',
]
CASPER_ARGS = []
PHANTOMJS_ARGS = []
ARGV.each do |arg|
is_found = false
PHANTOMJS_NATIVE_ARGS.each do |pna|
if arg.start_with? pna
PHANTOMJS_ARGS << arg
is_found = true
break
end
end
CASPER_ARGS << arg if not is_found
end
CASPER_COMMAND = []
CASPER_COMMAND << (ENV["PHANTOMJS_EXECUTABLE"] || "phantomjs")
CASPER_COMMAND.concat PHANTOMJS_ARGS
CASPER_COMMAND << File.join(CASPER_PATH, "bin", "bootstrap.js")
CASPER_COMMAND << "--casper-path=#{CASPER_PATH}"
CASPER_COMMAND << "--cli"
CASPER_COMMAND.concat CASPER_ARGS
if system(CASPER_COMMAND.join(" ")).nil?
puts "Fatal: Did you install phantomjs?"
end
exit $?.exitstatus || 1