shrine-memory 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shrine/storage/memory.rb +0 -21
- data/shrine-memory.gemspec +2 -3
- metadata +5 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 412e656844c36825189ce0202b7af2f02a3e9b2b
|
4
|
+
data.tar.gz: '0048afa50c74e1c2dd48684d915060ca6b81d14d'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5a91a061903716b72c289c15009c3a156ba159e5aaffe54b523ee0b82f35770350f294eaa8571a1923a47698d141fa4453dde620ff3b5c5f38f06b62c8f655d
|
7
|
+
data.tar.gz: 33827892fe52b16261c55e622c6eaa88123a3d256defc3e4801f8600606caba7c47ac63b9326cc15424cc3047df8360c10639b0fae9671c987c69acae6a04df5
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require "shrine"
|
2
2
|
require "stringio"
|
3
|
-
require "down"
|
4
3
|
|
5
4
|
class Shrine
|
6
5
|
module Storage
|
@@ -15,26 +14,10 @@ class Shrine
|
|
15
14
|
store[id] = io.read
|
16
15
|
end
|
17
16
|
|
18
|
-
def download(id)
|
19
|
-
Down.copy_to_tempfile(id, open(id))
|
20
|
-
end
|
21
|
-
|
22
|
-
def move(io, id, *)
|
23
|
-
store[id] = io.storage.delete(io.id)
|
24
|
-
end
|
25
|
-
|
26
|
-
def movable?(io, id)
|
27
|
-
io.is_a?(UploadedFile) && io.storage.is_a?(Storage::Memory)
|
28
|
-
end
|
29
|
-
|
30
17
|
def open(id)
|
31
18
|
StringIO.new(store.fetch(id))
|
32
19
|
end
|
33
20
|
|
34
|
-
def read(id)
|
35
|
-
store.fetch(id).dup
|
36
|
-
end
|
37
|
-
|
38
21
|
def exists?(id)
|
39
22
|
store.key?(id)
|
40
23
|
end
|
@@ -43,10 +26,6 @@ class Shrine
|
|
43
26
|
store.delete(id)
|
44
27
|
end
|
45
28
|
|
46
|
-
def multi_delete(ids)
|
47
|
-
ids.each { |id| delete(id) }
|
48
|
-
end
|
49
|
-
|
50
29
|
def url(id, **options)
|
51
30
|
"memory://#{id}"
|
52
31
|
end
|
data/shrine-memory.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = "shrine-memory"
|
3
|
-
gem.version = "0.
|
3
|
+
gem.version = "0.3.0"
|
4
4
|
|
5
5
|
gem.required_ruby_version = ">= 2.1"
|
6
6
|
|
@@ -13,8 +13,7 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.files = Dir["README.md", "LICENSE.txt", "lib/**/*.rb", "*.gemspec"]
|
14
14
|
gem.require_path = "lib"
|
15
15
|
|
16
|
-
gem.add_dependency "shrine", "~> 2.
|
17
|
-
gem.add_dependency "down"
|
16
|
+
gem.add_dependency "shrine", "~> 2.2"
|
18
17
|
|
19
18
|
gem.add_development_dependency "rake"
|
20
19
|
gem.add_development_dependency "minitest"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shrine-memory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shrine
|
@@ -16,28 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: down
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
26
|
+
version: '2.2'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -97,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
83
|
version: '0'
|
98
84
|
requirements: []
|
99
85
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
86
|
+
rubygems_version: 2.6.11
|
101
87
|
signing_key:
|
102
88
|
specification_version: 4
|
103
89
|
summary: Provides in-memory storage for Shrine.
|