warning_filter 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/warning_filter/filter.rb +27 -0
- metadata +6 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 2 | 
            +
            !binary "U0hBMQ==":
         | 
| 3 | 
            +
              metadata.gz: 7453725e21ef8ab59a214507bc310f86d4644cb8
         | 
| 4 | 
            +
              data.tar.gz: b711049605b5741dc7ff30759310712eee35f86f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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. | 
| 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- | 
| 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. | 
| 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.
         |