Skip to content

Commit

Permalink
Merge pull request #1 from dtaniwaki/update-plain-processor
Browse files Browse the repository at this point in the history
Update plain processor
  • Loading branch information
dtaniwaki committed Nov 19, 2014
2 parents d91d8f7 + 3daf2da commit 2118f02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions lib/paperclip/processors/plain.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
require 'paperclip/processor'
require_relative 'deflater_base'

module Paperclip
module Processors
class Plain < ::Paperclip::Processor
def initialize(file, options = {}, attachment = nil)
super
end

class Plain < DeflaterBase
def make
@file
dst = create_tempfile
dst.write @file.read
@file.rewind
dst.flush
dst.rewind
dst
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion spec/paperclip/processors/plain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
end
describe "#make" do
it "returns the file" do
expect(subject.make).to eq(file)
expect(subject.make).not_to be file
expect(subject.make.read).to eq test_file.read
end
end
end

0 comments on commit 2118f02

Please sign in to comment.