lib/github/markup/implementation.rb (view raw)
1module GitHub
2 module Markup
3 class Implementation
4 attr_reader :regexp
5
6 def initialize(regexp)
7 @regexp = regexp
8 end
9
10 def load
11 # no-op by default
12 end
13
14 def render(content)
15 raise NotImplementedError, "subclasses of GitHub::Markup::Implementation must define #render"
16 end
17
18 def match?(filename)
19 Regexp.compile("\\.(#{regexp})$") =~ filename
20 end
21 end
22 end
23end