]>
gitweb.michael.orlitzky.com - dead/whatever-dl.git/blob - src/website.rb
1239712a696a3b855ec3ad79472865a608e7f937
2 # Copyright Michael Orlitzky
4 # http://michael.orlitzky.com/
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # http://www.fsf.org/licensing/licenses/gpl.html
19 # This class keeps track of all its subclasses
20 # We use this to loop through every "website" in an
21 # attempt to determine to which site a URL belongs.
23 def self.inherited(subclass
)
24 if superclass
.respond_to
? :inherited
25 superclass
.inherited(subclass
)
28 # Every time we're subclassed, add the new
29 # subclass to our list of subclasses.
31 @subclasses << subclass
38 # This should be overridden in any class that wants
39 # to claim ownership of a URL.
40 def self.owns_url
?(url
)
44 # Same here. We want to default to nil unless overridden.
45 def get_video_url(url
)