cm-sms 0.2.4 → 0.2.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/lib/cm_sms/gem_version.rb +1 -1
- data/lib/cm_sms/message.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 36e69ead7265a5560055211a553e8359054a6182
|
|
4
|
+
data.tar.gz: c2538870792397fadf1180408398c0680f000e92
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5c791efcae65fb6e4272a03d017eeabff91c9b919eb3df6cc8d8ee332beb6a4bc57dc019d0f781c051d72da00070638f2e0ad7823ae5699033172e040a9416d2
|
|
7
|
+
data.tar.gz: 21c7599fd13b8435637e5a61a2589d55ab233a7f6e70fc3b1d496b1b4ac62d580a61028650bf7b38286006070b12e7b13e33d2162496262f252d7f2d97991e37
|
data/lib/cm_sms/gem_version.rb
CHANGED
data/lib/cm_sms/message.rb
CHANGED
|
@@ -4,10 +4,11 @@ require 'cm_sms/request'
|
|
|
4
4
|
|
|
5
5
|
module CmSms
|
|
6
6
|
class Message
|
|
7
|
+
class SenderTooLong < ArgumentError; end
|
|
7
8
|
class FromMissing < ArgumentError; end
|
|
8
9
|
class ToMissing < ArgumentError; end
|
|
9
10
|
class BodyMissing < ArgumentError; end
|
|
10
|
-
class
|
|
11
|
+
class BodyTooLong < ArgumentError; end
|
|
11
12
|
class ToUnplausible < ArgumentError; end
|
|
12
13
|
class DCSNotNumeric < ArgumentError; end
|
|
13
14
|
|
|
@@ -68,10 +69,11 @@ module CmSms
|
|
|
68
69
|
end
|
|
69
70
|
|
|
70
71
|
def deliver!
|
|
72
|
+
raise SenderTooLong.new('The value for the sender attribute must contain 1..11 characters.') unless sender_length?
|
|
71
73
|
raise FromMissing.new('The value for the from attribute is missing.') unless sender_present?
|
|
72
74
|
raise ToMissing.new('The value for the to attribute is missing.') unless receiver_present?
|
|
73
75
|
raise BodyMissing.new('The body of the message is missing.') unless body_present?
|
|
74
|
-
raise
|
|
76
|
+
raise BodyTooLong.new('The body of the message has a length greater than 160.') unless body_correct_length?
|
|
75
77
|
raise ToUnplausible.new("The given value for the to attribute is not a plausible phone number.\nMaybe the country code is missing.") unless receiver_plausible?
|
|
76
78
|
raise DCSNotNumeric.new("The given value for the dcs attribute is not a number.") unless dcs_numeric?
|
|
77
79
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cm-sms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- itschn
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|