yandex-disk 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 94b6b93fa82493fec724772f534f1e6e5703ea18
4
- data.tar.gz: 3e2f77620f4468cdb8d989a70521f090dac10012
2
+ SHA256:
3
+ metadata.gz: 49c5fd34870aee8b6a9aabe8569786873e4af046de020a586ca2ec717ffa72ff
4
+ data.tar.gz: bf7021c848ae080d7750eb0008eb31d841694cbc92dcb777977e98bb6c67b790
5
5
  SHA512:
6
- metadata.gz: ea626f8d1fadb0f37c1e2516d9c1b2971dbd4eb1180224049f93bebed7cc0d429cf8b5578930733fa1283dcf015b216227748d1aba7e96c92ec9561c6de0acc7
7
- data.tar.gz: 69ba2c1d51420a294f16ab57e8b0b5c1d1ae9e8e3489e36ba5d26f23536d72763d929da5b994fa36309489abb98fe78e2cde982f3871bab262f4da430d27de4a
6
+ metadata.gz: 1b64347722911b99faaaacd9c834f0503b3806327dc85acdc63786b74ea7552515303966529982ee690947060f22190fcf57b4de9e8ff1a65e9188dc24aceab1
7
+ data.tar.gz: caea7c8100a03a8f4a039f612f3a877a5e42500cdb2993dd7e49e7e92f4ae978baca179edd3093f553f69a1deff9fa4c1c755e1e837d5efa223bb4f80c41b49f
data/README.md CHANGED
@@ -51,6 +51,9 @@ disk.delete('/path/to/remote/file/or/dir') # returns `true` if everything is ok
51
51
  # to make folder or file public
52
52
  disk.make_public('/path/to/remote/dir/or/file') # returns hash with public url `=> { :public_url => "https://yadi.sk/i/B98Qjxxx3S5QJc" }` if everything is ok
53
53
 
54
+ # to make folder or file private
55
+ disk.make_private('/path/to/remote/dir/or/file') # returns true if everything is ok
56
+
54
57
  # to get quotas
55
58
  disk.space # returns hash like { :quota_available_bytes => 2488943615, :quota_used_bytes => 2488943615 }
56
59
 
@@ -98,3 +101,4 @@ export YANDEX_DISK_TOKEN=e5d4aaa4ec2246558b510f7fef25b7b1
98
101
 
99
102
  - [@aishek (Alexandr Borisov)](https://github.com/aishek)
100
103
  - [@ilyario (Пономарев Илья)](https://github.com/ilyario)
104
+ - [@vivanov77](https://github.com/vivanov77)
@@ -5,6 +5,7 @@ module Backup
5
5
  module Storage
6
6
  module Yandex
7
7
  class Disk < Base
8
+ include Storage::Cycler
8
9
 
9
10
  attr_accessor :access_token
10
11
 
@@ -42,4 +43,4 @@ module Backup
42
43
  end
43
44
  end
44
45
  end
45
- end
46
+ end
@@ -69,6 +69,11 @@ module Yandex
69
69
  request.perform
70
70
  end
71
71
 
72
+ def make_private path
73
+ request = Request::Private.new(@http, path)
74
+ request.perform
75
+ end
76
+
72
77
  alias_method :mkdir, :mkcol
73
78
 
74
79
  def mkdir_p path
@@ -2,4 +2,5 @@ module Yandex::Disk::Client::Request
2
2
  autoload :Space, 'yandex/disk/client/request/space'
3
3
  autoload :List, 'yandex/disk/client/request/list'
4
4
  autoload :Publication, 'yandex/disk/client/request/publication'
5
- end
5
+ autoload :Private, 'yandex/disk/client/request/private'
6
+ end
@@ -0,0 +1,22 @@
1
+ class Yandex::Disk::Client::Request::Private
2
+ BODY =
3
+ '<propertyupdate xmlns="DAV:">
4
+ <set>
5
+ <prop>
6
+ <public_url xmlns="urn:yandex:disk:meta" />
7
+ </prop>
8
+ </set>
9
+ </propertyupdate>'
10
+ HEADERS = {
11
+ }
12
+
13
+ def initialize http, path
14
+ @http = http
15
+ @path = path
16
+ end
17
+
18
+ def perform
19
+ @http.run_request :proppatch, @path, BODY, HEADERS
20
+ true
21
+ end
22
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yandex
4
4
  module Disk
5
- VERSION = '0.0.8'
5
+ VERSION = '0.0.9'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yandex-disk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Korolev
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-26 00:00:00.000000000 Z
12
+ date: 2018-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -113,6 +113,7 @@ files:
113
113
  - lib/yandex/disk/client.rb
114
114
  - lib/yandex/disk/client/request.rb
115
115
  - lib/yandex/disk/client/request/list.rb
116
+ - lib/yandex/disk/client/request/private.rb
116
117
  - lib/yandex/disk/client/request/publication.rb
117
118
  - lib/yandex/disk/client/request/space.rb
118
119
  - lib/yandex/disk/version.rb
@@ -138,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
139
  version: '0'
139
140
  requirements: []
140
141
  rubyforge_project:
141
- rubygems_version: 2.5.2
142
+ rubygems_version: 2.7.6
142
143
  signing_key:
143
144
  specification_version: 4
144
145
  summary: Ruby client for Yandex.Disk with backup gem support