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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7367e1bbaab46baf1d36789ecfb9555999dbbef8
|
4
|
+
data.tar.gz: 86b92cc6ab525eea60f2a151e9367246870ce49a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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.
|
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-
|
11
|
+
date: 2015-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|