Skip to content
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

Add Pathname#glob #5085

Closed
wants to merge 1 commit into from
Closed

Conversation

nomadium
Copy link
Contributor

Hi folks,

This is another feature targeting Ruby 2.5 [1]: Add Pathname#glob method (feature #7360).

The associated MRI test to the feature work as expected:

  def test_glob
    with_tmpchdir('rubytest-pathname') {|dir|
      Dir.mkdir("d")
      open("d/f", "w") {|f| f.write "abc" }
      Dir.mkdir("d/e")
      assert_equal([Pathname("d/e"), Pathname("d/f")], Pathname("d").glob("*").sort)
      a = []
      Pathname("d").glob("*") {|path| a << path }
      a.sort!
      assert_equal([Pathname("d/e"), Pathname("d/f")], a)
    }
  end
miguel@alice:~/jruby$ PATH=$PWD/bin:$PATH jruby test/mri/runner.rb -v --color=never --tty=no --excludes=test/mri/excludes -q -n test_glob -- pathname/test_pathname.rb
Run options: -v --color=never --tty=no --excludes=test/mri/excludes -q -n test_glob --

# Running tests:

[1/1] TestPathname#test_glob = 0.03 s
Finished tests in 0.100697s, 9.9308 tests/s, 39.7231 assertions/s.
1 tests, 4 assertions, 0 failures, 0 errors, 0 skips

ruby -v: jruby 9.3.0.0-SNAPSHOT (2.5.0) 2018-03-11 479efd6 Java HotSpot(TM) 64-Bit Server VM 25.102-b14 on 1.8.0_102-b14 +jit [darwin-x86_64]

Thanks for your review and feedback.

  1. Ruby 2.5 Support #4876
  2. https://bugs.ruby-lang.org/issues/7360

For more information, please see feature jruby#7360.
This was referenced Mar 19, 2018
@kares
Copy link
Member

kares commented Mar 20, 2018

Well done Miguel, however we shall prefer the Stream-less version. Closing as duplicate of #5095

@kares kares closed this Mar 20, 2018
@kares kares added this to the Invalid or Duplicate milestone Mar 20, 2018
@kares kares added the ruby 2.5 label Mar 20, 2018
@nomadium nomadium deleted the add-pathname-glob branch March 20, 2018 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants