Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

A Replacement For Ruby's File.join

DZone's Guide to

A Replacement For Ruby's File.join

·
Free Resource
File.join is ugly, there I've said it. So how about being able to replace this:


require File.join(LOAD_PATH, 'foobar')


With this:


require LOAD_PATH/:foobar


Trivial, really:


class String
  def /(o)
    File.join(self, o.to_s)
  end
end
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}