Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewslotin committed Mar 25, 2014
1 parent 2c9c345 commit 4d6cf91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,20 @@ Shrimp.configure do |config|
# increase if you need to render very complex pages
# config.rendering_time = 1000
# change the viewport size. If you rendering pages that have
# change the viewport size. If you rendering pages that have
# flexible page width and height then you may need to set this
# to enforce a specific size
# config.viewport_width = 600
# config.viewport_height = 600
# config.viewport_width = 600
# config.viewport_height = 600
# the timeout for the phantomjs rendering process in ms
# this needs always to be higher than rendering_time
# config.rendering_timeout = 90000
# config.rendering_timeout = 90000
# maximum number of redirects to follow
# by default Shrimp does not follow any redirects which means that
# if the server responds with non HTTP 200 an error will be returned
# config.max_redirect_count = 0
# the path to a json configuration file for command-line options
# config.command_config_file = "#{Rails.root.join('config', 'shrimp', 'config.json')}"
Expand Down Expand Up @@ -153,7 +158,7 @@ To include some fancy Ajax stuff with jquery
return window.location.assign(url);
},
504: function() {
console.log("Shit's beeing wired")
console.log("Shit's being wired")
},
503: function(jqXHR, textStatus, errorThrown) {
var wait;
Expand Down
5 changes: 3 additions & 2 deletions spec/shrimp/phantom_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ def valid_pdf(io)
end

it "should parse options into a cmd line" do
phantom = Shrimp::Phantom.new("file://#{testfile}", { :margin => "2cm" }, { }, "#{Dir.tmpdir}/test.pdf")
phantom = Shrimp::Phantom.new("file://#{testfile}", { :margin => "2cm", :max_redirect_count => 10 }, { }, "#{Dir.tmpdir}/test.pdf")
phantom.cmd.should include "test.pdf A4 1 2cm portrait"
phantom.cmd.should include "file://#{testfile}"
phantom.cmd.should include "lib/shrimp/rasterize.js"
phantom.cmd.should end_with " 10"
end

it "should properly escape arguments" do
Expand Down Expand Up @@ -130,7 +131,7 @@ def valid_pdf(io)
it "should be unable to load the address" do
phantom = Shrimp::Phantom.new("file:///foo/bar")
phantom.run
phantom.error.should include "Unable to load the address"
phantom.error.should include "Error opening /foo/bar: No such file or directory (URL: file:///foo/bar)"
end

it "should be unable to copy file" do
Expand Down

0 comments on commit 4d6cf91

Please sign in to comment.