popper 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5ac30214a916f0962b5f8b88e1e0f6698e2bc2e485b1d02ba647320f3b4c453
4
- data.tar.gz: '049009d993c8742f2d95186a07a34ad46035ecd0ffd93f45be73143bfc901ed7'
3
+ metadata.gz: 7241d920f1cc1df768881863fd35b016df55897ab00eac6be95afe59e59a392b
4
+ data.tar.gz: a4a80773306057f341999e6deedce2ed8688a4e81006be9b4fe3f0e6c23ba98e
5
5
  SHA512:
6
- metadata.gz: c15e126ecc4d08c3fff23ef776e963e400e1d76215efddecadf82ba47efabe53ae3eb1b3629e953f531e5e36199b03da603837d02348cd5f966c8251c6f93fac
7
- data.tar.gz: 8213f20cd9639848b0207621cde29ee2cf526621b55204005162151623238843f54a26b66c5c1a07d4d506e83c65701c4f6a2aef687ca546822657b1fc34592f
6
+ metadata.gz: c2fdc66898ca3b56790fd5a266888c9162ce0ab7b62edd13ba5c613999863d431131e07d400f4f19d76753987a0cac568a338bf46fde51e16632fb41d4ffc89a
7
+ data.tar.gz: 814434364ccb6c25d3d9bd3a328d5707644741377947417f127bc3299d2329d16f0b81251c29e43ac8e96c174bafece2e2f7700737e6a86ab1e5ac7425fd765f
@@ -7,13 +7,13 @@ module Popper
7
7
  attr_accessor :config, :current_list, :complete_list
8
8
 
9
9
  def initialize(config)
10
- self.config = config
10
+ @config = config
11
11
  end
12
12
 
13
13
  def run
14
14
  session_start do |conn|
15
- self.current_list = conn.mails.map(&:uidl)
16
- self.complete_list = current_list unless complete_list
15
+ @current_list = conn.mails.map(&:uidl)
16
+ @complete_list ||= @current_list
17
17
  pop(conn)
18
18
  end
19
19
  rescue StandardError => e
@@ -27,10 +27,12 @@ module Popper
27
27
  Popper.log.info "start popper #{config.name}"
28
28
 
29
29
  process_uidl_list(conn).each do |m|
30
+ uidl = m.uidl
31
+ Popper.log.info "pop mail:#{uidl}"
30
32
  done_uidls << check_and_action(m)
31
33
  m.delete if config.login.respond_to?(:delete_after) && config.login.delete_after
32
34
  rescue Net::POPError => e
33
- self.complete_list += done_uidls
35
+ @complete_list += done_uidls
34
36
  Popper.log.warn 'pop err write uidl'
35
37
  return
36
38
  rescue StandardError => e
@@ -38,8 +40,8 @@ module Popper
38
40
  Popper.log.warn e
39
41
  end
40
42
 
41
- self.complete_list = current_list - error_uidls
42
- Popper.log.info "success popper #{config.name}"
43
+ @complete_list = @current_list - error_uidls
44
+ Popper.log.info "success popper #{config.name} current_list:#{@current_list.size} complete_list:#{@complete_list.size}"
43
45
  end
44
46
 
45
47
  def check_and_action(m)
@@ -79,7 +81,7 @@ module Popper
79
81
  end
80
82
 
81
83
  def process_uidl_list(conn)
82
- uidl_list = current_list - complete_list
84
+ uidl_list = @current_list - @complete_list
83
85
  conn.mails.select { |_m| uidl_list.include?(_m.uidl) }
84
86
  end
85
87
 
@@ -1,3 +1,3 @@
1
1
  module Popper
2
- VERSION = '0.6.3'
2
+ VERSION = '0.6.4'
3
3
  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.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyama86