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
219f1c58
Commit
219f1c58
authored
Jul 17, 2012
by
LI Daobing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove fix_path
parent
e1bd195a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
lib/paperclip/storage/qiniu.rb
+3
-8
No files found.
lib/paperclip/storage/qiniu.rb
View file @
219f1c58
...
@@ -46,7 +46,7 @@ module Paperclip
...
@@ -46,7 +46,7 @@ module Paperclip
def
flush_deletes
def
flush_deletes
init
init
for
path
in
@queued_for_delete
do
for
path
in
@queued_for_delete
do
::
Qiniu
::
RS
.
delete
(
bucket
,
fix_path
(
path
)
)
::
Qiniu
::
RS
.
delete
(
bucket
,
path
)
end
end
@queued_for_delete
=
[]
@queued_for_delete
=
[]
end
end
...
@@ -54,9 +54,9 @@ module Paperclip
...
@@ -54,9 +54,9 @@ module Paperclip
def
public_url
(
style
=
default_style
)
def
public_url
(
style
=
default_style
)
init
init
if
@options
[
:qiniu_host
]
if
@options
[
:qiniu_host
]
"
#{
dynamic_fog_host_for_style
(
style
)
}
/
#{
fix_path
(
path
(
style
)
)
}
"
"
#{
dynamic_fog_host_for_style
(
style
)
}
/
#{
path
(
style
)
}
"
else
else
res
=
::
Qiniu
::
RS
.
get
(
bucket
,
fix_path
(
path
(
style
)
))
res
=
::
Qiniu
::
RS
.
get
(
bucket
,
path
(
style
))
if
res
if
res
res
[
"url"
]
res
[
"url"
]
else
else
...
@@ -74,7 +74,6 @@ module Paperclip
...
@@ -74,7 +74,6 @@ module Paperclip
end
end
def
upload
(
file
,
path
)
def
upload
(
file
,
path
)
path
=
fix_path
(
path
)
remote_upload_url
=
::
Qiniu
::
RS
.
put_auth
remote_upload_url
=
::
Qiniu
::
RS
.
put_auth
opts
=
{
:url
=>
remote_upload_url
,
opts
=
{
:url
=>
remote_upload_url
,
:file
=>
file
.
path
,
:file
=>
file
.
path
,
...
@@ -98,10 +97,6 @@ module Paperclip
...
@@ -98,10 +97,6 @@ module Paperclip
@options
[
:qiniu_host
]
@options
[
:qiniu_host
]
end
end
end
end
def
fix_path
(
path
)
path
.
gsub
(
/^\//
,
''
)
end
end
end
end
end
end
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