activestorage_upyun 0.3.0 → 0.4.0

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
2
  SHA256:
3
- metadata.gz: c680c39e020941f01c261047212c41150da91e13b77f15bd1aff293da29e8364
4
- data.tar.gz: ca532178dacc85e8bcee53c41aa839346e47a7d19ace9653ee54cc8b96af2c41
3
+ metadata.gz: 6a1a49cc2be589a8801185a27f87bfcab3fbf97299f1075d48d9bbba213ee68b
4
+ data.tar.gz: f19761541aef40916fab6b03cce9fdde46d9e56eceefb0a581421432fd16ecf5
5
5
  SHA512:
6
- metadata.gz: df0da59f40e289b381facf3c375b8c9cc772c7a9645b5d1a72ae39c0b13cf10d50983ff88c405ee620ac510962d4ce04392cd34be4fbb556334ae6a46df7aed3
7
- data.tar.gz: 7c1847ea2006b2ce278955ab4e2c20176f2d24053ac0e413a2902120a7118461118b40626825aad873c1f4727fdc34718118e289a07748043f896dc5fece258a
6
+ metadata.gz: 34bcc7fb8348dac77d6efb4e0b8b7197725efa56594f518bd0bdb43e44178497c6d166b04c1df5983276b96c0cb529bfe81dbb8d4db7175c155fdf533ff61083
7
+ data.tar.gz: 330afc7754b0a809e3f1c1bb32aa4a9b2a2ed8d56fa57c3f078e2e92faf32ce20c02ea3c67f48b80a281420fe2ea11af522eccfb75e5fdbde079fbef6102c029
@@ -63,6 +63,13 @@ module ActiveStorage
63
63
  end
64
64
  end
65
65
 
66
+ def download_chunk(key, range)
67
+ instrument :download_chunk, key: key, range: range do
68
+ range_end = range.exclude_end? ? range.end - 1 : range.end
69
+ @upyun.get(path_for(key), nil, headers: {range: "bytes=#{range.begin}-#{range_end}"})
70
+ end
71
+ end
72
+
66
73
  def exist?(key)
67
74
  instrument :exist, key: key do |payload|
68
75
  answer = upyun.getinfo(path_for(key))
@@ -1,3 +1,3 @@
1
1
  module ActivestorageUpyun
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage_upyun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - doabit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-10 00:00:00.000000000 Z
11
+ date: 2018-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activestorage