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
3f2b0c0e
Commit
3f2b0c0e
authored
Apr 13, 2010
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Except for a few failing tests, this seems to be working.
parent
933dc7bd
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
13 deletions
+15
-13
Rakefile
+1
-0
lib/paperclip/attachment.rb
+1
-1
lib/paperclip/iostream.rb
+1
-1
paperclip.gemspec
+10
-9
test/attachment_test.rb
+1
-1
test/iostream_test.rb
+1
-1
No files found.
Rakefile
View file @
3f2b0c0e
...
@@ -65,6 +65,7 @@ spec = Gem::Specification.new do |s|
...
@@ -65,6 +65,7 @@ spec = Gem::Specification.new do |s|
s
.
author
=
"Jon Yurek"
s
.
author
=
"Jon Yurek"
s
.
email
=
"jyurek@thoughtbot.com"
s
.
email
=
"jyurek@thoughtbot.com"
s
.
homepage
=
"http://www.thoughtbot.com/projects/paperclip"
s
.
homepage
=
"http://www.thoughtbot.com/projects/paperclip"
s
.
description
=
"Easy upload management for ActiveRecord"
s
.
platform
=
Gem
::
Platform
::
RUBY
s
.
platform
=
Gem
::
Platform
::
RUBY
s
.
summary
=
"File attachments as attributes for ActiveRecord"
s
.
summary
=
"File attachments as attributes for ActiveRecord"
s
.
files
=
FileList
[
include_file_globs
].
to_a
-
FileList
[
exclude_file_globs
].
to_a
s
.
files
=
FileList
[
include_file_globs
].
to_a
-
FileList
[
exclude_file_globs
].
to_a
...
...
lib/paperclip/attachment.rb
View file @
3f2b0c0e
...
@@ -291,7 +291,7 @@ module Paperclip
...
@@ -291,7 +291,7 @@ module Paperclip
end
end
def
callback
which
#:nodoc:
def
callback
which
#:nodoc:
instance
.
run_callbacks
(
which
,
@queued_for_write
)
{
|
result
,
obj
|
result
==
false
}
instance
.
run_callbacks
(
which
,
@queued_for_write
)
end
end
def
post_process_styles
#:nodoc:
def
post_process_styles
#:nodoc:
...
...
lib/paperclip/iostream.rb
View file @
3f2b0c0e
...
@@ -5,7 +5,7 @@ module IOStream
...
@@ -5,7 +5,7 @@ module IOStream
# Returns a Tempfile containing the contents of the readable object.
# Returns a Tempfile containing the contents of the readable object.
def
to_tempfile
def
to_tempfile
name
=
respond_to?
(
:original_filename
)
?
original_filename
:
(
respond_to?
(
:path
)
?
path
:
"stream"
)
name
=
respond_to?
(
:original_filename
)
?
original_filename
:
(
respond_to?
(
:path
)
?
path
:
"stream"
)
tempfile
=
Paperclip
::
Tempfile
.
new
(
File
.
base
name
(
name
))
tempfile
=
Paperclip
::
Tempfile
.
new
(
"stream"
+
File
.
ext
name
(
name
))
tempfile
.
binmode
tempfile
.
binmode
self
.
stream_to
(
tempfile
)
self
.
stream_to
(
tempfile
)
end
end
...
...
paperclip.gemspec
View file @
3f2b0c0e
...
@@ -6,16 +6,17 @@ Gem::Specification.new do |s|
...
@@ -6,16 +6,17 @@ Gem::Specification.new do |s|
s
.
required_rubygems_version
=
Gem
::
Requirement
.
new
(
">= 0"
)
if
s
.
respond_to?
:required_rubygems_version
=
s
.
required_rubygems_version
=
Gem
::
Requirement
.
new
(
">= 0"
)
if
s
.
respond_to?
:required_rubygems_version
=
s
.
authors
=
[
"Jon Yurek"
]
s
.
authors
=
[
"Jon Yurek"
]
s
.
date
=
%q{2009-10-09}
s
.
date
=
%q{2010-03-25}
s
.
description
=
%q{Easy upload management for ActiveRecord}
s
.
email
=
%q{jyurek@thoughtbot.com}
s
.
email
=
%q{jyurek@thoughtbot.com}
s
.
extra_rdoc_files
=
[
"README.rdoc"
]
s
.
extra_rdoc_files
=
[
"README.rdoc"
]
s
.
files
=
[
"README.rdoc"
,
"LICENSE"
,
"Rakefile"
,
"init.rb"
,
"generators/paperclip"
,
"generators/paperclip/paperclip_generator.rb"
,
"generators/paperclip/templates"
,
"generators/paperclip/templates/paperclip_migration.rb.erb"
,
"generators/paperclip/USAGE"
,
"lib/paperclip"
,
"lib/paperclip/attachment.rb"
,
"lib/paperclip/callback_compatability.rb"
,
"lib/paperclip/geometry.rb"
,
"lib/paperclip/interpolations.rb"
,
"lib/paperclip/iostream.rb"
,
"lib/paperclip/matchers"
,
"lib/paperclip/matchers/have_attached_file_matcher.rb"
,
"lib/paperclip/matchers/validate_attachment_content_type_matcher.rb"
,
"lib/paperclip/matchers/validate_attachment_presence_matcher.rb"
,
"lib/paperclip/matchers/validate_attachment_size_matcher.rb"
,
"lib/paperclip/matchers.rb"
,
"lib/paperclip/processor.rb"
,
"lib/paperclip/storage.rb"
,
"lib/paperclip/
thumbnail.rb"
,
"lib/paperclip/upfile.rb"
,
"lib/paperclip.rb"
,
"tasks/paperclip_tasks.rake"
,
"test/attachment_test.rb"
,
"test/database.yml"
,
"test/fixtures"
,
"test/fixtures/12k.png"
,
"test/fixtures/50x50.png"
,
"test/fixtures/5k.png"
,
"test/fixtures/bad.png"
,
"test/fixtures/s3.yml"
,
"test/fixtures/text.txt"
,
"test/fixtures/twopage.pdf"
,
"test/geometry_test.rb"
,
"test/helper.rb"
,
"test/integration_test.rb"
,
"test/interpolations_test.rb"
,
"test/iostream_test.rb"
,
"test/matchers"
,
"test/matchers/have_attached_file_matcher_test.rb"
,
"test/matchers/validate_attachment_content_type_matcher_test.rb"
,
"test/matchers/validate_attachment_presence_matcher_test.rb"
,
"test/matchers/validate_attachment_size_matcher_test.rb"
,
"test/paperclip_test.rb"
,
"test/processor_test.rb"
,
"test/storag
e_test.rb"
,
"test/thumbnail_test.rb"
,
"test/upfile_test.rb"
,
"shoulda_macros/paperclip.rb"
]
s
.
files
=
[
"README.rdoc"
,
"LICENSE"
,
"Rakefile"
,
"init.rb"
,
"generators/paperclip"
,
"generators/paperclip/paperclip_generator.rb"
,
"generators/paperclip/templates"
,
"generators/paperclip/templates/paperclip_migration.rb.erb"
,
"generators/paperclip/USAGE"
,
"lib/paperclip"
,
"lib/paperclip/attachment.rb"
,
"lib/paperclip/callback_compatability.rb"
,
"lib/paperclip/geometry.rb"
,
"lib/paperclip/interpolations.rb"
,
"lib/paperclip/iostream.rb"
,
"lib/paperclip/matchers"
,
"lib/paperclip/matchers/have_attached_file_matcher.rb"
,
"lib/paperclip/matchers/validate_attachment_content_type_matcher.rb"
,
"lib/paperclip/matchers/validate_attachment_presence_matcher.rb"
,
"lib/paperclip/matchers/validate_attachment_size_matcher.rb"
,
"lib/paperclip/matchers.rb"
,
"lib/paperclip/processor.rb"
,
"lib/paperclip/storage.rb"
,
"lib/paperclip/
style.rb"
,
"lib/paperclip/thumbnail.rb"
,
"lib/paperclip/upfile.rb"
,
"lib/paperclip.rb"
,
"tasks/paperclip_tasks.rake"
,
"test/attachment_test.rb"
,
"test/database.yml"
,
"test/fixtures"
,
"test/fixtures/12k.png"
,
"test/fixtures/50x50.png"
,
"test/fixtures/5k.png"
,
"test/fixtures/bad.png"
,
"test/fixtures/s3.yml"
,
"test/fixtures/text.txt"
,
"test/fixtures/twopage.pdf"
,
"test/geometry_test.rb"
,
"test/helper.rb"
,
"test/integration_test.rb"
,
"test/interpolations_test.rb"
,
"test/iostream_test.rb"
,
"test/matchers"
,
"test/matchers/have_attached_file_matcher_test.rb"
,
"test/matchers/validate_attachment_content_type_matcher_test.rb"
,
"test/matchers/validate_attachment_presence_matcher_test.rb"
,
"test/matchers/validate_attachment_size_matcher_test.rb"
,
"test/paperclip_test.rb"
,
"test/processor_test.rb"
,
"test/storage_test.rb"
,
"test/styl
e_test.rb"
,
"test/thumbnail_test.rb"
,
"test/upfile_test.rb"
,
"shoulda_macros/paperclip.rb"
]
s
.
homepage
=
%q{http://www.thoughtbot.com/projects/paperclip}
s
.
homepage
=
%q{http://www.thoughtbot.com/projects/paperclip}
s
.
rdoc_options
=
[
"--line-numbers"
,
"--inline-source"
]
s
.
rdoc_options
=
[
"--line-numbers"
,
"--inline-source"
]
s
.
require_paths
=
[
"lib"
]
s
.
require_paths
=
[
"lib"
]
s
.
requirements
=
[
"ImageMagick"
]
s
.
requirements
=
[
"ImageMagick"
]
s
.
rubyforge_project
=
%q{paperclip}
s
.
rubyforge_project
=
%q{paperclip}
s
.
rubygems_version
=
%q{1.3.
5
}
s
.
rubygems_version
=
%q{1.3.
6
}
s
.
summary
=
%q{File attachments as attributes for ActiveRecord}
s
.
summary
=
%q{File attachments as attributes for ActiveRecord}
if
s
.
respond_to?
:specification_version
then
if
s
.
respond_to?
:specification_version
then
...
@@ -23,23 +24,23 @@ Gem::Specification.new do |s|
...
@@ -23,23 +24,23 @@ Gem::Specification.new do |s|
s
.
specification_version
=
3
s
.
specification_version
=
3
if
Gem
::
Version
.
new
(
Gem
::
RubyGemsVersion
)
>=
Gem
::
Version
.
new
(
'1.2.0'
)
then
if
Gem
::
Version
.
new
(
Gem
::
RubyGemsVersion
)
>=
Gem
::
Version
.
new
(
'1.2.0'
)
then
s
.
add_development_dependency
(
%q<
thoughtbot-
shoulda>
,
[
">= 0"
])
s
.
add_development_dependency
(
%q<shoulda>
,
[
">= 0"
])
s
.
add_development_dependency
(
%q<jferris-mocha>
,
[
"= 0.9.5.0.1241126838"
])
s
.
add_development_dependency
(
%q<jferris-mocha>
,
[
"
>
= 0.9.5.0.1241126838"
])
s
.
add_development_dependency
(
%q<aws-s3>
,
[
">= 0"
])
s
.
add_development_dependency
(
%q<aws-s3>
,
[
">= 0"
])
s
.
add_development_dependency
(
%q<sqlite3-ruby>
,
[
">= 0"
])
s
.
add_development_dependency
(
%q<sqlite3-ruby>
,
[
">= 0"
])
s
.
add_development_dependency
(
%q<activerecord>
,
[
">= 0"
])
s
.
add_development_dependency
(
%q<activerecord>
,
[
">= 0"
])
s
.
add_development_dependency
(
%q<activesupport>
,
[
">= 0"
])
s
.
add_development_dependency
(
%q<activesupport>
,
[
">= 0"
])
else
else
s
.
add_dependency
(
%q<
thoughtbot-
shoulda>
,
[
">= 0"
])
s
.
add_dependency
(
%q<shoulda>
,
[
">= 0"
])
s
.
add_dependency
(
%q<jferris-mocha>
,
[
"= 0.9.5.0.1241126838"
])
s
.
add_dependency
(
%q<jferris-mocha>
,
[
"
>
= 0.9.5.0.1241126838"
])
s
.
add_dependency
(
%q<aws-s3>
,
[
">= 0"
])
s
.
add_dependency
(
%q<aws-s3>
,
[
">= 0"
])
s
.
add_dependency
(
%q<sqlite3-ruby>
,
[
">= 0"
])
s
.
add_dependency
(
%q<sqlite3-ruby>
,
[
">= 0"
])
s
.
add_dependency
(
%q<activerecord>
,
[
">= 0"
])
s
.
add_dependency
(
%q<activerecord>
,
[
">= 0"
])
s
.
add_dependency
(
%q<activesupport>
,
[
">= 0"
])
s
.
add_dependency
(
%q<activesupport>
,
[
">= 0"
])
end
end
else
else
s
.
add_dependency
(
%q<
thoughtbot-
shoulda>
,
[
">= 0"
])
s
.
add_dependency
(
%q<shoulda>
,
[
">= 0"
])
s
.
add_dependency
(
%q<jferris-mocha>
,
[
"= 0.9.5.0.1241126838"
])
s
.
add_dependency
(
%q<jferris-mocha>
,
[
"
>
= 0.9.5.0.1241126838"
])
s
.
add_dependency
(
%q<aws-s3>
,
[
">= 0"
])
s
.
add_dependency
(
%q<aws-s3>
,
[
">= 0"
])
s
.
add_dependency
(
%q<sqlite3-ruby>
,
[
">= 0"
])
s
.
add_dependency
(
%q<sqlite3-ruby>
,
[
">= 0"
])
s
.
add_dependency
(
%q<activerecord>
,
[
">= 0"
])
s
.
add_dependency
(
%q<activerecord>
,
[
">= 0"
])
...
...
test/attachment_test.rb
View file @
3f2b0c0e
...
@@ -106,7 +106,7 @@ class AttachmentTest < Test::Unit::TestCase
...
@@ -106,7 +106,7 @@ class AttachmentTest < Test::Unit::TestCase
@dummy
.
stubs
(
:id
).
returns
(
@id
)
@dummy
.
stubs
(
:id
).
returns
(
@id
)
@file
=
StringIO
.
new
(
"."
)
@file
=
StringIO
.
new
(
"."
)
@dummy
.
avatar
=
@file
@dummy
.
avatar
=
@file
Rails
=
stub
(
'Rails'
,
:root
=>
@rails_env
)
Rails
.
stubs
(
:env
).
returns
(
@rails_env
)
end
end
should
"return the proper path"
do
should
"return the proper path"
do
...
...
test/iostream_test.rb
View file @
3f2b0c0e
...
@@ -66,7 +66,7 @@ class IOStreamTest < Test::Unit::TestCase
...
@@ -66,7 +66,7 @@ class IOStreamTest < Test::Unit::TestCase
name
=
File
.
basename
(
@file
.
path
)
name
=
File
.
basename
(
@file
.
path
)
extension
=
File
.
extname
(
name
)
extension
=
File
.
extname
(
name
)
basename
=
File
.
basename
(
name
,
extension
)
basename
=
File
.
basename
(
name
,
extension
)
assert_match
%r[^
#{
Regexp
.
quote
(
basename
)
}
.*?
#{
Regexp
.
quote
(
extension
)
}
]
,
File
.
basename
(
@tempfile
.
path
)
assert_match
%r[^
stream
.*?
#{
Regexp
.
quote
(
extension
)
}
]
,
File
.
basename
(
@tempfile
.
path
)
end
end
should
"have the Tempfile contain the same data as the file"
do
should
"have the Tempfile contain the same data as the file"
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