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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 909b57103a53df47bb30daf06f36b572d9dfe274cba465e9a21ba9fae57d7e2b
4
- data.tar.gz: d1420ac6ca79918f0f424aa9f3216e92876e5109e8116c3221995cd903d49b1a
3
+ metadata.gz: 9c1c22dd977c524a6e7a582f57d07e49683148a098eb20d245f97dc5c9a36973
4
+ data.tar.gz: b8edc152a973e9ca48551689fc69515c3d779e7c6e1febcce16b48b8d8cec891
5
5
  SHA512:
6
- metadata.gz: dc30ba93963b6380a814552dcbfe556122fb6315ec7a3825aed595ac04c77838f38aeb65852fb922db6ff8fbed699243c1006d23316881622d989402d6487fbd
7
- data.tar.gz: 5f764c680865d71fa9c211566e2354d00a0ba2cf712292ff02ef69da1c39b7a7888ed25186f2e0f00d211eb245eaf3cb3875d6cd4c79ac2ac2f8cac9c9152b5b
6
+ metadata.gz: 47e491250e553325edec13a13980a305921165d87620c25f8de8193bda3ee5d860d7b3701561267e799546564c8993545774866071e982021b0348eb782110df
7
+ data.tar.gz: e866c571a0e0bfd15c05764854202688fb78613f9177a0fb15d3eb1f1bbe04296ee67bac42522c87dfebbdcb5222bedc8c5fff96fa9c345967ce295d3631d479
@@ -21,13 +21,12 @@ jobs:
21
21
  fail-fast: false
22
22
  matrix:
23
23
  ruby:
24
- - 2.5
25
- - 2.6
26
- - 2.7
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/rails_head.gemfile
29
+ - gemfiles/rails_70.gemfile
31
30
  runs-on: ubuntu-20.04
32
31
  steps:
33
32
  - uses: actions/checkout@v2
@@ -4,4 +4,3 @@ gem "rack-test"
4
4
  gem "webmock"
5
5
  gem "tapp"
6
6
  gem "sqlite3"
7
- gem "pretty_backtrace"
@@ -1,5 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
  gemspec path: '../'
3
3
 
4
- gem 'activerecord', '~> 5.2.0'
4
+ gem 'activerecord', '~> 7.0.0'
5
5
  eval_gemfile 'development.gemfile'
@@ -1,5 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
  gemspec path: '../'
3
3
 
4
- gem 'activerecord', git: "https://github.com/rails/rails", branch: :master
4
+ gem 'activerecord', git: "https://github.com/rails/rails", branch: :main
5
5
  eval_gemfile 'development.gemfile'
@@ -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.exists?(file_path(style))
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) })
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MiniPaperclip
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
@@ -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(">= 2.3.0")
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.3.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: 2021-01-20 00:00:00.000000000 Z
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: 2.3.0
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.1.4
162
+ rubygems_version: 3.2.33
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: MiniPaperclip is a mini paperclip