yandex_client 1.0.1 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a211416fcc989ba097fb90416dd31415137ef6c0a20ad56b4df5ea3e5a3a83e9
4
- data.tar.gz: d470d0894fafe9464b54ab8274d82c3a9272e8108b2189387525079a1b2698ae
3
+ metadata.gz: e8b82741c31dd638b0ff6793b208d6c7ab33e9b5dc613f6c9ffd3482fb5dcde3
4
+ data.tar.gz: 510f836e9b6566ba397342544c9430232f7c88a39607261450d413c82b998367
5
5
  SHA512:
6
- metadata.gz: 2c1d214066d1d32b0d636727b6fb648cfc054018ba3fe069fbd942452c52a35e6997de816f8d237597dafa80245bc6b6442bc9efe77293383539a535e52d97f1
7
- data.tar.gz: fe3e3b361aef6101a150b00b9fb833bb72040d95c1598f89490c502aa3bb6ccf94c8797f7008928e3ad07239eff1fb91a3e6a6f53f649132955fe81f161d8fc1
6
+ metadata.gz: 91e69d64b589fc868bb0bc18956cb81c85031e6f4bef8ffd8619a2578f1f5f4e269635b11d818f801230b0e7c0b491a6cd55a7a98bcab1cb6021e92d49f7f677
7
+ data.tar.gz: 2fff713b5cc2fe4dae297347edb3a54d4ee93c31d233d1406ad61a8d2f76ec1792c7693e5c56422b2f9a4011131c5d49454c4d9c3f44c0040d08f490298ad005
data/.rubocop.yml CHANGED
@@ -34,3 +34,6 @@ Metrics/BlockLength:
34
34
 
35
35
  Gemspec/RequiredRubyVersion:
36
36
  Enabled: false
37
+
38
+ Gemspec/RequireMFA:
39
+ Enabled: false
data/README.md CHANGED
@@ -42,6 +42,7 @@ https://yandex.ru/dev/disk/api/reference/content-docpage/
42
42
  ```ruby
43
43
  YandexClient::Disk['access_token'].info
44
44
  YandexClient::Disk['access_token'].download_url('path/to/file')
45
+ YandexClient::Disk['access_token'].upload_url('path/to/file')
45
46
  ```
46
47
 
47
48
  ## Auth
@@ -8,6 +8,7 @@ module YandexClient
8
8
  #
9
9
  # YandexClient::Disk[access_token].info
10
10
  # YandexClient::Disk[access_token].download_url('path/to/file')
11
+ # YandexClient::Disk[access_token].download_url('path/to/file', overwrite: false)
11
12
  class Disk
12
13
  include Configurable
13
14
  include ErrorHandler
@@ -45,6 +46,17 @@ module YandexClient
45
46
  ).fetch(:href)
46
47
  end
47
48
 
49
+ def upload_url(path, overwrite: false)
50
+ url = URI.parse(ACTION_URL).tap do |uri|
51
+ uri.path = '/v1/disk/resources/upload'
52
+ uri.query = URI.encode_www_form(path: ::CGI.escape(path), overwrite: overwrite)
53
+ end
54
+
55
+ process_response(
56
+ with_config.get(url, headers: auth_headers)
57
+ ).fetch(:href)
58
+ end
59
+
48
60
  private
49
61
 
50
62
  def auth_headers
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YandexClient
4
- VERSION = '1.0.1'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yandex_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxim Tretyakov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-27 00:00:00.000000000 Z
11
+ date: 2021-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -158,7 +158,7 @@ homepage: https://github.com/yamax2/yandex_client
158
158
  licenses:
159
159
  - MIT
160
160
  metadata: {}
161
- post_install_message:
161
+ post_install_message:
162
162
  rdoc_options: []
163
163
  require_paths:
164
164
  - lib
@@ -173,8 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  requirements: []
176
- rubygems_version: 3.2.26
177
- signing_key:
176
+ rubygems_version: 3.2.5
177
+ signing_key:
178
178
  specification_version: 4
179
179
  summary: Yandex Client
180
180
  test_files: []