Переглянути джерело

Update Laravel documentation (4.2.11)

Thibaut 11 роки тому
батько
коміт
9a95cd1b93
1 змінених файлів з 15 додано та 10 видалено
  1. 15 10
      lib/docs/scrapers/laravel.rb

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

@@ -3,10 +3,10 @@ module Docs
     self.name = 'Laravel'
     self.slug = 'laravel'
     self.type = 'laravel'
-    self.version = '4.2.0'
+    self.version = '4.2.11'
     self.base_url = 'http://laravel.com'
-    self.root_path = '/docs/introduction'
-    self.initial_paths = %w(/api/4.2/namespaces.html)
+    self.root_path = '/docs/4.2/introduction'
+    self.initial_paths = %w(/api/4.2/classes.html)
 
     html_filters.push 'laravel/entries', 'laravel/clean_html'
 
@@ -16,21 +16,26 @@ module Docs
 
     options[:only_patterns] = [
       /\A\/api\/4\.2\//,
-      /\A\/docs\//]
+      /\A\/docs\/4\.2\//]
 
     options[:skip] = %w(
-      /docs/quick
-      /docs/releases
-      /docs/upgrade
-      /docs/artisan
-      /docs/commands
+      /docs/4.2/quick
+      /docs/4.2/releases
+      /docs/4.2/upgrade
+      /docs/4.2/artisan
+      /docs/4.2/commands
       /api/4.2/panel.html
-      /api/4.2/classes.html
+      /api/4.2/namespaces.html
       /api/4.2/interfaces.html
       /api/4.2/traits.html
       /api/4.2/doc-index.html
       /api/4.2/Illuminate.html)
 
+    options[:fix_urls] = ->(url) do
+      url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/4.2/"
+      url
+    end
+
     options[:attribution] = <<-HTML
       &copy; Taylor Otwell<br>
       Licensed under the MIT License.