Class: Pathname

Inherits:
Object show all
Defined in:
lib/more/facets/pathname.rb

Class Method Summary collapse

Class Method Details

./(path) ⇒ Object

Active path separator.

p1 = Pathname.new('/')
p2 = p1 / 'usr' / 'share'   #=> Pathname:/usr/share


48
49
50
# File 'lib/more/facets/pathname.rb', line 48

def self./(path)
  new(path)
end

.[](path) ⇒ Object

Alternate to Pathname#new.

Pathname['/usr/share']


39
40
41
# File 'lib/more/facets/pathname.rb', line 39

def self.[](path)
  new(path)
end

.nullObject

Platform dependent null device.



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/more/facets/pathname.rb', line 59

def self.null
  case RUBY_PLATFORM
  when /mswin/i
    'NUL'
  when /amiga/i
    'NIL:'
  when /openvms/i
    'NL:'
  else
    '/dev/null'
  end
end