Explorar el Código

Adding home_url to scraper

Thu Trang Pham hace 10 años
padre
commit
42910c62ce
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      lib/docs/core/scraper.rb

+ 5 - 1
lib/docs/core/scraper.rb

@@ -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