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
55dff511
...
55dff511439bbda296dfc6a4a5961af04ab228ec
authored
2012-06-29 15:22:21 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added ruby based casperjs executable (thanks @hannyu)
1 parent
43b16154
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
bin/casperjs_ruby
bin/casperjs_ruby
0 → 100644
View file @
55dff51
#!/usr/bin/env ruby
# Ruby Wrapper for CasperJs
# Version: 1.0.0
# by hannyu
CASPER_PATH
=
File
.
dirname
(
File
.
dirname
(
File
.
expand_path
(
__FILE__
)))
PHANTOMJS_NATIVE_ARGS
=
[
'--cookies-file'
,
'--config'
,
'--disk-cache'
,
'--ignore-ssl-errors'
,
'--load-images'
,
'--load-plugins'
,
'--local-to-remote-url-access'
,
'--max-disk-cache-size'
,
'--output-encoding'
,
'--remote-debugger-port'
,
'--remote-debugger-autorun'
,
'--proxy'
,
'--proxy-auth'
,
'--proxy-type'
,
'--script-encoding'
,
'--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
Please
register
or
sign in
to post a comment