mini_paperclip 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 +4 -4
- data/.github/workflows/ci.yml +4 -5
- data/gemfiles/development.gemfile +0 -1
- data/gemfiles/{rails_52.gemfile → rails_70.gemfile} +1 -1
- data/gemfiles/rails_head.gemfile +1 -1
- data/lib/mini_paperclip/attachment.rb +2 -1
- data/lib/mini_paperclip/storage/filesystem.rb +3 -1
- data/lib/mini_paperclip/storage/s3.rb +2 -0
- data/lib/mini_paperclip/version.rb +1 -1
- data/mini_paperclip.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c1c22dd977c524a6e7a582f57d07e49683148a098eb20d245f97dc5c9a36973
|
4
|
+
data.tar.gz: b8edc152a973e9ca48551689fc69515c3d779e7c6e1febcce16b48b8d8cec891
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47e491250e553325edec13a13980a305921165d87620c25f8de8193bda3ee5d860d7b3701561267e799546564c8993545774866071e982021b0348eb782110df
|
7
|
+
data.tar.gz: e866c571a0e0bfd15c05764854202688fb78613f9177a0fb15d3eb1f1bbe04296ee67bac42522c87dfebbdcb5222bedc8c5fff96fa9c345967ce295d3631d479
|
data/.github/workflows/ci.yml
CHANGED
@@ -21,13 +21,12 @@ jobs:
|
|
21
21
|
fail-fast: false
|
22
22
|
matrix:
|
23
23
|
ruby:
|
24
|
-
-
|
25
|
-
-
|
26
|
-
- 2
|
24
|
+
- 3.0
|
25
|
+
- 3.1
|
26
|
+
- 3.2
|
27
27
|
gemfile:
|
28
|
-
- gemfiles/rails_52.gemfile
|
29
28
|
- gemfiles/rails_60.gemfile
|
30
|
-
- gemfiles/
|
29
|
+
- gemfiles/rails_70.gemfile
|
31
30
|
runs-on: ubuntu-20.04
|
32
31
|
steps:
|
33
32
|
- uses: actions/checkout@v2
|
data/gemfiles/rails_head.gemfile
CHANGED
@@ -46,6 +46,7 @@ module MiniPaperclip
|
|
46
46
|
def exists?(style = :original)
|
47
47
|
file? && @storage.exists?(style)
|
48
48
|
end
|
49
|
+
alias_method :exist?, :exists?
|
49
50
|
|
50
51
|
def url(style = :original)
|
51
52
|
@storage.url_for_read(style)
|
@@ -125,7 +126,7 @@ module MiniPaperclip
|
|
125
126
|
if !@config.keep_old_files
|
126
127
|
do_delete_files
|
127
128
|
end
|
128
|
-
|
129
|
+
|
129
130
|
ensure
|
130
131
|
if @waiting_write_file.respond_to?(:close!)
|
131
132
|
@waiting_write_file.close!
|
@@ -8,6 +8,7 @@ module MiniPaperclip
|
|
8
8
|
debug("writing by filesystem from:#{file.path} to:#{path}")
|
9
9
|
FileUtils.mkdir_p(File.dirname(path))
|
10
10
|
FileUtils.cp(file.path, path) if file.path != path
|
11
|
+
@deletes.delete(path) # cancel deletion if overwrite
|
11
12
|
end
|
12
13
|
|
13
14
|
def file_path(style)
|
@@ -19,8 +20,9 @@ module MiniPaperclip
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def exists?(style)
|
22
|
-
File.
|
23
|
+
File.exist?(file_path(style))
|
23
24
|
end
|
25
|
+
alias_method :exist?, :exists?
|
24
26
|
|
25
27
|
def push_delete_file(style)
|
26
28
|
@deletes.push(file_path(style))
|
@@ -13,6 +13,7 @@ module MiniPaperclip
|
|
13
13
|
bucket: @config.s3_bucket_name,
|
14
14
|
key: s3_object_key(style),
|
15
15
|
)
|
16
|
+
@deletes.delete({ key: s3_object_key(style) }) # cancel deletion if overwrite
|
16
17
|
end
|
17
18
|
|
18
19
|
def s3_object_key(style)
|
@@ -33,6 +34,7 @@ module MiniPaperclip
|
|
33
34
|
rescue Aws::S3::Errors::NotFound
|
34
35
|
false
|
35
36
|
end
|
37
|
+
alias_method :exist?, :exists?
|
36
38
|
|
37
39
|
def push_delete_file(style)
|
38
40
|
@deletes.push({ key: s3_object_key(style) })
|
data/mini_paperclip.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.description = %q{Subset from paperclip because paperclip has deprecated}
|
11
11
|
spec.homepage = "https://github.com/reproio/mini_paperclip"
|
12
12
|
spec.license = "MIT"
|
13
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
14
14
|
|
15
15
|
spec.add_runtime_dependency "mini_magick"
|
16
16
|
spec.add_runtime_dependency "mimemagic"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_paperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ksss
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_magick
|
@@ -112,8 +112,8 @@ files:
|
|
112
112
|
- bin/console
|
113
113
|
- bin/setup
|
114
114
|
- gemfiles/development.gemfile
|
115
|
-
- gemfiles/rails_52.gemfile
|
116
115
|
- gemfiles/rails_60.gemfile
|
116
|
+
- gemfiles/rails_70.gemfile
|
117
117
|
- gemfiles/rails_head.gemfile
|
118
118
|
- lib/mini_paperclip.rb
|
119
119
|
- lib/mini_paperclip/attachment.rb
|
@@ -152,14 +152,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
152
|
requirements:
|
153
153
|
- - ">="
|
154
154
|
- !ruby/object:Gem::Version
|
155
|
-
version:
|
155
|
+
version: 3.0.0
|
156
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
158
|
- - ">="
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
|
-
rubygems_version: 3.
|
162
|
+
rubygems_version: 3.2.33
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: MiniPaperclip is a mini paperclip
|