Class: Dir

Inherits:
Object
  • Object
show all
Defined in:
lib/kwala/lib/strange_requires_detector.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



42
43
44
45
46
47
48
49
# File 'lib/kwala/lib/strange_requires_detector.rb', line 42

def == (other)
  case other
  when String;  return path == other
  when Dir;     return path == other.path
  when FakeDir; return path == other.path
  end
  false
end

#cut(basedir) ⇒ Object



55
56
57
# File 'lib/kwala/lib/strange_requires_detector.rb', line 55

def cut(basedir)
  path
end

#is_subdir_of?(dir) ⇒ Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/kwala/lib/strange_requires_detector.rb', line 51

def is_subdir_of?(dir)
  return path[0..dir.path.length-1] == dir.path
end