warning_filter 0.0.3 → 0.0.4

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 +5 -5
  2. data/lib/warning_filter/filter.rb +27 -0
  3. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4f825b7a324d22eca16366382751c7fc6c3ae4a8
4
- data.tar.gz: de933386ab5a7c1cabf17199cc7b8473f4485326
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: 7453725e21ef8ab59a214507bc310f86d4644cb8
4
+ data.tar.gz: b711049605b5741dc7ff30759310712eee35f86f
5
5
  SHA512:
6
- metadata.gz: 8c5a170e552b6405fb611ce03672e40cdc580ad1adbf9249626d721f2490f26ba97aa0c6020a3e4455b0be6e6775a89928ea9d49e79301a8b1e1e65d77f5afa1
7
- data.tar.gz: 41b87c3a9d1c3f1b5b8b171e3c12d3792e0a41e043fdde54bd8b39bd5e04829872744eff29731e7a772b83dbf086f3807dceb6cf3a243dfc15c06c3f04f8aea0
6
+ metadata.gz: 3952e52f659d6e0cd24501a1ee95f520de5afb37091c96e1beddc501bab77839048a4465efb6838f8a35c9b54abce41a2ee96ea079007cc24d8b974b2006d880
7
+ data.tar.gz: 5c505aa6b35745f8e4c7d8cab61dc196ad15d28a0b52b37d3449e6c5d6a3a2fc49376aab8d7e0e3414b39ad3347fee0bbcbae123947f56061276bf81450eb3f8
@@ -0,0 +1,27 @@
1
+ module WarningFilter
2
+ class Filter
3
+ def initialize(io)
4
+ @io = io
5
+ end
6
+
7
+ def write(line)
8
+ unless warning_from_gem?(line)
9
+ @io.write(line)
10
+ end
11
+ end
12
+
13
+ protected
14
+
15
+ def warning_from_gem?(line)
16
+ warning?(line) && from_gem?(line)
17
+ end
18
+
19
+ def warning?(line)
20
+ line.include?("warning")
21
+ end
22
+
23
+ def from_gem?(line)
24
+ Gem.path.any? { |path| line.include?(path) }
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warning_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grayson Wright
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-16 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Filter out warnings from gems so you can focus on your own problems.
14
14
  email: wright.grayson@gmail.com
@@ -17,6 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/warning_filter.rb
20
+ - lib/warning_filter/filter.rb
20
21
  homepage: https://github.com/graysonwright/warning_filter
21
22
  licenses:
22
23
  - MIT
@@ -27,17 +28,17 @@ require_paths:
27
28
  - lib
28
29
  required_ruby_version: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ">="
31
+ - - ! '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  required_rubygems_version: !ruby/object:Gem::Requirement
34
35
  requirements:
35
- - - ">="
36
+ - - ! '>='
36
37
  - !ruby/object:Gem::Version
37
38
  version: '0'
38
39
  requirements: []
39
40
  rubyforge_project:
40
- rubygems_version: 2.4.2
41
+ rubygems_version: 2.2.2
41
42
  signing_key:
42
43
  specification_version: 4
43
44
  summary: Only see the warnings you need to.