Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/svenfuchs/pathname_local


https://github.com/svenfuchs/pathname_local

Last synced: 12 days ago
JSON representation

Awesome Lists containing this project

README

        

h1. Pathname.local(path)

Super-tiny gem that adds Pathname.local(path):

Pathname.module_eval do
def self.local(path)
new(File.expand_path(File.join('..', path), caller.last))
end
end

So, e.g. in a test_helper.rb file one could do:

fixtures_path = Pathname.local('fixtures')

Instead of the much more verbose:

fixtures_path = Pathname.new(File.expand_path('../fixtures', __FILE__))