Sha256: 7bf93e20114a58f3802c55517103bd7dc96593c3de096169d8630595f294ba7f

Contents?: true

Size: 1.01 KB

Versions: 28

Compression:

Stored size: 1.01 KB

Contents

# -*- coding: utf-8 -*-

require 'writeexcel/caller_info'

if defined?($writeexcel_debug)
  class BIFFWriter
    include CallerInfo

    def append(*args)
      data =
        ruby_18 { args.join } ||
        ruby_19 { args.collect{ |arg| arg.dup.force_encoding('ASCII-8BIT') }.join }
      print_caller_info(data, :method => 'append')
      super
    end

    def prepend(*args)
      data =
        ruby_18 { args.join } ||
        ruby_19 { args.collect{ |arg| arg.dup.force_encoding('ASCII-8BIT') }.join }
      print_caller_info(data, :method => 'prepend')
      super
    end

    def print_caller_info(data, param = {})
      infos = caller_info

      print "#{param[:method]}\n" if param[:method]
      infos.each do |info|
        print "#{info[:file]}:#{info[:line]}"
        print " in #{info[:method]}" if info[:method]
        print "\n"
      end
      print unpack_record(data) + "\n\n"
    end

    def unpack_record(data)  # :nodoc:
      data.unpack('C*').map! {|c| sprintf("%02X", c) }.join(' ')
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
writeexcel-1.0.9 lib/writeexcel/debug_info.rb
writeexcel-1.0.8 lib/writeexcel/debug_info.rb
writeexcel-1.0.7 lib/writeexcel/debug_info.rb
writeexcel-1.0.6 lib/writeexcel/debug_info.rb
writeexcel-1.0.5 lib/writeexcel/debug_info.rb
writeexcel-1.0.4 lib/writeexcel/debug_info.rb
writeexcel-1.0.3 lib/writeexcel/debug_info.rb
writeexcel-1.0.2 lib/writeexcel/debug_info.rb
writeexcel-1.0.1 lib/writeexcel/debug_info.rb
writeexcel-1.0.0 lib/writeexcel/debug_info.rb
writeexcel-0.6.19 lib/writeexcel/debug_info.rb
writeexcel-0.6.18 lib/writeexcel/debug_info.rb
writeexcel-0.6.17 lib/writeexcel/debug_info.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/writeexcel-0.6.16/lib/writeexcel/debug_info.rb
writeexcel-0.6.16 lib/writeexcel/debug_info.rb
writeexcel-0.6.15 lib/writeexcel/debug_info.rb
writeexcel-0.6.14 lib/writeexcel/debug_info.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/writeexcel-0.6.13/lib/writeexcel/debug_info.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/writeexcel-0.6.13/lib/writeexcel/debug_info.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/writeexcel-0.6.13/lib/writeexcel/debug_info.rb