History

Adding home_url to scraper

Thu Trang Pham committed 11 years ago

Commit 42910c61 parent 8fb93ff1 file · +5 −1Browse files

Unified · Split

lib/docs/core/scraper.rb+5−1
@@ -3,7 +3,7 @@ require 'set' · 2 unmodified lines
33 module Docs
44 class Scraper < Doc
55 class << self
6− attr_accessor :base_url, :root_path, :initial_paths, :options, :html_filters, :text_filters
6+ attr_accessor :base_url, :home_url, :root_path, :initial_paths, :options, :html_filters, :text_filters
77
88 def inherited(subclass)
99 super
@@ -65,6 +65,10 @@ module Docs · 55 unmodified lines
6565 @root_url ||= root_path? ? URL.parse(File.join(base_url.to_s, root_path)) : base_url.normalize
6666 end
6767
68+ def home_url
69+ @home_url ||= URL.parse self.class.home_url
70+ end
71+
6872 def root_path
6973 self.class.root_path
7074 end