Sha256: ee376d66554723f28f0ed6f625f800205b32925a1b19c110ba4edc16d7ddc49e

Contents?: true

Size: 630 Bytes

Versions: 12

Compression:

Stored size: 630 Bytes

Contents

require "bundler/setup"
Bundler.require

DocRaptor.configure do |dr|
  dr.username  = "YOUR_API_KEY_HERE"
  # dr.debugging = true
end

$docraptor = DocRaptor::DocApi.new

create_response = $docraptor.create_async_doc(
  test:             true,
  document_content: "<html><body>Hello from Ruby</body></html>",
  name:             "s" * 201, # limit is 200 characters
  document_type:    "pdf",
)

status_response = nil
30.times do
  status_response = $docraptor.get_async_doc_status(create_response.status_id)
  exit if status_response.status == "failed"
  sleep 1
end

abort "Did not receive failed validation within 30 seconds."

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
docraptor-3.1.0 test/invalid_async.rb
docraptor-3.0.0 test/invalid_async.rb
docraptor-2.0.0 test/invalid_async.rb
docraptor-1.4.0 test/invalid_async.rb
docraptor-1.3.0 test/invalid_async.rb
docraptor-1.2.0 test/invalid_async.rb
docraptor-1.2.0beta1 test/invalid_async.rb
docraptor-1.1.0 test/invalid_async.rb
docraptor-1.0.0 test/invalid_async.rb
docraptor-0.4.0 test/invalid_async.rb
docraptor-0.3.0 test/invalid_async.rb
docraptor-0.2.0 test/invalid_async.rb