# File lib/composite_io.rb, line 71 def initialize(filename_or_io, content_type, filename = nil, opts = {}) io = filename_or_io local_path = "" if io.respond_to? :read # in Ruby 1.9.2, StringIOs no longer respond to path # (since they respond to :length, so we don't need their local path, see parts.rb:41) local_path = filename_or_io.respond_to?(:path) ? filename_or_io.path : "local.path" else io = File.open(filename_or_io) local_path = filename_or_io end filename ||= local_path @content_type = content_type @original_filename = File.basename(filename) @local_path = local_path @io = io @opts = opts end