yadisk-client 1.10.2 → 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +14 -0
  3. data/.github/workflows/CI.yml +50 -0
  4. data/Gemfile.lock +12 -1
  5. data/README.md +5 -2
  6. data/lib/yadisk/resources/disk.rb +5 -6
  7. data/lib/yadisk/version.rb +2 -2
  8. data/spec/lib/yadisk/client_spec.rb +4 -8
  9. data/spec/lib/yadisk/disk_spec.rb +220 -217
  10. data/spec/lib/yadisk/operation_spec.rb +18 -0
  11. data/spec/lib/yadisk/public_spec.rb +31 -37
  12. data/spec/lib/yadisk/trash_spec.rb +27 -56
  13. data/spec/spec_helper.rb +15 -1
  14. data/spec/vcr/disk/{POST_copy.yml → copy.yml} +10 -8
  15. data/spec/vcr/disk/create_dir.yml +52 -0
  16. data/spec/vcr/disk/{PUT_create_dir.yml → create_dir_error_409.yml} +10 -6
  17. data/spec/vcr/disk/{DELETE_delete.yml → delete.yml} +3 -3
  18. data/spec/vcr/{operations/GET_status.yml → disk/download.yml} +4 -4
  19. data/spec/vcr/disk/get_meta.yml +52 -0
  20. data/spec/vcr/disk/info.yml +57 -0
  21. data/spec/vcr/disk/last_uploaded.yml +52 -0
  22. data/spec/vcr/disk/list_files.yml +52 -0
  23. data/spec/vcr/disk/list_public.yml +52 -0
  24. data/spec/vcr/disk/{POST_move.yml → move.yml} +10 -8
  25. data/spec/vcr/disk/{PUT_publish.yml → publish.yml} +4 -4
  26. data/spec/vcr/disk/{PUT_unpublish.yml → unpublish.yml} +4 -4
  27. data/spec/vcr/disk/update_meta.yml +54 -0
  28. data/spec/vcr/disk/{GET_get_meta.yml → upload.yml} +5 -5
  29. data/spec/vcr/disk/{POST_upload_by_url.yml → upload_by_url.yml} +4 -4
  30. data/spec/vcr/disk/upload_from_file.yml +111 -0
  31. data/spec/vcr/{disk/GET_download.yml → operation/status.yml} +4 -4
  32. data/spec/vcr/{disk/GET_list_public.yml → public/link.yml} +4 -4
  33. data/spec/vcr/public/meta.yml +52 -0
  34. data/spec/vcr/public/save.yml +52 -0
  35. data/spec/vcr/trash/{DELETE_delete.yml → delete.yml} +3 -3
  36. data/spec/vcr/trash/list.yml +52 -0
  37. data/spec/vcr/trash/{PUT_restore.yml → restore.yml} +6 -5
  38. data/spec/vcr_setup.rb +0 -4
  39. data/yadisk.gemspec +8 -0
  40. metadata +133 -23
  41. data/spec/lib/yadisk/errors_spec.rb +0 -16
  42. data/spec/lib/yadisk/operations_spec.rb +0 -23
  43. data/spec/vcr/disk/ERROR_info.yml +0 -48
  44. data/spec/vcr/disk/GET_info.yml +0 -52
  45. data/spec/vcr/disk/GET_upload.yml +0 -48
  46. data/spec/vcr/disk/PATCH_update_meta.yml +0 -54
  47. data/spec/vcr/trash/DELETE_delete_error.yml +0 -49
  48. data/spec/vcr/trash/GET_list.yml +0 -51
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://cloud-api.yandex.net/v1/disk/resources?path=remote_file.txt
5
+ uri: https://cloud-api.yandex.net/v1/disk/resources/upload?path=yadisk_upload_here
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -23,7 +23,7 @@ http_interactions:
23
23
  Server:
24
24
  - nginx
25
25
  Date:
26
- - Wed, 05 Oct 2022 14:32:13 GMT
26
+ - Tue, 18 Oct 2022 11:43:11 GMT
27
27
  Content-Type:
28
28
  - application/json; charset=utf-8
29
29
  Transfer-Encoding:
@@ -33,7 +33,7 @@ http_interactions:
33
33
  Vary:
34
34
  - Accept-Encoding
35
35
  Access-Control-Allow-Methods:
36
- - PUT, PATCH, DELETE, GET, OPTIONS
36
+ - PUT, POST, GET, OPTIONS
37
37
  Access-Control-Allow-Credentials:
38
38
  - 'true'
39
39
  Yandex-Cloud-Request-Id:
@@ -47,6 +47,6 @@ http_interactions:
47
47
  Authorization
48
48
  body:
49
49
  encoding: UTF-8
50
- string: '{"items":[{"key":"value"}]}'
51
- recorded_at: Wed, 05 Oct 2022 14:32:13 GMT
50
+ string: '{"operation_id":"78ccc91b3a034a941a72dde1ae92fbf26d0facf9bad941eee9b432f4abdfdd1e","href":"https://uploader9x.disk.yandex.net:443/upload-target/20221018T144311.680.utd.6n9ay2kos10pewsoun8tlx7gf-k7o.674502","method":"PUT","templated":false}'
51
+ recorded_at: Tue, 18 Oct 2022 11:43:11 GMT
52
52
  recorded_with: VCR 6.1.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://cloud-api.yandex.net/v1/disk/resources/upload?path=uploaded_by_url.png&url=https://www.example.com/image.png
5
+ uri: https://cloud-api.yandex.net/v1/disk/resources/upload?path=yadisk_test_png.png&url=https://www.fnordware.com/superpng/pnggrad8rgb.png
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: ''
@@ -25,7 +25,7 @@ http_interactions:
25
25
  Server:
26
26
  - nginx
27
27
  Date:
28
- - Wed, 05 Oct 2022 14:32:13 GMT
28
+ - Tue, 18 Oct 2022 11:47:35 GMT
29
29
  Content-Type:
30
30
  - application/json; charset=utf-8
31
31
  Content-Length:
@@ -47,6 +47,6 @@ http_interactions:
47
47
  Authorization
48
48
  body:
49
49
  encoding: UTF-8
50
- string: '{"items":[{"key":"value"}]}'
51
- recorded_at: Wed, 05 Oct 2022 14:32:13 GMT
50
+ string: '{"href":"https://cloud-api.yandex.net/v1/disk/operations/7aeaf57f7f0da5ce8477bca07922aa491fc9836175b11caf35221cf8738f8589","method":"GET","templated":false}'
51
+ recorded_at: Tue, 18 Oct 2022 11:47:35 GMT
52
52
  recorded_with: VCR 6.1.0
@@ -0,0 +1,111 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://uploader9x.disk.yandex.net/upload-target/20221018T144311.680.utd.6n9ay2kos10pewsoun8tlx7gf-k7o.674502
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ Copyright (c) 2022 Ilya Brin
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ headers:
17
+ User-Agent:
18
+ - Faraday v1.10.2
19
+ Authorization:
20
+ - "[**********]"
21
+ Content-Type:
22
+ - application/json
23
+ Accept-Encoding:
24
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
25
+ Accept:
26
+ - "*/*"
27
+ response:
28
+ status:
29
+ code: 201
30
+ message: Created
31
+ headers:
32
+ Server:
33
+ - nginx/1.14.2
34
+ Date:
35
+ - Tue, 18 Oct 2022 11:46:09 GMT
36
+ Transfer-Encoding:
37
+ - chunked
38
+ Connection:
39
+ - keep-alive
40
+ Keep-Alive:
41
+ - timeout=120
42
+ Location:
43
+ - "/disk/yadisk_upload_here"
44
+ Access-Control-Allow-Origin:
45
+ - "*"
46
+ Access-Control-Allow-Methods:
47
+ - POST, PUT, OPTIONS
48
+ Access-Control-Allow-Headers:
49
+ - Content-Type, Content-Length, Content-Range, X-HTTP-Method, X-Requested-With,
50
+ X-Disk-Uploader-Wait-Complete-Upload
51
+ Access-Control-Expose-Headers:
52
+ - Content-Length, X-Ya-Expect-Content-Length, Location
53
+ body:
54
+ encoding: UTF-8
55
+ string: ''
56
+ recorded_at: Tue, 18 Oct 2022 11:46:08 GMT
57
+ - request:
58
+ method: put
59
+ uri: https://uploader7o.disk.yandex.net/upload-target/20221018T144311.680.utd.6n9ay2kos10pewsoun8tlx7gf-k7o.674502
60
+ body:
61
+ encoding: UTF-8
62
+ string: |
63
+ Copyright (c) 2022 Ilya Brin
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66
+
67
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
68
+
69
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
70
+ headers:
71
+ User-Agent:
72
+ - Faraday v1.10.2
73
+ Authorization:
74
+ - "[**********]"
75
+ Content-Type:
76
+ - application/json
77
+ Accept-Encoding:
78
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
79
+ Accept:
80
+ - "*/*"
81
+ response:
82
+ status:
83
+ code: 201
84
+ message: Created
85
+ headers:
86
+ Server:
87
+ - nginx/1.14.2
88
+ Date:
89
+ - Tue, 18 Oct 2022 12:29:16 GMT
90
+ Transfer-Encoding:
91
+ - chunked
92
+ Connection:
93
+ - keep-alive
94
+ Keep-Alive:
95
+ - timeout=120
96
+ Location:
97
+ - "/disk/yadisk_upload_here"
98
+ Access-Control-Allow-Origin:
99
+ - "*"
100
+ Access-Control-Allow-Methods:
101
+ - POST, PUT, OPTIONS
102
+ Access-Control-Allow-Headers:
103
+ - Content-Type, Content-Length, Content-Range, X-HTTP-Method, X-Requested-With,
104
+ X-Disk-Uploader-Wait-Complete-Upload
105
+ Access-Control-Expose-Headers:
106
+ - Content-Length, X-Ya-Expect-Content-Length, Location
107
+ body:
108
+ encoding: UTF-8
109
+ string: ''
110
+ recorded_at: Tue, 18 Oct 2022 12:29:16 GMT
111
+ recorded_with: VCR 6.1.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://cloud-api.yandex.net/v1/disk/resources/download?path=remote_file.txt
5
+ uri: https://cloud-api.yandex.net/v1/disk/operations/78ccc91b3a034a941a72dde1ae92fbf26d0facf9bad941eee9b432f4abdfdd1e
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -23,7 +23,7 @@ http_interactions:
23
23
  Server:
24
24
  - nginx
25
25
  Date:
26
- - Wed, 05 Oct 2022 14:32:16 GMT
26
+ - Tue, 18 Oct 2022 12:55:52 GMT
27
27
  Content-Type:
28
28
  - application/json; charset=utf-8
29
29
  Transfer-Encoding:
@@ -47,6 +47,6 @@ http_interactions:
47
47
  Authorization
48
48
  body:
49
49
  encoding: UTF-8
50
- string: '{"items":[{"key":"value"}]}'
51
- recorded_at: Wed, 05 Oct 2022 14:32:16 GMT
50
+ string: '{"status":"success"}'
51
+ recorded_at: Tue, 18 Oct 2022 12:55:52 GMT
52
52
  recorded_with: VCR 6.1.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://cloud-api.yandex.net/v1/disk/resources/public
5
+ uri: https://cloud-api.yandex.net/v1/disk/public/resources/download?public_key=https://disk.yandex.ru/d/XzWAb9JaK605ig
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -23,7 +23,7 @@ http_interactions:
23
23
  Server:
24
24
  - nginx
25
25
  Date:
26
- - Wed, 05 Oct 2022 14:32:17 GMT
26
+ - Tue, 18 Oct 2022 13:05:39 GMT
27
27
  Content-Type:
28
28
  - application/json; charset=utf-8
29
29
  Transfer-Encoding:
@@ -47,6 +47,6 @@ http_interactions:
47
47
  Authorization
48
48
  body:
49
49
  encoding: UTF-8
50
- string: '{"items":[{"key":"value"}]}'
51
- recorded_at: Wed, 05 Oct 2022 14:32:18 GMT
50
+ string: '{"href":"https://downloader.disk.yandex.ru/zip/399ab66946405cfc84e690605d097efe0ec73a89d507f054d6ffa16256c9436b/634ea51b/TlFUQ1pWTXB1Y3Z5WDBSeGpBaGo3ZWVvK1VrVFBCRUY4b1Qrbnl4T1Y5MDdKYTFteXNPZjlEQ1JLMFUxNlNTRnEvSjZicG1SeU9Kb25UM1ZvWG5EYWc9PTo=?uid=0&filename=yadisk.png.zip&disposition=attachment&hash=NQTCZVMpucvyX0RxjAhj7eeo%2BUkTPBEF8oT%2BnyxOV907Ja1mysOf9DCRK0U16SSFq/J6bpmRyOJonT3VoXnDag%3D%3D%3A&limit=0&owner_uid=12345678&tknv=v2","method":"GET","templated":false}'
51
+ recorded_at: Tue, 18 Oct 2022 13:05:39 GMT
52
52
  recorded_with: VCR 6.1.0
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cloud-api.yandex.net/v1/disk/public/resources?public_key=https://disk.yandex.ru/d/XzWAb9JaK605ig
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.10.2
12
+ Authorization:
13
+ - "[**********]"
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Tue, 18 Oct 2022 13:05:39 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Vary:
34
+ - Accept-Encoding
35
+ Access-Control-Allow-Methods:
36
+ - GET, OPTIONS
37
+ Access-Control-Allow-Credentials:
38
+ - 'true'
39
+ Yandex-Cloud-Request-Id:
40
+ - omitted
41
+ Cache-Control:
42
+ - no-cache
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Access-Control-Allow-Headers:
46
+ - Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
47
+ Authorization
48
+ body:
49
+ encoding: UTF-8
50
+ string: '{"public_key":"NQTCZVMpucvyX0RxjAhj7eeo+UkTPBEF8oT+nyxOV907Ja1mysOf9DCRK0U16SSFq/J6bpmRyOJonT3VoXnDag==","public_url":"https://yadi.sk/d/XzWAb9JaK605ig","_embedded":{"sort":"","public_key":"NQTCZVMpucvyX0RxjAhj7eeo+UkTPBEF8oT+nyxOV907Ja1mysOf9DCRK0U16SSFq/J6bpmRyOJonT3VoXnDag==","items":[],"limit":20,"offset":0,"path":"/","total":0},"name":"yadisk.png","exif":{},"resource_id":"12345678:e8010643f169f5d1a54b366fae73d2799404e7a4c4465062d19a74c3f81bd49f","revision":1666098182045877,"created":"2022-10-18T12:20:57+00:00","modified":"2022-10-18T12:20:57+00:00","owner":{"login":"userlogin","display_name":"Ilya","uid":"12345678"},"path":"/","comment_ids":{"private_resource":"12345678:e8010643f269f5d1a54b377fae73d2799404e8a4c4465062d19a74c3f81bd49f","public_resource":"12345678:e8010643f169f5d1a54b366fae73d2799404e7a4c4465062d19a74c3f81bd49f"},"type":"dir","views_count":0}'
51
+ recorded_at: Tue, 18 Oct 2022 13:05:39 GMT
52
+ recorded_with: VCR 6.1.0
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://cloud-api.yandex.net/v1/disk/public/resources/save-to-disk?public_key=https://disk.yandex.ru/d/XzWAb9JaK605ig
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.10.2
12
+ Authorization:
13
+ - "[**********]"
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: CREATED
24
+ headers:
25
+ Server:
26
+ - nginx
27
+ Date:
28
+ - Tue, 18 Oct 2022 13:05:41 GMT
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Content-Length:
32
+ - '167'
33
+ Connection:
34
+ - keep-alive
35
+ Access-Control-Allow-Methods:
36
+ - POST, OPTIONS
37
+ Access-Control-Allow-Credentials:
38
+ - 'true'
39
+ Yandex-Cloud-Request-Id:
40
+ - omitted
41
+ Cache-Control:
42
+ - no-cache
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Access-Control-Allow-Headers:
46
+ - Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
47
+ Authorization
48
+ body:
49
+ encoding: UTF-8
50
+ string: '{"href":"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2F%D0%97%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B8%2Fyadisk.png","method":"GET","templated":false}'
51
+ recorded_at: Tue, 18 Oct 2022 13:05:41 GMT
52
+ recorded_with: VCR 6.1.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: delete
5
- uri: https://cloud-api.yandex.net/v1/disk/trash/resources?path=trash:/remote_file.txt_f7fc32168f3b30e60994fd2e82af7d230dab5c91
5
+ uri: https://cloud-api.yandex.net/v1/disk/trash/resources?path=yadisk_created_dir_12b63824b98bc5eb70d25c703cfc3224a46e6896
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -23,7 +23,7 @@ http_interactions:
23
23
  Server:
24
24
  - nginx
25
25
  Date:
26
- - Wed, 05 Oct 2022 14:34:13 GMT
26
+ - Tue, 18 Oct 2022 13:16:41 GMT
27
27
  Content-Type:
28
28
  - application/json; charset=utf-8
29
29
  Content-Length:
@@ -46,5 +46,5 @@ http_interactions:
46
46
  body:
47
47
  encoding: UTF-8
48
48
  string: ''
49
- recorded_at: Wed, 05 Oct 2022 14:34:14 GMT
49
+ recorded_at: Tue, 18 Oct 2022 13:16:41 GMT
50
50
  recorded_with: VCR 6.1.0
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cloud-api.yandex.net/v1/disk/trash/resources?path=
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.10.2
12
+ Authorization:
13
+ - "[**********]"
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Tue, 18 Oct 2022 13:16:09 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Vary:
34
+ - Accept-Encoding
35
+ Access-Control-Allow-Methods:
36
+ - GET, DELETE, OPTIONS
37
+ Access-Control-Allow-Credentials:
38
+ - 'true'
39
+ Yandex-Cloud-Request-Id:
40
+ - omitted
41
+ Cache-Control:
42
+ - no-cache
43
+ Access-Control-Allow-Origin:
44
+ - "*"
45
+ Access-Control-Allow-Headers:
46
+ - Accept-Language, Accept, X-Uid, X-HTTP-Method, X-Requested-With, Content-Type,
47
+ Authorization
48
+ body:
49
+ encoding: UTF-8
50
+ string: '{"_embedded":{"sort":"","items":[{"name":"yadisk_created_dir","exif":{},"created":"2022-10-18T12:03:23+00:00","deleted":"2022-10-18T13:15:33+00:00","origin_path":"disk:/yadisk_created_dir","modified":"2022-10-18T13:15:33+00:00","resource_id":"12345678:eb75503df8c7eeef7e2b7b71ad9314a0f980ff3304a5577a5d8af4700f1122fc","path":"trash:/yadisk_created_dir_12b63824b98bc5eb70d25c703cfc3224a46e6896","comment_ids":{"private_resource":"12345678:eb75503df8c7eeef7e2b7b71ad9314a0f980ff3304a5577a5d8af4700f1122fc","public_resource":"12345678:eb75503df8c7eeef7e2b7b71ad9314a0f980ff3304a5577a5d8af4700f1122fc"},"type":"dir","revision":1666098933832448}],"limit":20,"offset":0,"path":"trash:/","total":1},"name":"trash","exif":{},"resource_id":"12345678:4db3a67d63d69257cf5c0c17c616e57706594e5ac747b2a478fd32ac9acc6284","origin_path":null,"modified":"2012-04-04T20:00:00+00:00","created":"2012-04-04T20:00:00+00:00","path":"trash:/","comment_ids":{},"type":"dir","revision":1333738864085459}'
51
+ recorded_at: Tue, 18 Oct 2022 13:16:09 GMT
52
+ recorded_with: VCR 6.1.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: put
5
- uri: https://cloud-api.yandex.net/v1/disk/trash/resources/restore?path=trash:/remote_file.txt_ade2b12db666598e14c09a28a55a11cee8ae14e7
5
+ uri: https://cloud-api.yandex.net/v1/disk/trash/resources/restore?path=yadisk_created_dir_857c8d0feba033c7559ade2c7c07fef3ae41c046
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: ''
@@ -25,11 +25,11 @@ http_interactions:
25
25
  Server:
26
26
  - nginx
27
27
  Date:
28
- - Wed, 05 Oct 2022 14:23:34 GMT
28
+ - Tue, 18 Oct 2022 13:14:55 GMT
29
29
  Content-Type:
30
30
  - application/json; charset=utf-8
31
31
  Content-Length:
32
- - '121'
32
+ - '124'
33
33
  Connection:
34
34
  - keep-alive
35
35
  Access-Control-Allow-Methods:
@@ -47,5 +47,6 @@ http_interactions:
47
47
  Authorization
48
48
  body:
49
49
  encoding: UTF-8
50
- string: '{"items":[{"key":"value"}]}'
51
- recorded_at: Wed, 05 Oct 2022 14:23:34 GMT
50
+ string: '{"href":"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2Fyadisk_created_dir","method":"GET","templated":false}'
51
+ recorded_at: Tue, 18 Oct 2022 13:14:55 GMT
52
+ recorded_with: VCR 6.1.0
data/spec/vcr_setup.rb CHANGED
@@ -19,10 +19,6 @@ VCR.configure do |config|
19
19
  data.dig(:response, :headers, "Yandex-Cloud-Request-Id", 0)
20
20
  }
21
21
 
22
- config.filter_sensitive_data('{"items":[{"key":"value"}]}') {|data|
23
- data["response"]["body"]
24
- }
25
-
26
22
  config.before_record do |r|
27
23
  r.response.body.force_encoding(Encoding::UTF_8)
28
24
  end
data/yadisk.gemspec CHANGED
@@ -23,4 +23,12 @@ Gem::Specification.new do |s|
23
23
  s.add_dependency "addressable", "~> 2.3", ">= 2.3.7"
24
24
  s.add_dependency "faraday", "~> 1.7"
25
25
  s.add_dependency "faraday_middleware", "~> 1.1"
26
+
27
+ s.add_development_dependency "bundler"
28
+ s.add_development_dependency "rake", "~> 12.3.3"
29
+ s.add_development_dependency "rspec", "~> 3.0"
30
+ s.add_development_dependency "simplecov", "~> 0.9"
31
+ s.add_development_dependency "simplecov-lcov", "~> 0.7.0"
32
+ s.add_development_dependency "vcr", "~> 6.1"
33
+ s.add_development_dependency "webmock", "~> 3.18", ">= 3.18.1"
26
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yadisk-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.2
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Brin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-05 00:00:00.000000000 Z
11
+ date: 2022-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -58,12 +58,118 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '1.1'
61
+ - !ruby/object:Gem::Dependency
62
+ name: bundler
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rake
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 12.3.3
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 12.3.3
89
+ - !ruby/object:Gem::Dependency
90
+ name: rspec
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '3.0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '3.0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: simplecov
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '0.9'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '0.9'
117
+ - !ruby/object:Gem::Dependency
118
+ name: simplecov-lcov
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: 0.7.0
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: 0.7.0
131
+ - !ruby/object:Gem::Dependency
132
+ name: vcr
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '6.1'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '6.1'
145
+ - !ruby/object:Gem::Dependency
146
+ name: webmock
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '3.18'
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: 3.18.1
155
+ type: :development
156
+ prerelease: false
157
+ version_requirements: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - "~>"
160
+ - !ruby/object:Gem::Version
161
+ version: '3.18'
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: 3.18.1
61
165
  description: Yandex.Disk API wrapper written in Ruby
62
166
  email: ilya@codeplay.ru
63
167
  executables: []
64
168
  extensions: []
65
169
  extra_rdoc_files: []
66
170
  files:
171
+ - ".github/dependabot.yml"
172
+ - ".github/workflows/CI.yml"
67
173
  - ".gitignore"
68
174
  - ".rspec"
69
175
  - ".rubocop.yml"
@@ -91,32 +197,36 @@ files:
91
197
  - lib/yadisk/version.rb
92
198
  - spec/lib/yadisk/client_spec.rb
93
199
  - spec/lib/yadisk/disk_spec.rb
94
- - spec/lib/yadisk/errors_spec.rb
95
- - spec/lib/yadisk/operations_spec.rb
200
+ - spec/lib/yadisk/operation_spec.rb
96
201
  - spec/lib/yadisk/public_spec.rb
97
202
  - spec/lib/yadisk/trash_spec.rb
98
203
  - spec/spec_helper.rb
99
204
  - spec/support/cassette_helpers.rb
100
205
  - spec/test_data/test_file.txt
101
- - spec/vcr/disk/DELETE_delete.yml
102
- - spec/vcr/disk/ERROR_info.yml
103
- - spec/vcr/disk/GET_download.yml
104
- - spec/vcr/disk/GET_get_meta.yml
105
- - spec/vcr/disk/GET_info.yml
106
- - spec/vcr/disk/GET_list_public.yml
107
- - spec/vcr/disk/GET_upload.yml
108
- - spec/vcr/disk/PATCH_update_meta.yml
109
- - spec/vcr/disk/POST_copy.yml
110
- - spec/vcr/disk/POST_move.yml
111
- - spec/vcr/disk/POST_upload_by_url.yml
112
- - spec/vcr/disk/PUT_create_dir.yml
113
- - spec/vcr/disk/PUT_publish.yml
114
- - spec/vcr/disk/PUT_unpublish.yml
115
- - spec/vcr/operations/GET_status.yml
116
- - spec/vcr/trash/DELETE_delete.yml
117
- - spec/vcr/trash/DELETE_delete_error.yml
118
- - spec/vcr/trash/GET_list.yml
119
- - spec/vcr/trash/PUT_restore.yml
206
+ - spec/vcr/disk/copy.yml
207
+ - spec/vcr/disk/create_dir.yml
208
+ - spec/vcr/disk/create_dir_error_409.yml
209
+ - spec/vcr/disk/delete.yml
210
+ - spec/vcr/disk/download.yml
211
+ - spec/vcr/disk/get_meta.yml
212
+ - spec/vcr/disk/info.yml
213
+ - spec/vcr/disk/last_uploaded.yml
214
+ - spec/vcr/disk/list_files.yml
215
+ - spec/vcr/disk/list_public.yml
216
+ - spec/vcr/disk/move.yml
217
+ - spec/vcr/disk/publish.yml
218
+ - spec/vcr/disk/unpublish.yml
219
+ - spec/vcr/disk/update_meta.yml
220
+ - spec/vcr/disk/upload.yml
221
+ - spec/vcr/disk/upload_by_url.yml
222
+ - spec/vcr/disk/upload_from_file.yml
223
+ - spec/vcr/operation/status.yml
224
+ - spec/vcr/public/link.yml
225
+ - spec/vcr/public/meta.yml
226
+ - spec/vcr/public/save.yml
227
+ - spec/vcr/trash/delete.yml
228
+ - spec/vcr/trash/list.yml
229
+ - spec/vcr/trash/restore.yml
120
230
  - spec/vcr_setup.rb
121
231
  - yadisk.gemspec
122
232
  homepage: https://github.com/Smolget/yadisk