Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
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
Commits
defd4259
Commit
defd4259
authored
Mar 02, 2012
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove all the deprecated method
We've deprecate these method for a while, it's time to remove it.
parent
5dba614c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
71 deletions
+2
-71
lib/paperclip.rb
+2
-15
lib/paperclip/attachment.rb
+0
-12
test/integration_test.rb
+0
-44
No files found.
lib/paperclip.rb
View file @
defd4259
...
...
@@ -58,7 +58,6 @@ module Paperclip
# * command_path: Defines the path at which to find the command line
# programs if they are not visible to Rails the system's search path. Defaults to
# nil, which uses the first executable found in the user's search path.
# * image_magick_path: Deprecated alias of command_path.
def
options
@options
||=
{
:whiny
=>
true
,
...
...
@@ -93,10 +92,7 @@ module Paperclip
# :swallow_stderr -> Set to true if you don't care what happens on STDERR.
#
def
run
(
cmd
,
arguments
=
""
,
local_options
=
{})
if
options
[
:image_magick_path
]
Paperclip
.
log
(
"[DEPRECATION] :image_magick_path is deprecated and will be removed. Use :command_path instead"
)
end
command_path
=
options
[
:command_path
]
||
options
[
:image_magick_path
]
command_path
=
options
[
:command_path
]
Cocaine
::
CommandLine
.
path
=
(
Cocaine
::
CommandLine
.
path
?
[
Cocaine
::
CommandLine
.
path
,
command_path
].
flatten
:
command_path
)
local_options
=
local_options
.
merge
(
:logger
=>
logger
)
if
logging?
&&
(
options
[
:log_command
]
||
local_options
[
:log_command
])
Cocaine
::
CommandLine
.
new
(
cmd
,
arguments
,
local_options
).
run
...
...
@@ -272,8 +268,7 @@ module Paperclip
# Defaults to +false+.#
# * +whiny+: Will raise an error if Paperclip cannot post_process an uploaded file due
# to a command line error. This will override the global setting for this attachment.
# Defaults to true. This option used to be called :whiny_thumbanils, but this is
# deprecated.
# Defaults to true.
# * +convert_options+: When creating thumbnails, use this free-form options
# array to pass in various convert command options. Typical options are "-strip" to
# remove all Exif data from the image (save space for thumbnails and avatars) or
...
...
@@ -384,14 +379,6 @@ module Paperclip
:allow_nil
=>
true
end
# Adds errors if thumbnail creation fails. The same as specifying :whiny_thumbnails => true.
def
validates_attachment_thumbnails
name
,
options
=
{}
warn
(
'[DEPRECATION] validates_attachment_thumbnail is deprecated. '
+
'This validation is on by default and will be removed from future versions. '
+
'If you wish to turn it off, supply :whiny => false in your definition.'
)
attachment_definitions
[
name
][
:whiny_thumbnails
]
=
true
end
# Places ActiveRecord-style validations on the presence of a file.
# Options:
# * +if+: A lambda or name of an instance method. Validation will only
...
...
lib/paperclip/attachment.rb
View file @
defd4259
...
...
@@ -302,18 +302,6 @@ module Paperclip
end
end
# Paths and URLs can have a number of variables interpolated into them
# to vary the storage location based on name, id, style, class, etc.
# This method is a deprecated access into supplying and retrieving these
# interpolations. Future access should use either Paperclip.interpolates
# or extend the Paperclip::Interpolations module directly.
def
self
.
interpolations
warn
(
'[DEPRECATION] Paperclip::Attachment.interpolations is deprecated '
+
'and will be removed from future versions. '
+
'Use Paperclip.interpolates instead'
)
Paperclip
::
Interpolations
end
# This method really shouldn't be called that often. It's expected use is
# in the paperclip:refresh rake task and that's it. It will regenerate all
# thumbnails forcefully, by reobtaining the original file and going through
...
...
test/integration_test.rb
View file @
defd4259
...
...
@@ -223,48 +223,6 @@ class IntegrationTest < Test::Unit::TestCase
end
end
context
"A model with no attachment validation"
do
setup
do
rebuild_model
:styles
=>
{
:large
=>
"300x300>"
,
:medium
=>
"100x100"
,
:thumb
=>
[
"32x32#"
,
:gif
]
},
:default_style
=>
:medium
,
:url
=>
"/:attachment/:class/:style/:id/:basename.:extension"
,
:path
=>
":rails_root/tmp/:attachment/:class/:style/:id/:basename.:extension"
@dummy
=
Dummy
.
new
end
should
"have its definition return false when asked about whiny_thumbnails"
do
assert
!
Dummy
.
attachment_definitions
[
:avatar
][
:whiny_thumbnails
]
end
context
"when validates_attachment_thumbnails is called"
do
setup
do
Dummy
.
validates_attachment_thumbnails
:avatar
end
should
"have its definition return true when asked about whiny_thumbnails"
do
assert_equal
true
,
Dummy
.
attachment_definitions
[
:avatar
][
:whiny_thumbnails
]
end
end
context
"redefined to have attachment validations"
do
setup
do
rebuild_model
:styles
=>
{
:large
=>
"300x300>"
,
:medium
=>
"100x100"
,
:thumb
=>
[
"32x32#"
,
:gif
]
},
:whiny_thumbnails
=>
true
,
:default_style
=>
:medium
,
:url
=>
"/:attachment/:class/:style/:id/:basename.:extension"
,
:path
=>
":rails_root/tmp/:attachment/:class/:style/:id/:basename.:extension"
end
should
"have its definition return true when asked about whiny_thumbnails"
do
assert_equal
true
,
Dummy
.
attachment_definitions
[
:avatar
][
:whiny_thumbnails
]
end
end
end
context
"A model with no convert_options setting"
do
setup
do
rebuild_model
:styles
=>
{
:large
=>
"300x300>"
,
...
...
@@ -334,7 +292,6 @@ class IntegrationTest < Test::Unit::TestCase
rebuild_model
:styles
=>
{
:large
=>
"300x300>"
,
:medium
=>
"100x100"
,
:thumb
=>
[
"32x32#"
,
:gif
]
},
:whiny_thumbnails
=>
true
,
:default_style
=>
:medium
,
:url
=>
"/:attachment/:class/:style/:id/:basename.:extension"
,
:path
=>
":rails_root/tmp/:attachment/:class/:style/:id/:basename.:extension"
...
...
@@ -520,7 +477,6 @@ class IntegrationTest < Test::Unit::TestCase
:medium
=>
"100x100"
,
:thumb
=>
[
"32x32#"
,
:gif
]
},
:storage
=>
:s3
,
:whiny_thumbnails
=>
true
,
:s3_credentials
=>
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
"s3.yml"
)),
:default_style
=>
:medium
,
:bucket
=>
ENV
[
'S3_TEST_BUCKET'
],
...
...
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