瀏覽代碼

Update Laravel documentation (5.4.30, 5.3.30, 5.2.31, 5.1.33, 4.2.11)

Thibaut Courouble 8 年之前
父節點
當前提交
26132688ae
共有 1 個文件被更改,包括 15 次插入1 次删除
  1. 15 1
      lib/docs/scrapers/laravel.rb

+ 15 - 1
lib/docs/scrapers/laravel.rb

@@ -34,7 +34,7 @@ module Docs
     HTML
 
     version '5.4' do
-      self.release = '5.4.23'
+      self.release = '5.4.30'
       self.root_path = '/api/5.4/index.html'
       self.initial_paths = %w(/docs/5.4/installation /api/5.4/classes.html)
 
@@ -84,5 +84,19 @@ module Docs
         url
       end
     end
+
+
+    version '4.2' do
+      self.release = '4.2.11'
+      self.root_path = '/api/4.2/index.html'
+      self.initial_paths = %w(/docs/4.2/installation /api/4.2/classes.html)
+
+      options[:only_patterns] = [%r{\A/api/4\.2/}, %r{\A/docs/4\.2/}]
+
+      options[:fix_urls] = ->(url) do
+        url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/4.2/"
+        url
+      end
+    end
   end
 end