Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Loading…'dir_name')) raises a TypeError #1154

senorprogrammer opened this Issue · 2 comments

2 participants

@senorprogrammer should be able to accept a bare instance as a param.

Expected Result

Returns a new instance of Pathname build from the Dir instance.

Actual Result

Raises a TypeError.

Steps to Reproduce

Test code (run from the Documents directory of a standard OS X user account).

d ='Pictures')

pn =

dir = pn.children.find { |child| && child.basename.to_s == 'GoPro' }
puts dir.inspect

JRuby 1.7.5 result:

‼ ⚡ ruby dir_test.rb
TypeError: can't convert Dir into String
initialize at org/jruby/ext/pathname/
      (root) at dir_test.rb:7

MRI 1.9.3-p392 result:

✔ ⚡ ruby dir_test.rb


pn =

Ah simple missing method. Dir.to_path does not exist. I will add that.

@enebo enebo closed this in 02a9d82

Thanks Thomas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.