New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FakeFS::Dir.glob doesn't utilize a given block #39

Closed
sandro opened this Issue May 23, 2010 · 2 comments

Comments

Projects
None yet
3 participants
@sandro

sandro commented May 23, 2010

Dir.glob takes a block which it passes on to #each. Here's a monkey patch.

module FakeFS
  class Dir
    class << self
      alias glob_without_block glob

      def glob(pattern, &block)
        ary = glob_without_block(pattern)
        ary.each &block if block_given?
        ary
      end
    end
  end
end
@smtlaissezfaire

This comment has been minimized.

Show comment
Hide comment
@smtlaissezfaire

smtlaissezfaire Dec 16, 2010

Collaborator

Mind submitting a patch with a pull request + tests?

Collaborator

smtlaissezfaire commented Dec 16, 2010

Mind submitting a patch with a pull request + tests?

@wijet

This comment has been minimized.

Show comment
Hide comment
@wijet

wijet Dec 27, 2010

Contributor

FakeFS::Dir.glob works with a given block. Closed by 66c27ff. Closed by 66c27ff.

Contributor

wijet commented Dec 27, 2010

FakeFS::Dir.glob works with a given block. Closed by 66c27ff. Closed by 66c27ff.

davidmiani pushed a commit to davidmiani/fakefs that referenced this issue May 5, 2011

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment