banana_peels 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: e808ac0025039ccf838899d253d539202a65d774
4
- data.tar.gz: f5179fcc94851d3a16ba944e5e02ce7212dc98ee
3
+ metadata.gz: bfec30f7711bbbe46112847f564156766b08f91e
4
+ data.tar.gz: b481dd4bdaff1931a9facc1a8202bda8f6e727ce
5
5
  SHA512:
6
- metadata.gz: 4b9980108bd56b187debbe09d3eb537226f88bcf353b024aa365725cf3a74d6a46747d9ba54d8b1f27c3ae5b80b23bed13c024839ca993239ef45e01a595e44c
7
- data.tar.gz: 9590126f26b371232de2d9c63cbaeae028b0fe873303d7207e2872fcd57554b49ccfd4b52e8d4243aea86711968341435aeb9ff2b15c6b0bd7f74c3d26ac93ef
6
+ metadata.gz: 33261e9df50f7d9b4410a096cc2a0234c18967b7e98bbad86ba57e7f27300abcc939b47ab343a8d5067481700f9c43b530efd455f882c1d56518368e7dded016
7
+ data.tar.gz: 5053899176347238be777ac26c8eb9e8b3b06561f2ee996cf52a2182d19cd36f2493bc1a53b0d042baeb979dc2a8a17635cb0a175eb10472d5e3e769890625de
data/README.md CHANGED
@@ -57,7 +57,7 @@ table
57
57
  td
58
58
  strong = @env_vars[c.id].join(', ')
59
59
  | |
60
- = c.merge_tags_in_content.keys.join(', ')
60
+ = c.merge_tags_in_content(exclude:[ :to_name ]).keys.join(', ')
61
61
  tr
62
62
  td rowspan="4"
63
63
  th Subject
@@ -65,14 +65,20 @@ class BananaPeels::Campaign
65
65
  replace_merge_tags(mailchimp_meta['to_name'])
66
66
  end
67
67
 
68
- def merge_tags_in_content
68
+ def merge_tags_in_content(options=nil)
69
+ options ||= {}
70
+ excludes = options[:exclude] || []
69
71
  merge_tags = Hash.new{|h,k| h[k] = [] }
70
- {
71
- to: mailchimp_meta['to_name'],
72
+ contents = {
73
+ to_name: mailchimp_meta['to_name'],
72
74
  subject: mailchimp_meta['subject'],
73
75
  html: html_content_unmerged,
74
76
  text: text_content_unmerged,
75
- }.each do |location, content|
77
+ }
78
+ excludes.each do |ex|
79
+ contents.delete(ex)
80
+ end
81
+ contents.each do |location, content|
76
82
  find_merge_tags_in(content).each do |tag|
77
83
  merge_tags[tag].push(location)
78
84
  end
@@ -1,3 +1,3 @@
1
1
  module BananaPeels
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: banana_peels
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Bull