actionview-encoded_mail_to 1.0.6 → 1.0.7

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: 2be7e7ec2f9a72bfbd74cdb19caa9fb1b32b4e1e
4
- data.tar.gz: c09ef047805e6a175ff09bb3cac67e0217308046
3
+ metadata.gz: 7367e1bbaab46baf1d36789ecfb9555999dbbef8
4
+ data.tar.gz: 86b92cc6ab525eea60f2a151e9367246870ce49a
5
5
  SHA512:
6
- metadata.gz: 73737a026c559aed3b64a711e7ca32478c53fc3993570766a1356c0c13085f6cd06d5c73330f29e6387d6f317067b843e18d5d4b8aab0d73447a6d45dbeebcac
7
- data.tar.gz: 228c73383244b3335acbf85ccc94b2c81643ae03b74b8b47b6e818ebf5880f5f46240f507dd26af0fc13d28624b8b2a5c3f303e9059184b441363d23e7313a8a
6
+ metadata.gz: dabcd630b11d7b0363ba7bdf69346c6594b10a7ffc73ee1ae3e700bb4316f198d03463a644d99b75f741795d30fc54ee07345b30b692718bb45aacbd09530443
7
+ data.tar.gz: ac47e01b32a6623f645b79e157ff8e1e62589132e184decc95f0d4130ec94fef18b19de6fefdaa690fbb66fdecdda15a5c81d0a927a1b02aba6af9dab7f5d370
@@ -47,7 +47,7 @@ module EncodedMailTo
47
47
  # subject: "This is an example email"
48
48
  # # => <a href="mailto:me@domain.com?cc=ccaddress@domain.com&subject=This%20is%20an%20example%20email">My email</a>
49
49
  def mail_to_with_encoding(email_address, name = nil, html_options = {}, &block)
50
- html_options, name = name, nil if block_given? && html_options.blank?
50
+ html_options, name = name || {}, nil if block_given? && html_options.blank?
51
51
  html_options.stringify_keys!
52
52
  if %w[encode replace_at replace_dot].none?{ |option| html_options.has_key? option }
53
53
  mail_to_without_encoding email_address, name, html_options, &block
@@ -1,5 +1,5 @@
1
1
  module ActionView
2
2
  module EncodedMailTo
3
- VERSION = "1.0.6"
3
+ VERSION = "1.0.7"
4
4
  end
5
5
  end
@@ -29,6 +29,10 @@ class TestActionViewEncodedMailTo < MiniTest::Test
29
29
  mail_to("nick@example.com", "Nick Reed", class: "admin")
30
30
  end
31
31
 
32
+ def test_mail_to_with_block
33
+ assert_equal(%{<a href="mailto:nick@example.com">Nick</a>}, mail_to("nick@example.com"){'Nick'})
34
+ end
35
+
32
36
  def test_mail_to_without_encoding
33
37
  assert_equal mail_to("nick@example.com", "Nick Reed"),
34
38
  mail_to_without_encoding("nick@example.com", "Nick Reed")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionview-encoded_mail_to
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Reed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-02 00:00:00.000000000 Z
11
+ date: 2015-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails