Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip-qiniu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip-qiniu
Commits
1bbdc0dd
Commit
1bbdc0dd
authored
Jul 13, 2012
by
LI Daobing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete works
parent
c8e41f90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
lib/paperclip/storage/qiniu.rb
+4
-7
No files found.
lib/paperclip/storage/qiniu.rb
View file @
1bbdc0dd
...
...
@@ -54,11 +54,8 @@ module Paperclip
AWS_BUCKET_SUBDOMAIN_RESTRICTON_REGEX
=
/^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/
def
exists?
(
style
=
default_style
)
if
original_filename
!!
directory
.
files
.
head
(
path
(
style
))
else
false
end
init
!!::
Qiniu
::
RS
.
stat
(
bucket
,
path
(
style
))
end
def
fog_credentials
...
...
@@ -92,9 +89,9 @@ module Paperclip
end
def
flush_deletes
init
for
path
in
@queued_for_delete
do
log
(
"deleting
#{
path
}
"
)
directory
.
files
.
new
(
:key
=>
path
).
destroy
::
Qiniu
::
RS
.
delete
(
bucket
,
path
)
end
@queued_for_delete
=
[]
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment