Sha256: 27389e102cf468632c1d19fc0ec1ef12c143fc71b948124f99380b48a9b1d122

Contents?: true

Size: 995 Bytes

Versions: 80

Compression:

Stored size: 995 Bytes

Contents

module Zip
  module IOExtras
    # Implements many of the output convenience methods of IO.
    # relies on <<
    module AbstractOutputStream
      include FakeIO

      def write(data)
        self << data
        data.to_s.bytesize
      end


      def print(*params)
        self << params.join($,) << $\.to_s
      end

      def printf(a_format_string, *params)
        self << sprintf(a_format_string, *params)
      end

      def putc(an_object)
        self << case an_object
                when Fixnum
                  an_object.chr
                when String
                  an_object
                else
                  raise TypeError, 'putc: Only Fixnum and String supported'
                end
        an_object
      end

      def puts(*params)
        params << "\n" if params.empty?
        params.flatten.each do |element|
          val = element.to_s
          self << val
          self << "\n" unless val[-1, 1] == "\n"
        end
      end

    end
  end
end

Version data entries

80 entries across 77 versions & 20 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/ioextras/abstract_output_stream.rb