Kouhei Sutou
null+****@clear*****
Mon Jan 15 14:20:03 JST 2018
Kouhei Sutou 2018-01-15 14:20:03 +0900 (Mon, 15 Jan 2018) New Revision: 180fe56b57d2b6947677201ba32bd9d34ce3720f https://github.com/groonga/groonga-log/commit/180fe56b57d2b6947677201ba32bd9d34ce3720f Message: Add Parser.target_line? Modified files: lib/groonga-log/parser.rb Modified: lib/groonga-log/parser.rb (+12 -0) =================================================================== --- lib/groonga-log/parser.rb 2017-11-13 16:52:12 +0900 (4e49106) +++ lib/groonga-log/parser.rb 2018-01-15 14:20:03 +0900 (554413b) @@ -26,6 +26,18 @@ module GroongaLog \|(?:(?<pid>\d+):)? \ (?<message>.*)/x + class << self + def target_line?(line) + if line.respond_to?(:valid_encodign?) + return false unless line.valid_eocoding? + end + + return false unless PATTERN.match(line) + + true + end + end + def parse(input) return to_enum(:parse, input) unless block_given? -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180115/c42293b1/attachment.htm