fileturn 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +6 -14
  2. data/.gitignore +1 -0
  3. data/README.md +49 -44
  4. data/fileturn.gemspec +1 -0
  5. data/lib/fileturn/errors.rb +14 -0
  6. data/lib/fileturn/http_client.rb +10 -8
  7. data/lib/fileturn/resources/account.rb +11 -35
  8. data/lib/fileturn/resources/conversion.rb +80 -0
  9. data/lib/fileturn/resources/resource.rb +0 -5
  10. data/lib/fileturn/version.rb +1 -1
  11. data/lib/fileturn.rb +6 -7
  12. data/spec/fileturn_spec.rb +5 -5
  13. data/spec/fixtures/vcr_cassettes/account_info.yml +24 -63
  14. data/spec/fixtures/vcr_cassettes/conversion_all_not_authorized.yml +48 -0
  15. data/spec/fixtures/vcr_cassettes/conversion_not_authorized.yml +48 -0
  16. data/spec/fixtures/vcr_cassettes/conversion_not_found.yml +48 -0
  17. data/spec/fixtures/vcr_cassettes/conversion_process_created.yml +52 -0
  18. data/spec/fixtures/vcr_cassettes/conversion_process_no_params.yml +97 -0
  19. data/spec/fixtures/vcr_cassettes/conversion_process_success.yml +50 -0
  20. data/spec/fixtures/vcr_cassettes/conversion_success.yml +50 -0
  21. data/spec/fixtures/vcr_cassettes/conversions_all.yml +50 -0
  22. data/spec/fixtures/vcr_cassettes/conversions_all_second.yml +97 -0
  23. data/spec/fixtures/vcr_cassettes/reload_.yml +52 -0
  24. data/spec/fixtures/vcr_cassettes/reload_done.yml +50 -0
  25. data/spec/resources/account_spec.rb +8 -23
  26. data/spec/resources/conversion_spec.rb +213 -0
  27. data/spec/resources/upload_spec.rb +35 -35
  28. data/spec/spec_helper.rb +1 -1
  29. data/spec/stub_http_client.rb +1 -1
  30. metadata +58 -61
  31. data/lib/fileturn/exceptions.rb +0 -30
  32. data/lib/fileturn/resources/file.rb +0 -112
  33. data/lib/fileturn/resources/notification.rb +0 -16
  34. data/spec/fixtures/vcr_cassettes/file_all.yml +0 -103
  35. data/spec/fixtures/vcr_cassettes/file_all_notifications.yml +0 -103
  36. data/spec/fixtures/vcr_cassettes/file_convert_no_params.yml +0 -87
  37. data/spec/fixtures/vcr_cassettes/file_convert_success.yml +0 -89
  38. data/spec/fixtures/vcr_cassettes/file_doesnt_upload_since_too_big.yml +0 -46
  39. data/spec/fixtures/vcr_cassettes/file_failed_.yml +0 -176
  40. data/spec/fixtures/vcr_cassettes/file_notifications.yml +0 -89
  41. data/spec/fixtures/vcr_cassettes/file_queued_.yml +0 -176
  42. data/spec/fixtures/vcr_cassettes/file_reload.yml +0 -132
  43. data/spec/fixtures/vcr_cassettes/file_success.yml +0 -89
  44. data/spec/fixtures/vcr_cassettes/file_success_.yml +0 -176
  45. data/spec/fixtures/vcr_cassettes/file_time_taken.yml +0 -176
  46. data/spec/fixtures/vcr_cassettes/file_unauthorized.yml +0 -87
  47. data/spec/fixtures/vcr_cassettes/file_upload_doc_queued.yml +0 -782
  48. data/spec/fixtures/vcr_cassettes/file_upload_not_enough_credits.yml +0 -130
  49. data/spec/fixtures/vcr_cassettes/file_upload_queued.yml +0 -203
  50. data/spec/fixtures/vcr_cassettes/upload_all.yml +0 -89
  51. data/spec/fixtures/vcr_cassettes/upload_one.yml +0 -89
  52. data/spec/fixtures/vcr_cassettes/upload_refetch.yml +0 -132
  53. data/spec/resources/file_spec.rb +0 -184
@@ -1,112 +0,0 @@
1
- module FileTurn
2
- class File < Resource
3
-
4
- # class
5
- class << self
6
-
7
- def find(id, &block)
8
- conn.get("/files/#{id}.json", {}, 200) do |params|
9
- block ? block.call(params) : File.new(params)
10
- end
11
- end
12
-
13
- def all
14
- conn.get("files.json", {}, 200) do |params|
15
- files = Array(params['files']).map { |p| File.new(p) }
16
- OpenStruct.new(
17
- :files => files,
18
- :total_files => params['total_files'],
19
- :current_page => params['current_page'],
20
- :per_page => params['per_page'],
21
- :total_pages => params['total_pages']
22
- )
23
- end
24
- end
25
-
26
- def convert(params)
27
- file = params['file'] || params[:file]
28
- return upload_file(file, params) unless file.nil?
29
-
30
- conn.post("files.json", params, 201) do |params|
31
- File.new(params)
32
- end
33
- end
34
-
35
- private
36
-
37
- def upload_file(file, params)
38
- evaluate_file_size = FileTurn::Upload.send(:evaluate_file_size, file)
39
- return evaluate_file_size unless evaluate_file_size.nil?
40
-
41
- signed_params = FileTurn::Upload.send(:signed_upload_url, file)
42
- return signed_params if signed_params.errors
43
-
44
- faraday = Faraday.new(:url => signed_params.url) do |conn|
45
- conn.request :multipart
46
- conn.adapter :net_http
47
- end
48
-
49
- response = faraday.post '/', {
50
- :policy => signed_params.policy,
51
- :signature => signed_params.signature,
52
- 'AWSAccessKeyId' => signed_params.aws_access_key_id,
53
- :key => signed_params.key,
54
- :file => Faraday::UploadIO.new(file.path, '')
55
- }
56
-
57
- if response.status == 204
58
- params[:file] = params['file'] = nil
59
- params['url'] = "#{signed_params.url}/#{signed_params.key}"
60
- params['file_type'] = signed_params.file_type
61
- params['upload_id'] = signed_params.id
62
- convert(params)
63
- end
64
- end
65
-
66
- end
67
-
68
- #vars
69
- attr_accessor :id, :url, :convert_to, :created_at, :status,
70
- :download_url, :notifications, :params
71
-
72
- # instance
73
- def initialize(params={})
74
- parse_json_params(params)
75
- end
76
-
77
- def success?
78
- status == 'processed'
79
- end
80
-
81
- def failed?
82
- status == 'failed'
83
- end
84
-
85
- def queued?
86
- status == 'queued'
87
- end
88
-
89
- def reload
90
- File.find(id) { |params| parse_json_params(params) }
91
- self
92
- end
93
-
94
- def time_taken
95
- notifications.last && notifications.last.time_taken
96
- end
97
-
98
- private
99
-
100
- def parse_json_params(params)
101
- @params = params
102
- @id = params['id']
103
- @url = params['url']
104
- @convert_to = params['convert_to']
105
- @created_at = DateTime.parse(params['created_at'])
106
- @status = params['status']
107
- @download_url = params['download_url']
108
- @notifications = Array(params['notifications']).map { |p| Notification.new(p) }
109
- end
110
-
111
- end
112
- end
@@ -1,16 +0,0 @@
1
- module FileTurn
2
- class Notification < Resource
3
- attr_reader :id, :details, :parsed_time, :status, :time_taken,
4
- :file_id, :params
5
-
6
- def initialize(params)
7
- @params = params
8
- @id = params['id']
9
- @details = params['details']
10
- @parsed_time = DateTime.parse(params['parsed_time']) if params['parsed_time']
11
- @status = params['status']
12
- @time_taken = params['time_taken'].to_f if params['time_taken']
13
- @file_id = params['doc_id']
14
- end
15
- end
16
- end
@@ -1,103 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: http://localhost:3000/api/files.json?token=67sFfjudMpXxJeioQcPSppYkoVdQD1oetqPWzMAh
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - Faraday v0.8.7
12
- Accept-Encoding:
13
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
- Accept:
15
- - ! '*/*'
16
- response:
17
- status:
18
- code: 200
19
- message: ! 'OK '
20
- headers:
21
- Content-Type:
22
- - application/json; charset=utf-8
23
- X-Ua-Compatible:
24
- - IE=Edge
25
- Etag:
26
- - ! '"a0ad6f6d1d5bed418b32e6ea4d4977c9"'
27
- Cache-Control:
28
- - max-age=0, private, must-revalidate
29
- X-Request-Id:
30
- - 7624b8fbde85ac2530bbe7c001ce288d
31
- X-Runtime:
32
- - '0.037598'
33
- Server:
34
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-11-10)
35
- Date:
36
- - Sun, 07 Jul 2013 22:46:58 GMT
37
- Content-Length:
38
- - '6636'
39
- Connection:
40
- - Keep-Alive
41
- body:
42
- encoding: US-ASCII
43
- string: ! '{"files":[{"id":131,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-05T22:19:33Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_131.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306351&Signature=Nvmf2XYfi3ItUeVPstNyVTycHSM%3D","notifications":[{"id":109,"details":null,"parsed_time":"2013-07-05T22:19:42Z","status":"success","time_taken":"8.414609","file_id":131}]},{"id":138,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-05T22:40:12Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_138.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306351&Signature=QkoSMYdhVjEpS6rEHNxjfpCTT3k%3D","notifications":[{"id":115,"details":null,"parsed_time":"2013-07-05T22:40:16Z","status":"success","time_taken":"4.168722","file_id":138}]},{"id":140,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-05T22:40:13Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_140.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306351&Signature=PHtcNQOlp3Am8w4YuxcmTWzVPZI%3D","notifications":[{"id":119,"details":null,"parsed_time":"2013-07-05T22:40:29Z","status":"success","time_taken":"12.611831","file_id":140}]},{"id":392,"url":"http://test.com","convert_to":"pdf","created_at":"2013-07-07T18:24:12Z","status":"failed","download_url":"","notifications":[{"id":364,"details":"file
44
- type not supported: com","parsed_time":null,"status":"failed","time_taken":null,"file_id":392}]},{"id":127,"url":"nice.com","convert_to":"pdf","created_at":"2013-07-05T22:18:55Z","status":"failed","download_url":"","notifications":[{"id":105,"details":"file
45
- type not supported: com","parsed_time":null,"status":"failed","time_taken":null,"file_id":127}]},{"id":133,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:37:49Z","status":"failed","download_url":"","notifications":[{"id":111,"details":"extension
46
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":133}]},{"id":134,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:38:16Z","status":"failed","download_url":"","notifications":[{"id":112,"details":"extension
47
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":134}]},{"id":135,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:38:37Z","status":"failed","download_url":"","notifications":[{"id":113,"details":"extension
48
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":135}]},{"id":136,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfag","created_at":"2013-07-05T22:40:03Z","status":"failed","download_url":"","notifications":[{"id":114,"details":"extension
49
- not supported: pdfag","parsed_time":null,"status":"failed","time_taken":null,"file_id":136}]},{"id":460,"url":"http://test.com","convert_to":"pdf","created_at":"2013-07-07T19:07:47Z","status":"failed","download_url":"","notifications":[{"id":432,"details":"file
50
- type not supported: com","parsed_time":null,"status":"failed","time_taken":null,"file_id":460}]},{"id":475,"url":"http://test.com","convert_to":"pdf","created_at":"2013-07-07T19:10:31Z","status":"failed","download_url":"","notifications":[{"id":447,"details":"file
51
- type not supported: com","parsed_time":null,"status":"failed","time_taken":null,"file_id":475}]},{"id":143,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:40:31Z","status":"failed","download_url":"","notifications":[{"id":120,"details":"extension
52
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":143}]},{"id":144,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:41:25Z","status":"failed","download_url":"","notifications":[{"id":122,"details":"extension
53
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":144}]},{"id":276,"url":"http://test.com","convert_to":"pdf","created_at":"2013-07-07T07:47:54Z","status":"failed","download_url":"","notifications":[{"id":248,"details":"file
54
- type not supported: com","parsed_time":null,"status":"failed","time_taken":null,"file_id":276}]},{"id":145,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:41:42Z","status":"failed","download_url":"","notifications":[{"id":123,"details":"extension
55
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":145}]},{"id":146,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:41:44Z","status":"failed","download_url":"","notifications":[{"id":124,"details":"extension
56
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":146}]},{"id":157,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-06T01:23:56Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_157.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306351&Signature=BLFdG%2BdNziqVAK6Hkou5Aovc6rw%3D","notifications":[{"id":135,"details":null,"parsed_time":"2013-07-06T01:24:00Z","status":"success","time_taken":"4.32036","file_id":157}]},{"id":142,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-05T22:40:13Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_142.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306351&Signature=Jr4ECv5YHa9wpB8cDHGSd%2FYam%2Bw%3D","notifications":[{"id":121,"details":null,"parsed_time":"2013-07-05T22:40:32Z","status":"success","time_taken":"9.192231","file_id":142}]},{"id":160,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-06T05:49:17Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_160.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306590&Signature=%2BtR6KbPCdZWzrJ%2F3RWyomG8Pc5k%3D","notifications":[{"id":138,"details":null,"parsed_time":"2013-07-06T05:49:21Z","status":"success","time_taken":"3.653004","file_id":160}]},{"id":151,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdaa","created_at":"2013-07-05T22:41:57Z","status":"failed","download_url":"","notifications":[{"id":127,"details":"extension
57
- not supported: pdaa","parsed_time":null,"status":"failed","time_taken":null,"file_id":151}]}],"total_files":380,"current_page":1,"per_page":20,"total_pages":19}'
58
- http_version:
59
- recorded_at: Sun, 07 Jul 2013 22:46:58 GMT
60
- - request:
61
- method: get
62
- uri: http://fileturn.net/api/files.json?token=67sFfjudMpXxJeioQcPSppYkoVdQD1oetqPWzMAh
63
- body:
64
- encoding: US-ASCII
65
- string: ''
66
- headers:
67
- User-Agent:
68
- - Faraday v0.8.7
69
- Accept-Encoding:
70
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
71
- Accept:
72
- - ! '*/*'
73
- response:
74
- status:
75
- code: 401
76
- message: Unauthorized
77
- headers:
78
- Cache-Control:
79
- - no-cache
80
- Content-Type:
81
- - application/json; charset=utf-8
82
- Date:
83
- - Wed, 10 Jul 2013 02:23:46 GMT
84
- Status:
85
- - 401 Unauthorized
86
- X-Rack-Cache:
87
- - miss
88
- X-Request-Id:
89
- - 06747b44ea6f957924d8ea5d1e33af9c
90
- X-Runtime:
91
- - '0.008411'
92
- X-Ua-Compatible:
93
- - IE=Edge,chrome=1
94
- Transfer-Encoding:
95
- - chunked
96
- Connection:
97
- - keep-alive
98
- body:
99
- encoding: US-ASCII
100
- string: ! '{"error":"Your token is invalid","status":401}'
101
- http_version:
102
- recorded_at: Wed, 10 Jul 2013 02:26:16 GMT
103
- recorded_with: VCR 2.4.0
@@ -1,103 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: http://localhost:3000/api/files.json?token=67sFfjudMpXxJeioQcPSppYkoVdQD1oetqPWzMAh
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - Faraday v0.8.7
12
- Accept-Encoding:
13
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
- Accept:
15
- - ! '*/*'
16
- response:
17
- status:
18
- code: 200
19
- message: ! 'OK '
20
- headers:
21
- Content-Type:
22
- - application/json; charset=utf-8
23
- X-Ua-Compatible:
24
- - IE=Edge
25
- Etag:
26
- - ! '"a0ad6f6d1d5bed418b32e6ea4d4977c9"'
27
- Cache-Control:
28
- - max-age=0, private, must-revalidate
29
- X-Request-Id:
30
- - afc23b8a6580f895fedb33d44a564e02
31
- X-Runtime:
32
- - '0.039377'
33
- Server:
34
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-11-10)
35
- Date:
36
- - Sun, 07 Jul 2013 22:46:58 GMT
37
- Content-Length:
38
- - '6636'
39
- Connection:
40
- - Keep-Alive
41
- body:
42
- encoding: US-ASCII
43
- string: ! '{"files":[{"id":131,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-05T22:19:33Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_131.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306351&Signature=Nvmf2XYfi3ItUeVPstNyVTycHSM%3D","notifications":[{"id":109,"details":null,"parsed_time":"2013-07-05T22:19:42Z","status":"success","time_taken":"8.414609","file_id":131}]},{"id":138,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-05T22:40:12Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_138.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306351&Signature=QkoSMYdhVjEpS6rEHNxjfpCTT3k%3D","notifications":[{"id":115,"details":null,"parsed_time":"2013-07-05T22:40:16Z","status":"success","time_taken":"4.168722","file_id":138}]},{"id":140,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-05T22:40:13Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_140.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306351&Signature=PHtcNQOlp3Am8w4YuxcmTWzVPZI%3D","notifications":[{"id":119,"details":null,"parsed_time":"2013-07-05T22:40:29Z","status":"success","time_taken":"12.611831","file_id":140}]},{"id":392,"url":"http://test.com","convert_to":"pdf","created_at":"2013-07-07T18:24:12Z","status":"failed","download_url":"","notifications":[{"id":364,"details":"file
44
- type not supported: com","parsed_time":null,"status":"failed","time_taken":null,"file_id":392}]},{"id":127,"url":"nice.com","convert_to":"pdf","created_at":"2013-07-05T22:18:55Z","status":"failed","download_url":"","notifications":[{"id":105,"details":"file
45
- type not supported: com","parsed_time":null,"status":"failed","time_taken":null,"file_id":127}]},{"id":133,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:37:49Z","status":"failed","download_url":"","notifications":[{"id":111,"details":"extension
46
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":133}]},{"id":134,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:38:16Z","status":"failed","download_url":"","notifications":[{"id":112,"details":"extension
47
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":134}]},{"id":135,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:38:37Z","status":"failed","download_url":"","notifications":[{"id":113,"details":"extension
48
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":135}]},{"id":136,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfag","created_at":"2013-07-05T22:40:03Z","status":"failed","download_url":"","notifications":[{"id":114,"details":"extension
49
- not supported: pdfag","parsed_time":null,"status":"failed","time_taken":null,"file_id":136}]},{"id":460,"url":"http://test.com","convert_to":"pdf","created_at":"2013-07-07T19:07:47Z","status":"failed","download_url":"","notifications":[{"id":432,"details":"file
50
- type not supported: com","parsed_time":null,"status":"failed","time_taken":null,"file_id":460}]},{"id":475,"url":"http://test.com","convert_to":"pdf","created_at":"2013-07-07T19:10:31Z","status":"failed","download_url":"","notifications":[{"id":447,"details":"file
51
- type not supported: com","parsed_time":null,"status":"failed","time_taken":null,"file_id":475}]},{"id":143,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:40:31Z","status":"failed","download_url":"","notifications":[{"id":120,"details":"extension
52
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":143}]},{"id":144,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:41:25Z","status":"failed","download_url":"","notifications":[{"id":122,"details":"extension
53
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":144}]},{"id":276,"url":"http://test.com","convert_to":"pdf","created_at":"2013-07-07T07:47:54Z","status":"failed","download_url":"","notifications":[{"id":248,"details":"file
54
- type not supported: com","parsed_time":null,"status":"failed","time_taken":null,"file_id":276}]},{"id":145,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:41:42Z","status":"failed","download_url":"","notifications":[{"id":123,"details":"extension
55
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":145}]},{"id":146,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdfa","created_at":"2013-07-05T22:41:44Z","status":"failed","download_url":"","notifications":[{"id":124,"details":"extension
56
- not supported: pdfa","parsed_time":null,"status":"failed","time_taken":null,"file_id":146}]},{"id":157,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-06T01:23:56Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_157.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306351&Signature=BLFdG%2BdNziqVAK6Hkou5Aovc6rw%3D","notifications":[{"id":135,"details":null,"parsed_time":"2013-07-06T01:24:00Z","status":"success","time_taken":"4.32036","file_id":157}]},{"id":142,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-05T22:40:13Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_142.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306351&Signature=Jr4ECv5YHa9wpB8cDHGSd%2FYam%2Bw%3D","notifications":[{"id":121,"details":null,"parsed_time":"2013-07-05T22:40:32Z","status":"success","time_taken":"9.192231","file_id":142}]},{"id":160,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdf","created_at":"2013-07-06T05:49:17Z","status":"processed","download_url":"https://fileturn.s3.amazonaws.com/8_160.pdf?AWSAccessKeyId=AKIAIKXW3ZZ5WNURNYMA&Expires=1373306590&Signature=%2BtR6KbPCdZWzrJ%2F3RWyomG8Pc5k%3D","notifications":[{"id":138,"details":null,"parsed_time":"2013-07-06T05:49:21Z","status":"success","time_taken":"3.653004","file_id":160}]},{"id":151,"url":"http://www.iiswc.org/iiswc2013/sample.doc","convert_to":"pdaa","created_at":"2013-07-05T22:41:57Z","status":"failed","download_url":"","notifications":[{"id":127,"details":"extension
57
- not supported: pdaa","parsed_time":null,"status":"failed","time_taken":null,"file_id":151}]}],"total_files":380,"current_page":1,"per_page":20,"total_pages":19}'
58
- http_version:
59
- recorded_at: Sun, 07 Jul 2013 22:46:58 GMT
60
- - request:
61
- method: get
62
- uri: http://fileturn.net/api/files.json?token=67sFfjudMpXxJeioQcPSppYkoVdQD1oetqPWzMAh
63
- body:
64
- encoding: US-ASCII
65
- string: ''
66
- headers:
67
- User-Agent:
68
- - Faraday v0.8.7
69
- Accept-Encoding:
70
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
71
- Accept:
72
- - ! '*/*'
73
- response:
74
- status:
75
- code: 401
76
- message: Unauthorized
77
- headers:
78
- Cache-Control:
79
- - no-cache
80
- Content-Type:
81
- - application/json; charset=utf-8
82
- Date:
83
- - Wed, 10 Jul 2013 02:23:46 GMT
84
- Status:
85
- - 401 Unauthorized
86
- X-Rack-Cache:
87
- - miss
88
- X-Request-Id:
89
- - 37c32bf9e7fed70d25d9ea6c938d61fa
90
- X-Runtime:
91
- - '0.011916'
92
- X-Ua-Compatible:
93
- - IE=Edge,chrome=1
94
- Transfer-Encoding:
95
- - chunked
96
- Connection:
97
- - keep-alive
98
- body:
99
- encoding: US-ASCII
100
- string: ! '{"error":"Your token is invalid","status":401}'
101
- http_version:
102
- recorded_at: Wed, 10 Jul 2013 02:26:16 GMT
103
- recorded_with: VCR 2.4.0
@@ -1,87 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: http://localhost:3000/api/files.json?token=67sFfjudMpXxJeioQcPSppYkoVdQD1oetqPWzMAh
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - Faraday v0.8.7
12
- Content-Length:
13
- - '0'
14
- Accept:
15
- - ! '*/*'
16
- response:
17
- status:
18
- code: 422
19
- message: ''
20
- headers:
21
- Content-Type:
22
- - application/json; charset=utf-8
23
- X-Ua-Compatible:
24
- - IE=Edge
25
- Cache-Control:
26
- - no-cache
27
- X-Request-Id:
28
- - 947b3793f1210e3f298a3e492a711134
29
- X-Runtime:
30
- - '0.013834'
31
- Server:
32
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-11-10)
33
- Date:
34
- - Sun, 07 Jul 2013 22:46:58 GMT
35
- Content-Length:
36
- - '69'
37
- Connection:
38
- - Keep-Alive
39
- body:
40
- encoding: US-ASCII
41
- string: ! '{"errors":{"url":["can''t be blank"],"convert_to":["can''t be blank"]}}'
42
- http_version:
43
- recorded_at: Sun, 07 Jul 2013 22:46:58 GMT
44
- - request:
45
- method: post
46
- uri: http://fileturn.net/api/files.json?token=67sFfjudMpXxJeioQcPSppYkoVdQD1oetqPWzMAh
47
- body:
48
- encoding: US-ASCII
49
- string: ''
50
- headers:
51
- User-Agent:
52
- - Faraday v0.8.7
53
- Content-Length:
54
- - '0'
55
- Accept:
56
- - ! '*/*'
57
- response:
58
- status:
59
- code: 401
60
- message: Unauthorized
61
- headers:
62
- Cache-Control:
63
- - no-cache
64
- Content-Type:
65
- - application/json; charset=utf-8
66
- Date:
67
- - Wed, 10 Jul 2013 02:23:46 GMT
68
- Status:
69
- - 401 Unauthorized
70
- X-Rack-Cache:
71
- - invalidate, pass
72
- X-Request-Id:
73
- - fc1e6601526edcd56153258f170f282f
74
- X-Runtime:
75
- - '0.011877'
76
- X-Ua-Compatible:
77
- - IE=Edge,chrome=1
78
- Transfer-Encoding:
79
- - chunked
80
- Connection:
81
- - keep-alive
82
- body:
83
- encoding: US-ASCII
84
- string: ! '{"error":"Your token is invalid","status":401}'
85
- http_version:
86
- recorded_at: Wed, 10 Jul 2013 02:26:16 GMT
87
- recorded_with: VCR 2.4.0
@@ -1,89 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: http://localhost:3000/api/files.json?convert_to=pdf&token=67sFfjudMpXxJeioQcPSppYkoVdQD1oetqPWzMAh&url=http://test.com
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - Faraday v0.8.7
12
- Content-Length:
13
- - '0'
14
- Accept:
15
- - ! '*/*'
16
- response:
17
- status:
18
- code: 201
19
- message: ! 'Created '
20
- headers:
21
- Content-Type:
22
- - application/json; charset=utf-8
23
- X-Ua-Compatible:
24
- - IE=Edge
25
- Etag:
26
- - ! '"0bd3ad2a8f4dd447c4b67543a073105b"'
27
- Cache-Control:
28
- - max-age=0, private, must-revalidate
29
- X-Request-Id:
30
- - ffdbeb89a704a5bde4ade0a6f8f3fc9a
31
- X-Runtime:
32
- - '0.023636'
33
- Server:
34
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-11-10)
35
- Date:
36
- - Sun, 07 Jul 2013 22:46:58 GMT
37
- Content-Length:
38
- - '144'
39
- Connection:
40
- - Keep-Alive
41
- body:
42
- encoding: US-ASCII
43
- string: ! '{"id":611,"url":"http://test.com","convert_to":"pdf","created_at":"2013-07-07T22:46:58Z","status":"queued","download_url":"","notifications":[]}'
44
- http_version:
45
- recorded_at: Sun, 07 Jul 2013 22:46:58 GMT
46
- - request:
47
- method: post
48
- uri: http://fileturn.net/api/files.json?convert_to=pdf&token=67sFfjudMpXxJeioQcPSppYkoVdQD1oetqPWzMAh&url=http://test.com
49
- body:
50
- encoding: US-ASCII
51
- string: ''
52
- headers:
53
- User-Agent:
54
- - Faraday v0.8.7
55
- Content-Length:
56
- - '0'
57
- Accept:
58
- - ! '*/*'
59
- response:
60
- status:
61
- code: 401
62
- message: Unauthorized
63
- headers:
64
- Cache-Control:
65
- - no-cache
66
- Content-Type:
67
- - application/json; charset=utf-8
68
- Date:
69
- - Wed, 10 Jul 2013 02:23:46 GMT
70
- Status:
71
- - 401 Unauthorized
72
- X-Rack-Cache:
73
- - invalidate, pass
74
- X-Request-Id:
75
- - 4859cd7268f9b0e546de5f75d0ee3f8f
76
- X-Runtime:
77
- - '0.013926'
78
- X-Ua-Compatible:
79
- - IE=Edge,chrome=1
80
- Transfer-Encoding:
81
- - chunked
82
- Connection:
83
- - keep-alive
84
- body:
85
- encoding: US-ASCII
86
- string: ! '{"error":"Your token is invalid","status":401}'
87
- http_version:
88
- recorded_at: Wed, 10 Jul 2013 02:26:16 GMT
89
- recorded_with: VCR 2.4.0
@@ -1,46 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: http://localhost:3000/api/uploads.json?token=vGAMKzyN1pFGCNcCFsPpjjVVZtvim1zop3te2pQU
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - Faraday v0.8.7
12
- Accept-Encoding:
13
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
- Accept:
15
- - ! '*/*'
16
- response:
17
- status:
18
- code: 200
19
- message: ! 'OK '
20
- headers:
21
- Content-Type:
22
- - application/json; charset=utf-8
23
- X-Ua-Compatible:
24
- - IE=Edge
25
- Etag:
26
- - ! '"b43687c602a82010e4d4591ff6b7404f"'
27
- Cache-Control:
28
- - max-age=0, private, must-revalidate
29
- X-Request-Id:
30
- - cafebdf6b2dfabab85adb53c2a1de1d3
31
- X-Runtime:
32
- - '0.015049'
33
- Server:
34
- - WEBrick/1.3.1 (Ruby/1.9.3/2012-11-10)
35
- Date:
36
- - Sun, 07 Jul 2013 23:00:04 GMT
37
- Content-Length:
38
- - '79'
39
- Connection:
40
- - Keep-Alive
41
- body:
42
- encoding: US-ASCII
43
- string: ! '{"uploads":[],"total_uploads":0,"current_page":1,"per_page":20,"total_pages":0}'
44
- http_version:
45
- recorded_at: Sun, 07 Jul 2013 23:00:04 GMT
46
- recorded_with: VCR 2.4.0