popper 0.4.1 → 0.4.2

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
- SHA1:
3
- metadata.gz: 187ce2bfa04e7e4e93dcb54d86c2dc89519adb27
4
- data.tar.gz: 424a05a87739b1521318237b45a21eeb6cfa7cd7
2
+ SHA256:
3
+ metadata.gz: 1f177574cbba416abc0f15dbfb541ac2ae23673fb8ec6e9be01cee28c8f06f6d
4
+ data.tar.gz: d1b341b3f9c1c9a0585ce8014fc505bafc27e82d1427e82bfb6fd2139885f4a0
5
5
  SHA512:
6
- metadata.gz: fa7432bf5a1123101ffb791c545977488925caf2e719ade9d934d68ce599d877974d3092b2d7e68890b0e06b551d8ce308727e675559898ff42ed36e2d69ede4
7
- data.tar.gz: 43186b300d72f4e04acf0b3fb835327200ae18b5dc3c21ad290c7e551cfddad3555363f5c948330b52e74fb8052be1113b43bc09ff75d38808318cefe0635369
6
+ metadata.gz: d01e96981d57441ed98fe50ed76d7245b37f9117099a371cdd3090fa7574e1e90cc26645bd8be32b12852c80cfec7518d510e2e526fbfc0f8415c8eac4f0a0e5
7
+ data.tar.gz: 4179b85dcb9b0d32ae5e68e9d2dd810bcf4e10c7de241d26b9f262fda8447b1258b078d496e1845a273dfe25a151933e4fe6c73e6d9ad63cf40d6b9379f0d33b
data/lib/popper/config.rb CHANGED
@@ -56,7 +56,7 @@ module Popper
56
56
  end
57
57
 
58
58
  [
59
- %w(find all?),
59
+ %w(select all?),
60
60
  %w(each each),
61
61
  ].each do |arr|
62
62
  define_method("rule_with_conditions_#{arr[0]}") do |&blk|
@@ -47,7 +47,7 @@ module Popper
47
47
  def check_and_action(m)
48
48
  mail = EncodeMail.new(m.mail)
49
49
  Popper.log.info "check mail:#{mail.date.to_s} #{mail.subject}"
50
- if rule = match_rule?(mail)
50
+ match_rules?(mail).each do |rule|
51
51
  Popper.log.info "do action:#{mail.subject}"
52
52
  Popper::Action::ExecCmd.run(config.action_by_rule(rule), mail) if config.action_by_rule(rule)
53
53
  end
@@ -85,8 +85,8 @@ module Popper
85
85
  conn.mails.select {|_m|uidl_list.include?(_m.uidl)}
86
86
  end
87
87
 
88
- def match_rule?(mail)
89
- config.rule_with_conditions_find do |rule,mail_header,conditions|
88
+ def match_rules?(mail)
89
+ config.rule_with_conditions_select do |rule,mail_header,conditions|
90
90
  conditions.all? do |condition|
91
91
  mail.respond_to?(mail_header) && mail.send(mail_header).to_s.match(/#{condition}/)
92
92
  end
@@ -1,3 +1,3 @@
1
1
  module Popper
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: popper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyama86
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-19 00:00:00.000000000 Z
11
+ date: 2018-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 2.6.13
176
+ rubygems_version: 2.7.6
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: email notification tool