autoargs 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/autoargs.rb +15 -1
- data/lib/autoargs/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 502f724729419214c0af5d86d50c6371271b3fde
|
4
|
+
data.tar.gz: a338149ff475a7203a1be9204362361ae95371ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1667290d793870b36d116376b7b39393f7adae93c8d18510782c317522f112c6b8c47b02aa8add11d52890376398b4b080754e0ec6fc79571a7789ad616bebf
|
7
|
+
data.tar.gz: 4172304bfece8158a3d867af5376a0b70b8a4ae2856091764d03a02fc5b58498a5fa847727ec3542fa94c679c19a0ef32a4a70a3ef581a31a9054dbe8b202c12
|
data/lib/autoargs.rb
CHANGED
@@ -1,5 +1,19 @@
|
|
1
|
+
def self.silently
|
2
|
+
begin
|
3
|
+
orig_stdout = $stdout.dup
|
4
|
+
orig_stderr = $stderr.dup
|
5
|
+
$stdout.reopen('/dev/null', 'w')
|
6
|
+
$stderr.reopen('/dev/null', 'w')
|
7
|
+
r = yield
|
8
|
+
ensure
|
9
|
+
$stdout.reopen(orig_stdout)
|
10
|
+
$stderr.reopen(orig_stderr)
|
11
|
+
end
|
12
|
+
r
|
13
|
+
end
|
14
|
+
|
1
15
|
require 'autoargs/version'
|
2
|
-
require 'parser/current'
|
16
|
+
silently { require 'parser/current' } # silence warnings
|
3
17
|
|
4
18
|
module Autoargs
|
5
19
|
def self.run(method)
|
data/lib/autoargs/version.rb
CHANGED