Adding home_url to scraper

pull/170/head
Thu Trang Pham 10 years ago
parent 8fb93ff9e0
commit 42910c62ce

@ -3,7 +3,7 @@ require 'set'
module Docs
class Scraper < Doc
class << self
attr_accessor :base_url, :root_path, :initial_paths, :options, :html_filters, :text_filters
attr_accessor :base_url, :home_url, :root_path, :initial_paths, :options, :html_filters, :text_filters
def inherited(subclass)
super
@ -65,6 +65,10 @@ module Docs
@root_url ||= root_path? ? URL.parse(File.join(base_url.to_s, root_path)) : base_url.normalize
end
def home_url
@home_url ||= URL.parse self.class.home_url
end
def root_path
self.class.root_path
end

Loading…
Cancel
Save