Permalink
Browse files

Slightly more intention revealing line cleaning

  • Loading branch information...
technicalpickles committed Sep 8, 2012
1 parent df14bfe commit 1a916271cccffd3ab4815094fb3ec090d9b6e574
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/robot.coffee
View
@@ -260,8 +260,8 @@ class Robot
for line in body.split "\n"
break unless line[0] is '#' or line.substr(0, 2) is '//'
- # remove leading '# '
- cleanedLine = line[2..line.length].replace("\n", "").trim()
+ # remove leading comment
+ cleanedLine = line.replace(/^(#|\/\/)\s?/, "").trim()
@logger.debug "parseHelp(#{scriptName}): read #{cleanedLine}"
continue if cleanedLine.length is 0
@@ -279,6 +279,7 @@ class Robot
scriptDocumentation[currentSection].push cleanedLine.trim()
if currentSection == 'commands'
@commands.push cleanedLine.trim()
+
# no current section? probably using old style documentation
if currentSection is null
@logger.info "#{path} is using deprecated documentation syntax"

0 comments on commit 1a91627

Please sign in to comment.