core/src/main/java/org/jruby/RubyDir.java
@JRubyMethod(name = "open", meta = true)
    public static IRubyObject open(ThreadContext context, IRubyObject recv, IRubyObject path, Block block) {
        RubyDir directory = (RubyDir) context.runtime.getDir().newInstance(context, path, Block.NULL_BLOCK);

        if (!block.isGiven()) return directory;

        try {
            return block.yield(context, directory);
        } finally {
            directory.close();
        }
    }
/**
     * Returns a new directory object for <code>path</code>.  If a block is
     * provided, a new directory object is passed to the block, which closes the
     * directory object before terminating.
     */
Returns a new directory object for path.  If a block is
provided, a new directory object is passed to the block, which closes the
directory object before terminating.
Returns a new directory object for path . If a block is provided a new directory object is passed to the block which closes the directory object before terminating .
@JRubyMethod(name = "open", meta = true)
    public static IRubyObject open(ThreadContext context, IRubyObject recv, IRubyObject path, Block block) {
        RubyDir directory = (RubyDir) context.runtime.getDir().newInstance(context, path, Block.NULL_BLOCK);
        if (!block.isGiven()) return directory;
        try {
            return block.yield(context, directory);
        } finally {
            directory.close();
        }
    }
@ JRubyMethod ( name = "open" , meta = true ) public static IRubyObject open ( ThreadContext context , IRubyObject recv , IRubyObject path , Block block ) { RubyDir directory = ( RubyDir ) context . runtime . getDir ( ) . newInstance ( context , path , Block . NULL_BLOCK ) ; if ( ! block . isGiven ( ) ) return directory ; try { return block . yield ( context , directory ) ; } finally { directory . close ( ) ; } }
Returns a new directory object for <code>path</code>.
Returns a new directory object for <code > path< / code > .