A Ruby library for finding files in a set of paths
Ruby
Latest commit 3abf0b3 Feb 19, 2015 @sstephenson Merge pull request #36 from bjfish/patch-1
Add Rubinius to Build Matrix with Allowed Failure
Permalink
Failed to load latest commit information.
lib Hike 2.1.3 Apr 25, 2014
test Fix accessing Trail#aliases by key Apr 25, 2014
.gitignore Add gemfile Oct 20, 2011
.travis.yml Add Rubinius to Build Matrix with Allowed Failure Feb 19, 2015
Gemfile Update rubygems source Apr 9, 2013
LICENSE
README.md Use plural methods when multiple args are passed Jul 18, 2011
Rakefile Add test/ to test load path Oct 20, 2011
hike.gemspec Hike 2.1.3 Apr 25, 2014

README.md

Hike

Hike is a Ruby library for finding files in a set of paths. Use it to implement search paths, load paths, and the like.

Examples

Find Ruby files in this project:

trail = Hike::Trail.new "/Users/sam/Projects/hike"
trail.append_extension ".rb"
trail.append_paths "lib", "test"

trail.find "hike/trail"
# => "/Users/sam/Projects/hike/lib/hike/trail.rb"

trail.find "test_trail"
# => "/Users/sam/Projects/hike/test/test_trail.rb"

Explore your Ruby load path:

trail = Hike::Trail.new "/"
trail.append_extensions ".rb", ".bundle"
trail.append_paths *$:

trail.find "net/http"
# => "/Users/sam/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/net/http.rb"

trail.find "strscan"
# => "/Users/sam/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/i686-darwin10.4.0/strscan.bundle"

Explore your shell path:

trail = Hike::Trail.new "/"
trail.append_paths *ENV["PATH"].split(":")

trail.find "ls"
# => "/bin/ls"

trail.find "gem"
# => "/Users/sam/.rvm/rubies/ree-1.8.7-2010.02/bin/gem"

Installation

$ gem install hike

License

Copyright (c) 2011 Sam Stephenson.

Released under the MIT license. See LICENSE for details.