Browse Source

Update CMake documentation (3.24)

Simon Legner 3 years ago
parent
commit
bb64013a05
2 changed files with 19 additions and 5 deletions
  1. 1 1
      assets/javascripts/templates/pages/about_tmpl.coffee
  2. 18 4
      lib/docs/scrapers/cmake.rb

+ 1 - 1
assets/javascripts/templates/pages/about_tmpl.coffee

@@ -173,7 +173,7 @@ credits = [
     'https://github.com/clojure/clojure/blob/master/epl-v10.html'
   ], [
     'CMake',
-    '2000-2019 Kitware, Inc. and Contributors',
+    '2000-2022 Kitware, Inc. and Contributors',
     'BSD',
     'https://cmake.org/licensing/'
   ], [

+ 18 - 4
lib/docs/scrapers/cmake.rb

@@ -16,10 +16,25 @@ module Docs
     options[:skip_patterns] = [/\Agenerator/, /\Acpack_gen/, /\Ainclude/, /\Arelease/, /tutorial\/(\w*%20)+/]
 
     options[:attribution] = <<-HTML
-      &copy; 2000&ndash;2021 Kitware, Inc. and Contributors<br>
+      &copy; 2000&ndash;2022 Kitware, Inc. and Contributors<br>
       Licensed under the BSD 3-clause License.
     HTML
 
+    version '3.24' do
+      self.release = '3.24'
+      self.base_url = "https://cmake.org/cmake/help/v#{self.version}/"
+    end
+
+    version '3.23' do
+      self.release = '3.23'
+      self.base_url = "https://cmake.org/cmake/help/v#{self.version}/"
+    end
+
+    version '3.22' do
+      self.release = '3.22'
+      self.base_url = "https://cmake.org/cmake/help/v#{self.version}/"
+    end
+
     version '3.21' do
       self.release = '3.21'
       self.base_url = "https://cmake.org/cmake/help/v#{self.version}/"
@@ -106,9 +121,8 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://cmake.org/documentation/', opts)
-      link = doc.at_css('.entry-content ul > li > strong > a > big')
-      link.content.scan(/([0-9.]+)/)[0][0]
+      tags = get_gitlab_tags('gitlab.kitware.com', 'cmake', 'cmake', opts)
+      tags[0]['name'][1..]
     end
   end
 end