4info 1.3.1 → 1.3.2
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.
- data/4info.gemspec +1 -1
- data/VERSION +1 -1
- data/lib/contactable.rb +4 -0
- data/lib/four_info.rb +1 -1
- data/lib/request.rb +2 -1
- data/lib/templates/deliver.haml +1 -1
- metadata +1 -1
data/4info.gemspec
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.2
|
data/lib/contactable.rb
CHANGED
@@ -132,6 +132,10 @@ module FourInfo
|
|
132
132
|
self.class :
|
133
133
|
FourInfo).confirmation_message(confirmation_code)
|
134
134
|
|
135
|
+
if message.to_s.size > 160
|
136
|
+
raise ArgumentError, "SMS Confirmation Message is too long. Limit it to 160 characters of unescaped text."
|
137
|
+
end
|
138
|
+
|
135
139
|
response = FourInfo::Request.new.deliver_message(message, four_info_sms_phone_number)
|
136
140
|
|
137
141
|
if response.success?
|
data/lib/four_info.rb
CHANGED
@@ -32,7 +32,7 @@ module FourInfo
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def confirmation_message(confirmation_code)
|
35
|
-
"4INFO alert confirm. code: #{confirmation_code} Enter code on web to verify phone. Msg&
|
35
|
+
"4INFO alert confirm. code: #{confirmation_code} Enter code on web to verify phone. Msg&data rates may apply. Freq set by u. T&C & support at www.4info.com. Txt HELP for help"
|
36
36
|
end
|
37
37
|
|
38
38
|
def generate_confirmation_code
|
data/lib/request.rb
CHANGED
@@ -38,6 +38,7 @@ module FourInfo
|
|
38
38
|
|
39
39
|
def template(name)
|
40
40
|
# Haml templates for XML
|
41
|
+
require 'cgi'
|
41
42
|
templates = Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), 'templates', '*.haml')))
|
42
43
|
file = templates.detect {|t| File.basename(t).chomp('.haml').to_sym == name.to_sym }
|
43
44
|
raise ArgumentError, "Missing 4Info template: #{name}" unless file
|
@@ -71,4 +72,4 @@ module FourInfo
|
|
71
72
|
end
|
72
73
|
end
|
73
74
|
end
|
74
|
-
end
|
75
|
+
end
|
data/lib/templates/deliver.haml
CHANGED