aix-errlog 2.0.1 → 3.0.0
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 +4 -4
- data/lib/aix/errlog/errlog.rb +19 -31
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 404bdf1773251d2dddc2bcbed19fd732aaac713a512aaea3ebfbd223a437d1bc
         | 
| 4 | 
            +
              data.tar.gz: c255466b7665a34794feca02154e087b5c8f67213256b3c7f26fa3215f78fd5e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b004d8202d1d9ee1b22b283fe436717f4b2f5d8d54b0461556e4cc4469e7cba3000427cd53f61bb19ad52f0f395b272a82571931871c2f6e4dc2e4b2c5a1c0f7
         | 
| 7 | 
            +
              data.tar.gz: 35020c61378de98cf4edb993527fa4b6bc80552386b46e1c1db777240fff9cb13711a67ed028335d2cd43e50fcb0b19f28faccc1f5d7f7ce2309929f50d0313c
         | 
    
        data/lib/aix/errlog/errlog.rb
    CHANGED
    
    | @@ -46,16 +46,16 @@ module AIX | |
| 46 46 | 
             
                #   require 'aix/errlog'
         | 
| 47 47 | 
             
                #
         | 
| 48 48 | 
             
                #   AIX::Errlog.open do |log|
         | 
| 49 | 
            -
                #     log.forward_each(log.match {
         | 
| 50 | 
            -
                #       label.include?('KILL') & (
         | 
| 49 | 
            +
                #     log.forward_each(log.match {|m|
         | 
| 50 | 
            +
                #       m.label.include?('KILL') & (
         | 
| 51 51 | 
             
                #         (
         | 
| 52 | 
            -
                #           (sequence > 1000) &
         | 
| 53 | 
            -
                #           (timestamp >= DateTime.new(2017, 1, 1)) &
         | 
| 54 | 
            -
                #           (timestamp < DateTime.new(2017, 2, 1))
         | 
| 52 | 
            +
                #           (m.sequence > 1000) &
         | 
| 53 | 
            +
                #           (m.timestamp >= DateTime.new(2017, 1, 1)) &
         | 
| 54 | 
            +
                #           (m.timestamp < DateTime.new(2017, 2, 1))
         | 
| 55 55 | 
             
                #         ) | (
         | 
| 56 | 
            -
                #           (sequence < 500) &
         | 
| 57 | 
            -
                #           (timestamp >= DateTime.new(2016, 12, 1)) &
         | 
| 58 | 
            -
                #           (timestamp < DateTime.new(2017, 1, 1))
         | 
| 56 | 
            +
                #           (m.sequence < 500) &
         | 
| 57 | 
            +
                #           (m.timestamp >= DateTime.new(2016, 12, 1)) &
         | 
| 58 | 
            +
                #           (m.timestamp < DateTime.new(2017, 1, 1))
         | 
| 59 59 | 
             
                #         )
         | 
| 60 60 | 
             
                #       )
         | 
| 61 61 | 
             
                #     }).map(&:label)
         | 
| @@ -201,33 +201,21 @@ module AIX | |
| 201 201 | 
             
                  end
         | 
| 202 202 |  | 
| 203 203 | 
             
                  ##
         | 
| 204 | 
            -
                  # Used to build a match expression | 
| 205 | 
            -
                  # instance_eval on Match, so remember the semantics of block scope.  If
         | 
| 206 | 
            -
                  # you have a local +sequence+ variable, for instance, you'll need to use
         | 
| 207 | 
            -
                  # an explicit self to escape that:
         | 
| 204 | 
            +
                  # Used to build a match expression.  This simply yields the Match class.
         | 
| 208 205 | 
             
                  #
         | 
| 209 | 
            -
                  # | 
| 210 | 
            -
                  # | 
| 211 | 
            -
                  # | 
| 212 | 
            -
                  #     => 5
         | 
| 213 | 
            -
                  #     [4] pry(main)> AIX::Errlog::Errlog.match { sequence }
         | 
| 214 | 
            -
                  #     => 5
         | 
| 215 | 
            -
                  #     [5] pry(main)> AIX::Errlog::Errlog.match { self.sequence }
         | 
| 216 | 
            -
                  #     => #<AIX::Errlog::Match:0xcb7d8c03 @left=:sequence, @operator=nil, @right=nil>
         | 
| 217 | 
            -
                  #     [6] pry(main)> AIX::Errlog::Errlog.match { self.sequence > sequence }
         | 
| 218 | 
            -
                  #     => #<AIX::Errlog::Match:0x7be0bbf5 @left=:sequence, @operator=:gt, @right=5>
         | 
| 206 | 
            +
                  # A previous version of this used #instance_eval to get a modified self,
         | 
| 207 | 
            +
                  # but that caused some unsavory issues, especially in respect to instance
         | 
| 208 | 
            +
                  # variables:
         | 
| 219 209 | 
             
                  #
         | 
| 220 | 
            -
                  #  | 
| 221 | 
            -
                  #  | 
| 222 | 
            -
                  #  | 
| 210 | 
            +
                  #   [1] pry(main)> @x = 7
         | 
| 211 | 
            +
                  #   => 7
         | 
| 212 | 
            +
                  #   [2] pry(main)> Object.new.instance_eval {@x}
         | 
| 223 213 | 
             
                  #
         | 
| 224 | 
            -
                  #  | 
| 225 | 
            -
                  #  | 
| 226 | 
            -
                  #  | 
| 227 | 
            -
                  # good enough tradeoff, you can build the Match object directly through
         | 
| 228 | 
            -
                  # its public methods.
         | 
| 214 | 
            +
                  # Essentially, you could not use instance variables in the DSL, so you'd
         | 
| 215 | 
            +
                  # have to reassign everything to locals so they'd be available in the
         | 
| 216 | 
            +
                  # block.
         | 
| 229 217 | 
             
                  def self.match(&block)
         | 
| 230 | 
            -
                    Match | 
| 218 | 
            +
                    yield Match
         | 
| 231 219 | 
             
                  end
         | 
| 232 220 |  | 
| 233 221 | 
             
                  private
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: aix-errlog
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version:  | 
| 4 | 
            +
              version: 3.0.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Taylor C. Richberger
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2018-05- | 
| 11 | 
            +
            date: 2018-05-31 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: ffi
         |