popper 0.6.4 → 0.6.5
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/popper/version.rb +1 -1
- data/lib/popper.rb +52 -9
- 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: 4de4bcbe9303ab959c01fd28fd85f0f2dc1caae813453051d516a09d4022e715
         | 
| 4 | 
            +
              data.tar.gz: 3c52de4d26a5c4eb4586419ef38ae617f94dc3da891b5a657a7aef2f420b6129
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 4c7473685a393b108d83a45724b307e6a62c09f22b280b4621e889e054b2ec9ec516fd299106e0175a53a78f7b17abc08c10cee5503b2788af229870b3dc06ca
         | 
| 7 | 
            +
              data.tar.gz: c89d577059817b392d8560ac9a5eba430eb98afdb2156b2f3d4d632fc481e34ea4e77107d41938cd53745483ec805019af246deb0c63a26bbe14f9a61ca2bbe4
         | 
    
        data/lib/popper/version.rb
    CHANGED
    
    
    
        data/lib/popper.rb
    CHANGED
    
    | @@ -1,17 +1,17 @@ | |
| 1 1 | 
             
            require 'pp'
         | 
| 2 | 
            -
            require  | 
| 3 | 
            -
            require  | 
| 2 | 
            +
            require 'popper/version'
         | 
| 3 | 
            +
            require 'popper/cli'
         | 
| 4 4 | 
             
            require 'popper/mail_account'
         | 
| 5 | 
            -
            require  | 
| 6 | 
            -
            require  | 
| 7 | 
            -
            require  | 
| 5 | 
            +
            require 'popper/config'
         | 
| 6 | 
            +
            require 'popper/action'
         | 
| 7 | 
            +
            require 'popper/init'
         | 
| 8 8 |  | 
| 9 9 | 
             
            module Popper
         | 
| 10 | 
            -
              def self.init_logger(options, stdout=nil)
         | 
| 11 | 
            -
                log_path = options[:log] ||  | 
| 12 | 
            -
                log_path = STDOUT if ENV[ | 
| 10 | 
            +
              def self.init_logger(options, stdout = nil)
         | 
| 11 | 
            +
                log_path = options[:log] || '/var/log/popper.log'
         | 
| 12 | 
            +
                log_path = STDOUT if ENV['POPPER_TEST'] || stdout
         | 
| 13 13 | 
             
                @_logger = Logger.new(log_path)
         | 
| 14 | 
            -
              rescue => e
         | 
| 14 | 
            +
              rescue StandardError => e
         | 
| 15 15 | 
             
                puts e
         | 
| 16 16 | 
             
              end
         | 
| 17 17 |  | 
| @@ -19,3 +19,46 @@ module Popper | |
| 19 19 | 
             
                @_logger
         | 
| 20 20 | 
             
              end
         | 
| 21 21 | 
             
            end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
            # ref: https://github.com/ruby/net-pop/issues/27
         | 
| 24 | 
            +
            module Net
         | 
| 25 | 
            +
              class POP3Command
         | 
| 26 | 
            +
                def list
         | 
| 27 | 
            +
                  critical do
         | 
| 28 | 
            +
                    getok 'LIST'
         | 
| 29 | 
            +
                    list = []
         | 
| 30 | 
            +
                    @socket.each_list_item do |line|
         | 
| 31 | 
            +
                      if line.split(' ').size != 2
         | 
| 32 | 
            +
                        num, uid = line.split(' ')[2..3]
         | 
| 33 | 
            +
                        list.push [num.to_i, uid.to_i]
         | 
| 34 | 
            +
                      end
         | 
| 35 | 
            +
                      m = /\A(\d+)[ \t]+(\d+)/.match(line) or
         | 
| 36 | 
            +
                        raise POPBadResponse, "bad response: #{line}"
         | 
| 37 | 
            +
                      list.push [m[1].to_i, m[2].to_i]
         | 
| 38 | 
            +
                    end
         | 
| 39 | 
            +
                    return list
         | 
| 40 | 
            +
                  end
         | 
| 41 | 
            +
                end
         | 
| 42 | 
            +
             | 
| 43 | 
            +
                def uidl(num = nil)
         | 
| 44 | 
            +
                  if num
         | 
| 45 | 
            +
                    res = check_response(critical { get_response('UIDL %d', num) })
         | 
| 46 | 
            +
                    res.split(/ /)[1]
         | 
| 47 | 
            +
                  else
         | 
| 48 | 
            +
                    critical do
         | 
| 49 | 
            +
                      getok('UIDL')
         | 
| 50 | 
            +
                      table = {}
         | 
| 51 | 
            +
                      @socket.each_list_item do |line|
         | 
| 52 | 
            +
                        if line.split(' ').size == 4
         | 
| 53 | 
            +
                          num, uid = line.split(' ')[2..3]
         | 
| 54 | 
            +
                          table[num.to_i] = uid
         | 
| 55 | 
            +
                        end
         | 
| 56 | 
            +
                        num, uid = line.split(' ')
         | 
| 57 | 
            +
                        table[num.to_i] = uid
         | 
| 58 | 
            +
                      end
         | 
| 59 | 
            +
                      return table
         | 
| 60 | 
            +
                    end
         | 
| 61 | 
            +
                  end
         | 
| 62 | 
            +
                end
         | 
| 63 | 
            +
              end
         | 
| 64 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: popper
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.6. | 
| 4 | 
            +
              version: 0.6.5
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - pyama86
         | 
| @@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 217 217 | 
             
                - !ruby/object:Gem::Version
         | 
| 218 218 | 
             
                  version: '0'
         | 
| 219 219 | 
             
            requirements: []
         | 
| 220 | 
            -
            rubygems_version: 3. | 
| 220 | 
            +
            rubygems_version: 3.5.11
         | 
| 221 221 | 
             
            signing_key:
         | 
| 222 222 | 
             
            specification_version: 4
         | 
| 223 223 | 
             
            summary: email notification tool
         |