You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cu...@apache.org on 2019/05/06 14:04:55 UTC

[whimsy] 02/03: Strip spaces and have caller provide path

This is an automated email from the ASF dual-hosted git repository.

curcuru pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit adea2853370a2b3f990e510222cb5522843d473d
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Mon May 6 10:04:29 2019 -0400

    Strip spaces and have caller provide path
---
 tools/wwwdocs.rb | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/wwwdocs.rb b/tools/wwwdocs.rb
index 09b5169..79a3b09 100755
--- a/tools/wwwdocs.rb
+++ b/tools/wwwdocs.rb
@@ -83,8 +83,8 @@ end
 
 # Read repository.yml for all :svn dirs names to scan for
 # @return [['private1', 'privrepo2', ...], ['public1', 'pubrepo2', ...]
-def read_repository()
-  svn = YAML.load_file('../repository.yml')[:svn]
+def read_repository(repofile)
+  svn = YAML.load_file(repofile)[:svn]
   repos = [[], []]
   svn.each do |repo, data|
     data['url'] =~ IS_PRIVATE ? repos[0] << repo : repos[1] << repo
@@ -109,9 +109,9 @@ def scan_file_svn(f, regexs)
   begin
     File.open(f).each_line.map(&:chomp).each do |line|
       if line =~ regexs[0] then
-        repos[0] << line
+        repos[0] << line.strip
       elsif line =~ regexs[1] then
-        repos[1] << line
+        repos[1] << line.strip
       end
     end
     return repos
@@ -132,4 +132,3 @@ def scan_dir_svn(dir, regexs)
   end
   return links
 end
-