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
58671ebf
Commit
58671ebf
authored
Feb 15, 2012
by
Chris Apolzon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Paperclip#run now respects swallow_stderr setting. Fix for #741
parent
f19393cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
lib/paperclip.rb
+1
-0
test/paperclip_test.rb
+13
-0
No files found.
lib/paperclip.rb
View file @
58671ebf
...
@@ -99,6 +99,7 @@ module Paperclip
...
@@ -99,6 +99,7 @@ module Paperclip
command_path
=
options
[
:command_path
]
||
options
[
:image_magick_path
]
command_path
=
options
[
:command_path
]
||
options
[
:image_magick_path
]
Cocaine
::
CommandLine
.
path
=
(
Cocaine
::
CommandLine
.
path
?
[
Cocaine
::
CommandLine
.
path
,
command_path
].
flatten
:
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
])
local_options
=
local_options
.
merge
(
:logger
=>
logger
)
if
logging?
&&
(
options
[
:log_command
]
||
local_options
[
:log_command
])
local_options
=
local_options
.
merge
(
:swallow_stderr
=>
options
[
:swallow_stderr
])
if
!
local_options
[
:swallow_stderr
]
&&
!
options
[
:swallow_stderr
].
nil?
Cocaine
::
CommandLine
.
new
(
cmd
,
arguments
,
local_options
).
run
Cocaine
::
CommandLine
.
new
(
cmd
,
arguments
,
local_options
).
run
end
end
...
...
test/paperclip_test.rb
View file @
58671ebf
...
@@ -4,6 +4,7 @@ class PaperclipTest < Test::Unit::TestCase
...
@@ -4,6 +4,7 @@ class PaperclipTest < Test::Unit::TestCase
context
"Calling Paperclip.run"
do
context
"Calling Paperclip.run"
do
setup
do
setup
do
Paperclip
.
options
[
:log_command
]
=
false
Paperclip
.
options
[
:log_command
]
=
false
Paperclip
.
options
[
:swallow_stderr
]
=
nil
Cocaine
::
CommandLine
.
expects
(
:new
).
with
(
"convert"
,
"stuff"
,
{}).
returns
(
stub
(
:run
))
Cocaine
::
CommandLine
.
expects
(
:new
).
with
(
"convert"
,
"stuff"
,
{}).
returns
(
stub
(
:run
))
@original_command_line_path
=
Cocaine
::
CommandLine
.
path
@original_command_line_path
=
Cocaine
::
CommandLine
.
path
end
end
...
@@ -22,6 +23,18 @@ class PaperclipTest < Test::Unit::TestCase
...
@@ -22,6 +23,18 @@ class PaperclipTest < Test::Unit::TestCase
Paperclip
.
run
(
"convert"
,
"stuff"
)
Paperclip
.
run
(
"convert"
,
"stuff"
)
assert_equal
[
Cocaine
::
CommandLine
.
path
].
flatten
.
include?
(
"/opt/my_app/bin"
),
true
assert_equal
[
Cocaine
::
CommandLine
.
path
].
flatten
.
include?
(
"/opt/my_app/bin"
),
true
end
end
should
"respect Paperclip.options[:swallow_stderr]"
do
Paperclip
.
options
[
:swallow_stderr
]
=
false
Cocaine
::
CommandLine
.
unstub
(
:new
)
Cocaine
::
CommandLine
.
expects
(
:new
).
with
(
"convert"
,
"stuff"
,
{
:swallow_stderr
=>
false
}).
returns
(
stub
(
:run
))
Paperclip
.
run
(
"convert"
,
"stuff"
)
Paperclip
.
options
[
:swallow_stderr
]
=
true
Cocaine
::
CommandLine
.
unstub
(
:new
)
Cocaine
::
CommandLine
.
expects
(
:new
).
with
(
"convert"
,
"stuff"
,
{
:swallow_stderr
=>
true
}).
returns
(
stub
(
:run
))
Paperclip
.
run
(
"convert"
,
"stuff"
)
end
end
end
context
"Calling Paperclip.run with a logger"
do
context
"Calling Paperclip.run with a logger"
do
...
...
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