From 2eccb7ebd8018c01e28ba9447b1b5c2adaf7a76a Mon Sep 17 00:00:00 2001 From: Thibaut Date: Fri, 3 Apr 2015 10:59:26 -0400 Subject: [PATCH] Update Redis documentation (3.0.0) --- lib/docs/filters/redis/clean_html.rb | 4 ++-- lib/docs/filters/redis/entries.rb | 25 +++++++++++++------------ lib/docs/scrapers/redis.rb | 6 +++++- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/lib/docs/filters/redis/clean_html.rb b/lib/docs/filters/redis/clean_html.rb index 2a3f5059..8635d38b 100644 --- a/lib/docs/filters/redis/clean_html.rb +++ b/lib/docs/filters/redis/clean_html.rb @@ -4,9 +4,9 @@ module Docs def call at_css('ul')['class'] = 'commands' if root_page? - css('nav', 'aside', 'form').remove + css('nav', 'aside', 'form', '.anchor-link').remove - css('> article', 'pre > code').each do |node| + css('> article', '.article-main', 'pre > code', '.container').each do |node| node.before(node.children).remove end diff --git a/lib/docs/filters/redis/entries.rb b/lib/docs/filters/redis/entries.rb index 9c3668f5..36eeb02a 100644 --- a/lib/docs/filters/redis/entries.rb +++ b/lib/docs/filters/redis/entries.rb @@ -7,18 +7,19 @@ module Docs def get_type case at_css('aside > ul:last-child a').content.strip - when 'DEL' then 'Keys' - when 'APPEND' then 'Strings' - when 'HDEL' then 'Hashes' - when 'BLPOP' then 'Lists' - when 'SADD' then 'Sets' - when 'ZADD' then 'Sorted Sets' - when 'PSUBSCRIBE' then 'Pub/Sub' - when 'DISCARD' then 'Transactions' - when 'EVAL' then 'Scripting' - when 'AUTH' then 'Connection' - when 'BGREWRITEAOF' then 'Server' - when 'PFADD' then 'HyperLogLog' + when 'DEL' then 'Keys' + when 'APPEND' then 'Strings' + when 'HDEL' then 'Hashes' + when 'BLPOP' then 'Lists' + when 'SADD' then 'Sets' + when 'ZADD' then 'Sorted Sets' + when 'PSUBSCRIBE' then 'Pub/Sub' + when 'DISCARD' then 'Transactions' + when 'EVAL' then 'Scripting' + when 'AUTH' then 'Connection' + when 'BGREWRITEAOF' then 'Server' + when 'PFADD' then 'HyperLogLog' + when 'CLUSTER ADDSLOTS' then 'Cluster' else 'Miscellaneous' end end diff --git a/lib/docs/scrapers/redis.rb b/lib/docs/scrapers/redis.rb index 5b11d1d2..e39fe69d 100644 --- a/lib/docs/scrapers/redis.rb +++ b/lib/docs/scrapers/redis.rb @@ -1,8 +1,12 @@ module Docs class Redis < UrlScraper self.type = 'redis' - self.version = 'up to 2.8.19' + self.version = 'up to 3.0.0' self.base_url = 'http://redis.io/commands' + self.links = { + home: 'http://redis.io/', + code: 'https://github.com/antirez/redis' + } html_filters.push 'redis/entries', 'redis/clean_html', 'title'