b2-client 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/b2/connection.rb +7 -1
- data/lib/b2/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0be79261fee4bcca3e1ba5a8dbe172bc505d38a35b79a0b3e25f81de26a900a
|
4
|
+
data.tar.gz: 593efe787fb433de833a8acb964f470ee9f5bc27c71b6ada97af1284e9d955e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8eb2b33f95494b125c0397de1355063b256c420a717ca4eb0ffd0772f815afd2e094d8dbb7ab22904ef8f7ac651a5e019aa19137e3127a46fa1b6e97982d60d7
|
7
|
+
data.tar.gz: 5505cb044eba0400384f2d072fa079bd7adfa8a5a3826719825644ab819d8945f5966cbc69f6485214cddc81a9f8890fbc2b79c72f2e0c110f9418ef474f91bf
|
data/lib/b2/connection.rb
CHANGED
@@ -84,6 +84,7 @@ class B2
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def download(bucket, key, to=nil, &block)
|
87
|
+
opened_file = (to && to.is_a?(String))
|
87
88
|
to = ::File.open(to, 'wb') if to.is_a?(String)
|
88
89
|
digestor = Digest::SHA1.new
|
89
90
|
data = ""
|
@@ -117,7 +118,12 @@ class B2
|
|
117
118
|
end
|
118
119
|
end
|
119
120
|
end
|
120
|
-
|
121
|
+
|
122
|
+
if opened_file
|
123
|
+
to.close
|
124
|
+
elsif to
|
125
|
+
to.flush
|
126
|
+
end
|
121
127
|
block.nil? && to.nil? ? data : nil
|
122
128
|
end
|
123
129
|
|
data/lib/b2/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
VERSION = '1.0.
|
1
|
+
class B2
|
2
|
+
VERSION = '1.0.2'
|
3
3
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: b2-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Bracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|