shut_up 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/shut_up.rb +19 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e8e2ddf823a2e2a0f2cedf36647900b7f27e37a2
4
+ data.tar.gz: 500726c4ce54ab09a266e7f7dc0f4ac5bfad5151
5
+ SHA512:
6
+ metadata.gz: 24047c20eb564ee0f09f37a0354bf724eaaf1234ea77032b281b3d1a7dd6bcd26bc824f1b61605925d77213a368c821a4a72b6c807231990cfb31a70a274ab23
7
+ data.tar.gz: e80cb1f1bfa482f2168f898572401056a9b6ddf98fa4950d98d6eba3a3b984b71181af47f40f5674e9b1b7a5eeb17b0c879142f3d9c0945127b0e88875a154ba
data/lib/shut_up.rb ADDED
@@ -0,0 +1,19 @@
1
+ require 'stringio'
2
+
3
+ module ShutUp
4
+ def shut_up &block
5
+ original_stdout = $stdout
6
+ $stdout = StringIO.new
7
+ begin
8
+ result = yield
9
+ ensure
10
+ $stdout = original_stdout
11
+ result
12
+ end
13
+ end
14
+ end
15
+
16
+ class Object
17
+ include ShutUp
18
+ extend ShutUp
19
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shut_up
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ben Titcomb
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-02 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Suppresses standard for a block.
14
+ email: benjamin@pixelstreetinc.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/shut_up.rb
20
+ homepage: ''
21
+ licenses:
22
+ - Public Domain
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.4.5
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: shut_up
44
+ test_files: []
45
+ has_rdoc: