Skip to content

Commit ad1164a

Browse files
author
jneen
committed
silence warnings from the ancient net/dav library
1 parent 96eaf27 commit ad1164a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

tasks/builtins/apache.rake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# -*- coding: utf-8 -*- #
22
# frozen_string_literal: true
33

4+
require_relative '../task_helper'
5+
46
# backcompat for ancient net/dav lib
57
def File.exists?(p)
68
File.exist?(p)
79
end
810

9-
require 'open-uri'
10-
require_relative '../task_helper'
11+
# And it still warns a lot.
12+
silence_warnings { require 'net/dav' }
13+
1114
require 'nokogiri'
1215
require 'svn/downloader'
1316

tasks/task_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
require 'open-uri'
22

3+
def silence_warnings
4+
old_verbose, $VERBOSE = $VERBOSE, false
5+
yield
6+
ensure
7+
$VERBOSE = old_verbose
8+
end
9+
310
class BuiltinsGenerator
411
def self.process(fname, *a)
512
new(*a).process(fname)

0 commit comments

Comments
 (0)