[devdocsgjs/main: 813/1867] gnu_cobol: implement get_latest_version




commit e61f3f7202f749ea60c1c9761394c5f154ecd98e
Author: Jasper van Merle <jaspervmerle gmail com>
Date:   Tue Aug 13 23:11:50 2019 +0200

    gnu_cobol: implement get_latest_version

 lib/docs/scrapers/gnu_cobol.rb | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/lib/docs/scrapers/gnu_cobol.rb b/lib/docs/scrapers/gnu_cobol.rb
index 75d939a9..9965359d 100644
--- a/lib/docs/scrapers/gnu_cobol.rb
+++ b/lib/docs/scrapers/gnu_cobol.rb
@@ -16,5 +16,11 @@ module Docs
       Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br>
       Licensed under the GNU Free Documentation License.
     HTML
+
+    def get_latest_version(opts)
+      doc = fetch_doc('https://open-cobol.sourceforge.io/HTML/gnucobpg.html', opts)
+      title = doc.at_css('h1').content
+      title.scan(/([0-9.]+)/)[0][0]
+    end
   end
 end


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]