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
dcdcb83b
Commit
dcdcb83b
authored
Jun 29, 2011
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Honor umask. Thank you @sbfaulkner
Closes #214
parent
41bc6b4a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
+19
-1
lib/paperclip/storage/filesystem.rb
+1
-1
test/integration_test.rb
+18
-0
No files found.
lib/paperclip/storage/filesystem.rb
View file @
dcdcb83b
...
...
@@ -44,7 +44,7 @@ module Paperclip
FileUtils
.
cp
(
file
.
path
,
path
(
style_name
))
FileUtils
.
rm
(
file
.
path
)
end
FileUtils
.
chmod
(
06
44
,
path
(
style_name
))
FileUtils
.
chmod
(
06
66
&~
File
.
umask
,
path
(
style_name
))
end
@queued_for_write
=
{}
end
...
...
test/integration_test.rb
View file @
dcdcb83b
...
...
@@ -383,6 +383,24 @@ class IntegrationTest < Test::Unit::TestCase
assert_equal
"5k.png"
,
@dummy
.
avatar_file_name
end
[
000
,
002
,
022
].
each
do
|
umask
|
context
"when the umask is
#{
umask
}
"
do
setup
do
@umask
=
File
.
umask
umask
end
teardown
do
File
.
umask
@umask
end
should
"respect the current umask"
do
@dummy
.
avatar
=
@file
@dummy
.
save
assert_equal
0666
&~
umask
,
0666
&
File
.
stat
(
@dummy
.
avatar
.
path
).
mode
end
end
end
context
"that is assigned its file from another Paperclip attachment"
do
setup
do
@dummy2
=
Dummy
.
new
...
...
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