Module: RubyLens::Paths

Defined in:
lib/rubylens/paths.rb

Class Method Summary collapse

Class Method Details

.inside?(path, directory) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
# File 'lib/rubylens/paths.rb', line 7

def inside?(path, directory)
  path = File.expand_path(path)
  directory = File.expand_path(directory)
  path == directory || path.start_with?("#{directory}#{File::SEPARATOR}")
end