Skip to content

Commit 9141e23

Browse files
committed
Removes excessive logging using 'puts'. Will be improved in #323
1 parent 7a38885 commit 9141e23

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

_ext/arquillian.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ def visit(repository, site)
8181
clone_dir = File.join(repos_dir, repository.path)
8282
rc = nil
8383
if !File.directory? clone_dir
84-
puts "Cloning repository #{repository.clone_url} -> #{clone_dir}"
84+
# puts "Cloning repository #{repository.clone_url} -> #{clone_dir}"
8585
rc = Git.clone(repository.clone_url, clone_dir)
8686
if repository.master_branch.nil?
8787
rc.checkout(repository.master_branch)
8888
else
8989
repository.master_branch = rc.current_branch
9090
end
9191
else
92-
puts "Using cloned repository #{clone_dir}"
92+
# puts "Using cloned repository #{clone_dir}"
9393
rc = Git.open(clone_dir)
9494
master_branch = repository.master_branch
9595
if master_branch.nil?

_ext/common.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# -*- encoding : utf-8 -*-
2+
23
def getOrCache(tmp_file, url)
34
response_body = ""
45
if !File.exist?tmp_file
5-
puts url
6+
# puts url
67
response_body = RestClient.get(url, :cache => false) { |response, request, result, &block|
78
case response.code
89
when 404
@@ -23,7 +24,7 @@ def getOrCache(tmp_file, url)
2324
def getOrCacheJSON(tmp_file, json_url)
2425
json = {}
2526
if !File.exist?tmp_file
26-
puts 'Grabbing ' + json_url
27+
# puts 'Grabbing ' + json_url
2728
response_body = RestClient.get(json_url, :cache => false, :accept => 'application/json') { |response, request, result, &block|
2829
case response.code
2930
when 404
@@ -42,7 +43,7 @@ def getOrCacheJSON(tmp_file, json_url)
4243
begin
4344
json = JSON.parse File.read(tmp_file)
4445
rescue => e
45-
puts 'Could not parse JSON file ' + tmp_file + '; ' + e
46+
# puts 'Could not parse JSON file ' + tmp_file + '; ' + e
4647
json = {}
4748
end
4849
end

_ext/guide.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def transform(site, page, rendered)
130130

131131
# Wrap <div class="header"> around the h2 section
132132
# If you can do this more efficiently, feel free to improve it
133-
puts page_content
133+
# puts page_content
134134
guide_content = guide_root.search('.titlebar').first.parent
135135
indent = get_indent(get_depth(guide_content) + 2)
136136
in_header = true

_ext/identities.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def lookup_by_contributor(contributor)
8282
# identity = lookup_by_name(contributor.name) if identity.nil?
8383
if identity.nil?
8484
# Indication that we have a mismatched account
85-
puts "Could not find contributor with e-mail " + contributor.email
85+
# puts "Could not find contributor with e-mail " + contributor.email
8686
end
8787
identity
8888
end
@@ -91,7 +91,7 @@ def lookup_by_contributor_email(email)
9191
identity = self.find {|e| e.contributor and e.contributor.emails and e.contributor.emails.include? email }
9292
if identity.nil?
9393
# Indication that we have a mismatched account
94-
puts "Could not find contributor with e-mail " + email
94+
# puts "Could not find contributor with e-mail " + email
9595
end
9696
identity
9797
end

_ext/lanyrd.rb

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def execute(site)
6767
begin
6868
page1 = Nokogiri::HTML(getOrCache(File.join(@lanyrd_tmp, "search-#{@term}-1.html"), search_url))
6969
rescue => e
70+
# In case lanyrd is down... which is not that rare
7071
puts e
7172
site.sessions = []
7273
return

_ext/restclient_extensions.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def execute(&block)
4646
end
4747

4848
if response.nil?
49-
puts 'Fetching ' + self.url
49+
# puts 'Fetching ' + self.url
5050
response = _execute &block
5151
instances.each do |instance|
5252
instance.cache_miss(response) if instance.respond_to? 'cache_miss'
@@ -150,7 +150,7 @@ class << cachedResponse
150150
def cache_miss(response)
151151
if response.code == 200 and @cache and @request.method.eql? 'get' and
152152
@redirects.eql? @request.headers[:redirects] and !response.body.empty?
153-
puts "Cache miss because #{@cache_file} is missing or expired"
153+
# puts "Cache miss because #{@cache_file} is missing or expired"
154154
FileUtils.mkdir_p(File.dirname @cache_file)
155155
begin
156156
File.open(@cache_file, 'w:UTF-8') do |out|

0 commit comments

Comments
 (0)