Class: LogStash::Outputs::LogstashAzureBlobOutput::PathValidator

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

Overview

a sub class of LogstashAzureBlobOutput valdiates the path for the temporary directory

Constant Summary collapse

INVALID_CHARACTERS =
"\^`><".freeze

Class Method Summary collapse

Class Method Details

.matches_reObject

define the invalid characters that shouldn’t be in the path name



14
15
16
# File 'lib/logstash/outputs/blob/path_validator.rb', line 14

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

.valid?(name) ⇒ Boolean

boolean method to check if a name is valid

Returns:

  • (Boolean)


9
10
11
# File 'lib/logstash/outputs/blob/path_validator.rb', line 9

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