Skip to content

Instantly share code, notes, and snippets.

@jakehow
Created December 6, 2012 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakehow/4229384 to your computer and use it in GitHub Desktop.
Save jakehow/4229384 to your computer and use it in GitHub Desktop.
rbx-head-18mode :003 > Base64.respond_to?(:strict_encode64)
=> false
rbx-head-18mode :004 > unless Base64.respond_to?(:strict_encode64)
rbx-head-18mode :005?> module Base64
rbx-head-18mode :006?> def strict_encode64(bin)
rbx-head-18mode :007?> [bin].pack("m0")
rbx-head-18mode :008?> end
rbx-head-18mode :009?> end
rbx-head-18mode :010?> end
=> #<Rubinius::CompiledCode strict_encode64 file=(irb)>
rbx-head-18mode :011 > Base64.respond_to?(:strict_encode64)
=> false
rbx-head-18mode :015 > unless Base64.respond_to?(:strict_encode64)
rbx-head-18mode :016?> def Base64.strict_encode64(bin)
rbx-head-18mode :017?> [bin].pack("m0")
rbx-head-18mode :018?> end
rbx-head-18mode :019?> end
=> #<Rubinius::CompiledCode strict_encode64 file=(irb)>
rbx-head-18mode :020 > Base64.respond_to?(:strict_encode64)
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment