Class: Aruba::Configuration::PathSegment

Inherits:
Object
  • Object
show all
Defined in:
lib/aruba/configuration.rb

Overview

Value is a single safe relative path segment. Joining it to a path must yield a strict subdirectory of that path.

Class Method Summary collapse

Class Method Details

.valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
# File 'lib/aruba/configuration.rb', line 24

def self.valid?(value)
  test_path = Pathname.new('test').join(value).cleanpath
  test_path.basename.to_s == value
rescue StandardError
  false
end