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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 444d8a5a3d0d438def9c8511a32b30e2b9ca8a85
4
- data.tar.gz: 0f73a20afe82bb615b84a805580f25b5e951e0e9
3
+ metadata.gz: b2549dba32a11bb94be27559d778eda5cc9bb1f0
4
+ data.tar.gz: b2af52190e40602b4998f27f0d91a484e9a4327d
5
5
  SHA512:
6
- metadata.gz: fc8e9d3c77882b98b64d60b473ddc6075fe4eac6c484183401d26a681fd0765f932e14c9fbd0759ea771a05e1d4ac73ff142c482db5eb92eb9922e87dcec8d7d
7
- data.tar.gz: 63aa0098e2a301e2a188042c7470c8c1ff7ef4709a6f465a53b7f917f74b5a88889b5629b84eba52aa4bdfd3f96a883bfe32122a2099cec0da486d6b31a09a18
6
+ metadata.gz: 8faa2dea8a115632f2ecb87a9ad92666476554adba977bf80321ff098e9accafa8efe34654f383c0cf9428173ee49a9e3fadbf45dc729921f808567bd5b1451b
7
+ data.tar.gz: bc405c29956347221853dd2e05d4b5dd60f4eba9c6ff858e61876d20e82bfcd59a479b708b5dcf6642f307764160a0b57917bac207c0e6e1cc1f8b3937e327ff
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # Version 0.1.5 - 18 July 2014
2
+
3
+ * Fix body methods.
4
+
1
5
  # Version 0.1.4 - 18 July 2014
2
6
 
3
7
  * Add more logic to clean body.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- telesms (0.1.3)
4
+ telesms (0.1.4)
5
5
  mail (~> 2.5)
6
6
  rails (> 3.0.0)
7
7
 
@@ -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
- @mail.body = body.to_s.gsub(/\n/, '').strip
94
+ body = body.to_s.gsub(/\n/, '').strip
95
+ @body = body[0,160]
98
96
  return true
99
97
  end
100
98
 
@@ -1,3 +1,3 @@
1
1
  module Telesms
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telesms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Kalinchuk