popper 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c3c075a3c44288b2c8f7ed3e5dd890ef946f2bd
4
- data.tar.gz: b60b17cfa8c19e4fda90dd8d6ab9639072744fb6
3
+ metadata.gz: f7232ff188e9e7483abf67f901bac0066af3cf11
4
+ data.tar.gz: ce479bb8379e9cba23f98a91c7f08c644058409e
5
5
  SHA512:
6
- metadata.gz: 15c20311b6c773f3744f99c7909dbda33a3df4cca2dd2b49fac0af3196e65426494ff70ee18828ceca365af157dd492d174c315004bb4f0b9e280636cc6dd5b9
7
- data.tar.gz: b8abc1581a23478b5806580dcce98660c9135d7da6e08bf90b21c1e198504019b666983d525f3c49a145714c06e42db7d581b8bdb556d6f3140c6a15d9b58437
6
+ metadata.gz: 537aa5adb32b996c1c3ad3a19f959219ac66e3f8d58e2306760cc2ea36f09a3ca425db32c3cf4a160965fb4fb4c6e6406ea90317b2d3bea2cbf3b60eea7a72ce
7
+ data.tar.gz: 38d5d81059b220718748d12a59e9abec2d804677dc078a007561eab02b09f8c89b21fd48b7687dabe6b72160c60b4c04948c5f985f1b1d69bfc85d3786353a8c
data/lib/popper/cli.rb CHANGED
@@ -60,7 +60,7 @@ module Popper
60
60
  last_rule = nil
61
61
  last_header = nil
62
62
 
63
- config.rule_with_conditions_all? do |rule,mail_header,condition|
63
+ config.rule_with_conditions_each do |rule,mail_header,condition|
64
64
  puts " "*1 + "rule[#{rule}]" if rule != last_rule
65
65
  puts " "*2 + "actions" if rule != last_rule
66
66
 
@@ -71,12 +71,11 @@ module Popper
71
71
  end
72
72
  end if rule != last_rule
73
73
 
74
- puts " "*2 + "header[#{mail_header}]" if mail_header != last_header
74
+ puts " "*2 + "header[#{mail_header}]"
75
75
  puts " "*3 + "#{condition}"
76
76
 
77
77
  last_rule = rule
78
78
  last_header = mail_header
79
- true
80
79
  end
81
80
  end
82
81
  end
data/lib/popper/config.rb CHANGED
@@ -74,6 +74,14 @@ module Popper
74
74
  end
75
75
  end
76
76
  end
77
+
78
+ def rule_with_conditions_each(&block)
79
+ rules.to_h.keys.each do |rule|
80
+ condition_by_rule(rule).to_h.each do |mail_header,conditions|
81
+ block.call(rule, mail_header, conditions)
82
+ end
83
+ end
84
+ end
77
85
  end
78
86
 
79
87
  def self.load_config(options)
@@ -1,3 +1,3 @@
1
1
  module Popper
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyama86