浏览代码

Fix version blocks and update patch version

Jasper van Merle 6 年之前
父节点
当前提交
f47326e787
共有 1 个文件被更改,包括 19 次插入10 次删除
  1. 19 10
      lib/docs/scrapers/crystal.rb

+ 19 - 10
lib/docs/scrapers/crystal.rb

@@ -2,7 +2,6 @@ module Docs
   class Crystal < UrlScraper
   class Crystal < UrlScraper
     self.type = 'crystal'
     self.type = 'crystal'
     self.base_url = 'https://crystal-lang.org/'
     self.base_url = 'https://crystal-lang.org/'
-    self.root_path = "api/#{release}/index.html"
     self.initial_paths = %w(docs/index.html)
     self.initial_paths = %w(docs/index.html)
     self.links = {
     self.links = {
       home: 'https://crystal-lang.org/',
       home: 'https://crystal-lang.org/',
@@ -11,14 +10,6 @@ module Docs
 
 
     html_filters.push 'crystal/entries', 'crystal/clean_html'
     html_filters.push 'crystal/entries', 'crystal/clean_html'
 
 
-    options[:only_patterns] = [/\Adocs\//, /\Aapi\/#{release}\//]
-    options[:skip_patterns] = [/debug/i]
-
-    options[:replace_paths] = {
-      "api/#{release}/" => "api/#{release}/index.html",
-      'docs/' => 'docs/index.html'
-    }
-
     options[:attribution] = ->(filter) {
     options[:attribution] = ->(filter) {
       if filter.slug.start_with?('docs')
       if filter.slug.start_with?('docs')
         <<-HTML
         <<-HTML
@@ -35,11 +26,29 @@ module Docs
     }
     }
 
 
     version '0.31' do
     version '0.31' do
-      self.release = '0.31.0'
+      self.release = '0.31.1'
+      self.root_path = "api/#{release}/index.html"
+
+      options[:only_patterns] = [/\Adocs\//, /\Aapi\/#{release}\//]
+      options[:skip_patterns] = [/debug/i]
+
+      options[:replace_paths] = {
+        "api/#{release}/" => "api/#{release}/index.html",
+        'docs/' => 'docs/index.html'
+      }
     end
     end
 
 
     version '0.30' do
     version '0.30' do
       self.release = '0.30.1'
       self.release = '0.30.1'
+      self.root_path = "api/#{release}/index.html"
+
+      options[:only_patterns] = [/\Adocs\//, /\Aapi\/#{release}\//]
+      options[:skip_patterns] = [/debug/i]
+
+      options[:replace_paths] = {
+        "api/#{release}/" => "api/#{release}/index.html",
+        'docs/' => 'docs/index.html'
+      }
     end
     end
 
 
     def get_latest_version(opts)
     def get_latest_version(opts)