telesms 0.1.4 → 0.1.5
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/telesms/incoming.rb +6 -8
- data/lib/telesms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b2549dba32a11bb94be27559d778eda5cc9bb1f0
|
|
4
|
+
data.tar.gz: b2af52190e40602b4998f27f0d91a484e9a4327d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8faa2dea8a115632f2ecb87a9ad92666476554adba977bf80321ff098e9accafa8efe34654f383c0cf9428173ee49a9e3fadbf45dc729921f808567bd5b1451b
|
|
7
|
+
data.tar.gz: bc405c29956347221853dd2e05d4b5dd60f4eba9c6ff858e61876d20e82bfcd59a479b708b5dcf6642f307764160a0b57917bac207c0e6e1cc1f8b3937e327ff
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/telesms/incoming.rb
CHANGED
|
@@ -7,6 +7,10 @@ module Telesms
|
|
|
7
7
|
# The mail message created from the params.
|
|
8
8
|
attr_reader :mail
|
|
9
9
|
|
|
10
|
+
# @return [String]
|
|
11
|
+
# The body of the message.
|
|
12
|
+
attr_accessor :body
|
|
13
|
+
|
|
10
14
|
# This method receives a mail param and parses it.
|
|
11
15
|
#
|
|
12
16
|
# @param [Hash] params
|
|
@@ -60,13 +64,6 @@ module Telesms
|
|
|
60
64
|
@mail.from.first.to_s.match(/(.*)\@/)[1] rescue nil
|
|
61
65
|
end
|
|
62
66
|
|
|
63
|
-
# This method gets the body of the message.
|
|
64
|
-
#
|
|
65
|
-
# @return [String]
|
|
66
|
-
def body
|
|
67
|
-
@mail.body.to_s[0,160]
|
|
68
|
-
end
|
|
69
|
-
|
|
70
67
|
# This method gets the gateway host from the FROM field.
|
|
71
68
|
#
|
|
72
69
|
# @return [String]
|
|
@@ -94,7 +91,8 @@ module Telesms
|
|
|
94
91
|
body = body.gsub(/\n/, '').gsub(/\s+/, ' ')
|
|
95
92
|
body = body[0, body.index(original_message_regex) || body.length].to_s
|
|
96
93
|
body = body.split(/\n\s*\n/m, 2)[1] || body if body.match(/\n/)
|
|
97
|
-
|
|
94
|
+
body = body.to_s.gsub(/\n/, '').strip
|
|
95
|
+
@body = body[0,160]
|
|
98
96
|
return true
|
|
99
97
|
end
|
|
100
98
|
|
data/lib/telesms/version.rb
CHANGED