PHP 8.2.31
Preview: append_as_bytes.rb Size: 371 B
//proc/thread-self/root/opt/alt/ruby40/share/ruby/prism/polyfill/append_as_bytes.rb

# frozen_string_literal: true

# Polyfill for String#append_as_bytes, which didn't exist until Ruby 3.4.
if !("".respond_to?(:append_as_bytes))
  String.include(
    Module.new {
      def append_as_bytes(*args)
        args.each do |arg|
          arg = Integer === arg ? [arg].pack("C") : arg.b
          self.<<(arg) # steep:ignore
        end
      end
    }
  )
end

Directory Contents

Dirs: 0 × Files: 5

Name Size Perms Modified Actions
371 B lrw-r--r-- 2026-05-21 12:15:22
Edit Download
324 B lrw-r--r-- 2026-05-21 12:15:22
Edit Download
294 B lrw-r--r-- 2026-05-21 12:15:22
Edit Download
536 B lrw-r--r-- 2026-05-21 12:15:22
Edit Download
987 B lrw-r--r-- 2026-05-21 12:15:22
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).