Sha256: e827bbecd4e454ee0dd11de6b4c84106176bee1b0ee8da0444f625f4f2273405

Contents?: true

Size: 450 Bytes

Versions: 6

Compression:

Stored size: 450 Bytes

Contents

module PathOperator
  def / *others
    File.join self, *others.map(&:to_s)
  end
  
  def to_path
    Pathname.new(self.to_s)
  end
end

String.class_eval{include PathOperator}
Symbol.class_eval{include PathOperator}


class Pathname
  def / *others
    join *others.map(&:to_s)
  end
  
  def from other_path
    self.relative_path_from( other_path.to_path )
  end
  
  def absolute
    "/#{self}".to_path
  end
  
  def to_path
    self
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
elia-2.4.2.pre lib/path_operator.rb
elia-2.4.1 lib/path_operator.rb
elia-2.3.2 lib/path_operator.rb
elia-1.2.0 lib/path_operator.rb
elia-1.1.0 lib/path_operator.rb
elia-1.0.2 lib/path_operator.rb