Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Except for a few failing tests, this seems to be working.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Yurek committed Apr 26, 2010
1 parent 933dc7b commit 3f2b0c0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -65,6 +65,7 @@ spec = Gem::Specification.new do |s|
s.author = "Jon Yurek"
s.email = "jyurek@thoughtbot.com"
s.homepage = "http://www.thoughtbot.com/projects/paperclip"
s.description = "Easy upload management for ActiveRecord"
s.platform = Gem::Platform::RUBY
s.summary = "File attachments as attributes for ActiveRecord"
s.files = FileList[include_file_globs].to_a - FileList[exclude_file_globs].to_a
Expand Down
2 changes: 1 addition & 1 deletion lib/paperclip/attachment.rb
Expand Up @@ -291,7 +291,7 @@ def fire_events(which) #:nodoc:
end

def callback which #:nodoc:
instance.run_callbacks(which, @queued_for_write){|result, obj| result == false }
instance.run_callbacks(which, @queued_for_write)
end

def post_process_styles #:nodoc:
Expand Down
2 changes: 1 addition & 1 deletion lib/paperclip/iostream.rb
Expand Up @@ -5,7 +5,7 @@ module IOStream
# Returns a Tempfile containing the contents of the readable object.
def to_tempfile
name = respond_to?(:original_filename) ? original_filename : (respond_to?(:path) ? path : "stream")
tempfile = Paperclip::Tempfile.new(File.basename(name))
tempfile = Paperclip::Tempfile.new("stream" + File.extname(name))
tempfile.binmode
self.stream_to(tempfile)
end
Expand Down
19 changes: 10 additions & 9 deletions paperclip.gemspec
Expand Up @@ -6,40 +6,41 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
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.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/storage_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/style_test.rb", "test/thumbnail_test.rb", "test/upfile_test.rb", "shoulda_macros/paperclip.rb"]
s.homepage = %q{http://www.thoughtbot.com/projects/paperclip}
s.rdoc_options = ["--line-numbers", "--inline-source"]
s.require_paths = ["lib"]
s.requirements = ["ImageMagick"]
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}

if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3

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<jferris-mocha>, ["= 0.9.5.0.1241126838"])
s.add_development_dependency(%q<shoulda>, [">= 0"])
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<sqlite3-ruby>, [">= 0"])
s.add_development_dependency(%q<activerecord>, [">= 0"])
s.add_development_dependency(%q<activesupport>, [">= 0"])
else
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
s.add_dependency(%q<jferris-mocha>, ["= 0.9.5.0.1241126838"])
s.add_dependency(%q<shoulda>, [">= 0"])
s.add_dependency(%q<jferris-mocha>, [">= 0.9.5.0.1241126838"])
s.add_dependency(%q<aws-s3>, [">= 0"])
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
s.add_dependency(%q<activerecord>, [">= 0"])
s.add_dependency(%q<activesupport>, [">= 0"])
end
else
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
s.add_dependency(%q<jferris-mocha>, ["= 0.9.5.0.1241126838"])
s.add_dependency(%q<shoulda>, [">= 0"])
s.add_dependency(%q<jferris-mocha>, [">= 0.9.5.0.1241126838"])
s.add_dependency(%q<aws-s3>, [">= 0"])
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
s.add_dependency(%q<activerecord>, [">= 0"])
Expand Down
2 changes: 1 addition & 1 deletion test/attachment_test.rb
Expand Up @@ -106,7 +106,7 @@ class AttachmentTest < Test::Unit::TestCase
@dummy.stubs(:id).returns(@id)
@file = StringIO.new(".")
@dummy.avatar = @file
Rails = stub('Rails', :root => @rails_env)
Rails.stubs(:env).returns(@rails_env)
end

should "return the proper path" do
Expand Down
2 changes: 1 addition & 1 deletion test/iostream_test.rb
Expand Up @@ -66,7 +66,7 @@ class IOStreamTest < Test::Unit::TestCase
name = File.basename(@file.path)
extension = File.extname(name)
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

should "have the Tempfile contain the same data as the file" do
Expand Down

0 comments on commit 3f2b0c0

Please sign in to comment.