box-com 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/box/file.rb +6 -2
  3. data/lib/box/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f53059226cce98c963e0386eade4b27a93907cc
4
- data.tar.gz: 3be5baad4099a164f7f761601f8af20812979cb2
3
+ metadata.gz: b0e7775f29f7d79e5a2ca9e1bc6964b31d497744
4
+ data.tar.gz: 472028239d191501d78a970f8515bc79e1a3197d
5
5
  SHA512:
6
- metadata.gz: 67ce44bff92f596ca67b640a44f92ea14848b2ddcfefdf0f9154e1290b8848fe0e789e6e4c54bebb976aadc6bff79a6dd7c75f4b9460faa66dc631b19a0e4a8c
7
- data.tar.gz: f6ecea124d711dbe688507c2e285bf21410e66f48822794ff636339a0c43937f8425c967d084d25ae60426c34477e6b342693cf128c14ba39f008a57a6354b49
6
+ metadata.gz: 146b0e733fc5f647a88eda18238562d89b10f9c23783783d1091b4d8771dd9719e302c4886e3e2259f2fbce7c33ff8af772f12c35c30e7ac566cd956639d1c18
7
+ data.tar.gz: 4c7232d8b42fd37d7e6c46e2e1f766686d43124f4aa6e21949f9430bef654cc9725ab1f0f96aa5671e499c5595bd1fead4ef6c61ef085dc18f5b35c8566b8d58
@@ -2,13 +2,17 @@ module Box
2
2
  class File < Item
3
3
  def_delegators :@metadata, :sha1, :name, :size, :etag, :parent
4
4
 
5
- def self.download_uri(id)
6
- response = Box.client.get("/files/#{id}/content")
5
+ def self.download_uri(id, client = Box.client)
6
+ response = client.get("/files/#{id}/content")
7
7
  uri = nil
8
8
  uri = response.headers['location'] if response.status == 302
9
9
  uri
10
10
  end
11
11
 
12
+ def download_uri
13
+ self.class.download_uri(self.id)
14
+ end
15
+
12
16
  def size
13
17
  @metadata['size']
14
18
  end
@@ -1,3 +1,3 @@
1
1
  module Box
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: box-com
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Michael
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
11
+ date: 2014-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler