Skip to content

Commit

Permalink
Merge pull request #118 from Earlopain/no-base64
Browse files Browse the repository at this point in the history
Drop `base64` dependency
  • Loading branch information
SamSaffron authored Jun 17, 2024
2 parents c113496 + 3b39411 commit 02b0cff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/memory_profiler/autorun.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# frozen_string_literal: true

require "memory_profiler"
require "base64"

def deserialize_hash(data)
Marshal.load(Base64.urlsafe_decode64(data)) if data
Marshal.load(data.unpack1("m0")) if data
end

options = deserialize_hash(ENV["MEMORY_PROFILER_OPTIONS"]) || {}
Expand Down
3 changes: 1 addition & 2 deletions lib/memory_profiler/cli.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require "optparse"
require "base64"

module MemoryProfiler
class CLI
Expand Down Expand Up @@ -141,7 +140,7 @@ def profile_command(options, argv)
end

def serialize_hash(hash)
Base64.urlsafe_encode64(Marshal.dump(hash))
[Marshal.dump(hash)].pack("m0")
end
end
end

0 comments on commit 02b0cff

Please sign in to comment.