From e3ef139111e017c7e997d5eed4ab9c618c231f18 Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sat, 24 Mar 2018 11:35:31 -0400 Subject: [PATCH] Fix path encoding issues in C/C++ scraper Fixes #767. --- lib/docs/core/filter.rb | 4 +++- lib/docs/scrapers/c.rb | 2 +- lib/docs/scrapers/cpp.rb | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/docs/core/filter.rb b/lib/docs/core/filter.rb index 6447b565..bbc7135e 100644 --- a/lib/docs/core/filter.rb +++ b/lib/docs/core/filter.rb @@ -103,7 +103,9 @@ module Docs end def clean_path(path) - path.gsub %r{[!;:]+}, '-' + path = path.gsub %r{[!;:]}, '-' + path = path.gsub %r{\+}, '_plus_' + path end end end diff --git a/lib/docs/scrapers/c.rb b/lib/docs/scrapers/c.rb index 27897792..e90b3679 100644 --- a/lib/docs/scrapers/c.rb +++ b/lib/docs/scrapers/c.rb @@ -1,7 +1,7 @@ module Docs class C < FileScraper self.type = 'c' - self.dir = '/Users/Thibaut/DevDocs/Docs/C/c' + self.dir = '/Users/Thibaut/DevDocs/Docs/c' self.base_url = 'http://en.cppreference.com/w/c/' self.root_path = 'header.html' diff --git a/lib/docs/scrapers/cpp.rb b/lib/docs/scrapers/cpp.rb index 5b801017..819fd626 100644 --- a/lib/docs/scrapers/cpp.rb +++ b/lib/docs/scrapers/cpp.rb @@ -3,7 +3,7 @@ module Docs self.name = 'C++' self.slug = 'cpp' self.type = 'c' - self.dir = '/Users/Thibaut/DevDocs/Docs/C/cpp' + self.dir = '/Users/Thibaut/DevDocs/Docs/cpp' self.base_url = 'http://en.cppreference.com/w/cpp/' self.root_path = 'header.html'