-
-
Save headius/1125369 to your computer and use it in GitHub Desktop.
jruby-1.6.3 Digest#file bug when run with JRUBY_OPTS=--1.9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pathname' | |
require 'digest' | |
`touch foo.txt` | |
path = Pathname.new 'foo.txt' | |
digest = Digest::MD5.new # digest type doesn't matter, see same problem with SHA1 | |
# digest.file path # this line throws an error when have JRUBY_OPTS=--1.9 | |
# workaround 1: | |
digest.file path.to_s | |
# workaround 2: | |
class Digest::Base | |
alias real_file file | |
def file(something); real_file(something.to_s); end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment