Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/hike/trail.rb
View
12 lib/hike/trail.rb
@@ -156,15 +156,19 @@ def index
# `Trail#entries` is equivalent to `Dir#entries`. It is not
# recommend to use this method for general purposes. It exists for
# parity with `Index#entries`.
- def entries(*args)
- index.entries(*args)
+ def entries(path)
+ Pathname.new(path).entries.reject { |entry| entry.to_s =~ /^\.|~$|^\#.*\#$/ }.sort
+ rescue Errno::ENOENT
+ []
end
# `Trail#stat` is equivalent to `File#stat`. It is not
# recommend to use this method for general purposes. It exists for
# parity with `Index#stat`.
- def stat(*args)
- index.stat(*args)
+ def stat(path)
+ File.stat(path.to_s)
+ rescue Errno::ENOENT
+ nil
end
private

No commit comments for this range

Something went wrong with that request. Please try again.