From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.8 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: olddoc-public@80x24.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id B144E63386B for ; Thu, 15 Oct 2015 01:04:57 +0000 (UTC) From: Eric Wong To: olddoc-public@80x24.org Subject: [PATCH 3/3] readme: relax dependency on RDoc formatting Date: Thu, 15 Oct 2015 01:04:53 +0000 Message-Id: <20151015010453.24454-4-e@80x24.org> In-Reply-To: <20151015010453.24454-1-e@80x24.org> References: <20151015010453.24454-1-e@80x24.org> List-Id: Some projects I maintain do not use RDoc and rely entirely on plain-text documentation. This allows "olddoc prepare" to run properly on projects which do not use RDoc but still use a README file where the title is the first line. --- lib/olddoc/readme.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/olddoc/readme.rb b/lib/olddoc/readme.rb index 18f0205..e593517 100644 --- a/lib/olddoc/readme.rb +++ b/lib/olddoc/readme.rb @@ -16,9 +16,9 @@ def readme_description # parses the README file in the top-level directory for project metadata def readme_metadata l = File.readlines(readme_path)[0].strip! - l.gsub!(/^=\s+/, '') or abort "#{l.inspect} doesn't start with '='" + l.gsub!(/^=\s+/, '') title = l.dup - if l.gsub!(/^(\w+\!)\s+/, '') # Rainbows! + if l.gsub!(/^(\w+\!)\s+/, '') # special case for Rainbows! return $1, l, title else return (l.split(/\s*[:-]\s*/, 2)).push(title) -- EW