Sha256: a2242f23feb12efcca2eb9fb4c48aea5b599badf895e705d512863c0a9c2ee91
Contents?: true
Size: 1.02 KB
Versions: 43
Compression:
Stored size: 1.02 KB
Contents
module Redcar module SyntaxCheck class Checker attr_reader :doc def self.checkers @checkers ||= {} end def self.[] name checkers[name] end def self.supported_grammars(*names) if names.any? names.each {|g| Checker.checkers[g] = self } @supported_grammars = supported_grammars + names else @supported_grammars ||= [] end end def initialize(document) @doc = document end def manifest_path(doc = @doc) path = doc.path unless path and File.exist? path Tempfile.open(doc.title) do |f| f << doc.get_all_text path = f.path end end path end def supported_grammars raise NotImplementedError, "My subclass #{self.class.name} should have implemented check" end def check raise NotImplementedError, "My subclass #{self.class.name} should have implemented check" end end end end
Version data entries
43 entries across 43 versions & 2 rubygems