Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
a3ca065c
...
a3ca065c8306ebfc6a1931257eab257e943cf1dd
authored
2012-06-23 17:13:16 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
closes #79 - use phantomjs system module
1 parent
c3b5e34b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
bin/bootstrap.js
modules/cli.js
bin/bootstrap.js
View file @
a3ca065
...
...
@@ -30,11 +30,13 @@
/*global console phantom require*/
if
(
phantom
.
version
.
major
!==
1
||
phantom
.
version
.
minor
<
5
)
{
if
(
!
phantom
||
phantom
.
version
.
major
!==
1
||
phantom
.
version
.
minor
<
5
)
{
console
.
error
(
'CasperJS needs at least PhantomJS v1.5.0'
);
phantom
.
exit
(
1
);
}
var
system
=
require
(
'system'
);
(
function
bootstrap
(
global
)
{
"use strict"
;
/**
...
...
@@ -71,7 +73,7 @@ if (phantom.version.major !== 1 || phantom.version.minor < 5) {
// casper root path
if
(
!
phantom
.
casperPath
)
{
try
{
phantom
.
casperPath
=
phanto
m
.
args
.
map
(
function
_map
(
i
)
{
phantom
.
casperPath
=
syste
m
.
args
.
map
(
function
_map
(
i
)
{
var
match
=
i
.
match
(
/^--casper-path=
(
.*
)
/
);
if
(
match
)
{
return
fs
.
absolute
(
match
[
1
]);
...
...
@@ -232,7 +234,7 @@ if (phantom.version.major !== 1 || phantom.version.minor < 5) {
phantom
.
Casper
=
require
(
'casper'
).
Casper
;
// casper cli args
phantom
.
casperArgs
=
require
(
'cli'
).
parse
(
phanto
m
.
args
);
phantom
.
casperArgs
=
require
(
'cli'
).
parse
(
syste
m
.
args
);
// loaded status
phantom
.
casperLoaded
=
true
;
...
...
modules/cli.js
View file @
a3ca065
...
...
@@ -30,13 +30,14 @@
/*global CasperError console exports phantom require*/
var
system
=
require
(
'system'
);
var
utils
=
require
(
'utils'
);
/**
* Extracts, normalize ad organize PhantomJS CLI arguments in a dedicated
* Object.
*
* @param array phantomArgs
phanto
m.args value
* @param array phantomArgs
syste
m.args value
* @return Object
*/
exports
.
parse
=
function
parse
(
phantomArgs
)
{
...
...
Please
register
or
sign in
to post a comment