Sha256: 621a6992001e6dfbfbb8513cba261c6c1b89f07e59fc44eae315c2ba67e5030b

Contents?: true

Size: 409 Bytes

Versions: 14

Compression:

Stored size: 409 Bytes

Contents

# frozen_string_literal: true

require "logger"
require "refinements/string_ios"

module Refinements
  # Provides additional enhancements to a log device.
  module LogDevices
    using StringIOs

    refine Logger::LogDevice do
      def reread
        case dev
          when File then dev.class.new(dev).read
          when StringIO then dev.reread
          else ""
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
refinements-11.1.3 lib/refinements/log_devices.rb
refinements-11.1.2 lib/refinements/log_devices.rb
refinements-11.1.1 lib/refinements/log_devices.rb
refinements-11.1.0 lib/refinements/log_devices.rb
refinements-11.0.1 lib/refinements/log_devices.rb
refinements-11.0.0 lib/refinements/log_devices.rb
refinements-10.1.1 lib/refinements/log_devices.rb
refinements-10.1.0 lib/refinements/log_devices.rb
refinements-10.0.1 lib/refinements/log_devices.rb
refinements-10.0.0 lib/refinements/log_devices.rb
refinements-9.8.0 lib/refinements/log_devices.rb
refinements-9.7.1 lib/refinements/log_devices.rb
refinements-9.7.0 lib/refinements/log_devices.rb
refinements-9.6.0 lib/refinements/log_devices.rb