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
3module Docs3module Docs
4 class Scraper < Doc4 class Scraper < Doc
5 class << self5 class << self
6 attr_accessor :base_url, :root_path, :initial_paths, :options, :html_filters, :text_filters6 attr_accessor :base_url, :home_url, :root_path, :initial_paths, :options, :html_filters, :text_filters
7 7
8 def inherited(subclass)8 def inherited(subclass)
9 super9 super
@@ -65,6 +65,10 @@ module Docs · 55 unmodified lines
65 @root_url ||= root_path? ? URL.parse(File.join(base_url.to_s, root_path)) : base_url.normalize65 @root_url ||= root_path? ? URL.parse(File.join(base_url.to_s, root_path)) : base_url.normalize
66 end66 end
67 67
68 def home_url
69 @home_url ||= URL.parse self.class.home_url
70 end
71
68 def root_path72 def root_path
69 self.class.root_path73 self.class.root_path
70 end74 end