Class: LogStash::Outputs::Swift::PathValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/outputs/swift/path_validator.rb

Constant Summary collapse

INVALID_CHARACTERS =
"\^`><"

Class Method Summary collapse

Class Method Details

.matches_reObject



12
13
14
# File 'lib/logstash/outputs/swift/path_validator.rb', line 12

def self.matches_re
  /[#{Regexp.escape(INVALID_CHARACTERS)}]/
end

.valid?(name) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/logstash/outputs/swift/path_validator.rb', line 8

def self.valid?(name)
  name.match(matches_re).nil?
end