lib/embulk/guess/time_format_guess.rb in embulk-0.4.10 vs lib/embulk/guess/time_format_guess.rb in embulk-0.5.0
- old
+ new
@@ -373,10 +373,11 @@
RegexpPattern.new(StandardPatterns::APACHE_CLF, "%d/%b/%Y:%H:%M:%S %z"),
RegexpPattern.new(StandardPatterns::ANSI_C_ASCTIME, "%a %b %e %H:%M:%S %Y"),
]
def self.guess(texts)
- texts = Array(texts).select {|text| text != "" }
+ texts = Array(texts).map {|text| text.to_s }
+ texts.reject! {|text| text == "" }
matches = texts.map do |text|
PATTERNS.map {|pattern| pattern.match(text) }.compact
end.flatten
if matches.empty?
return nil