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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e052fd8b6961f720ed39625f742c64d4e2eaefdc
4
- data.tar.gz: 3c644a3da6cf7f9163a6c127478948769ad3b006
3
+ metadata.gz: 36e69ead7265a5560055211a553e8359054a6182
4
+ data.tar.gz: c2538870792397fadf1180408398c0680f000e92
5
5
  SHA512:
6
- metadata.gz: 93e5bf1880a3c5dc30c9790aebaceef370ed67e788cdc249d81dc5cbfb91e4cd74738c3aae2e5a7149d4b96a5ab8bd356c04bbd9d44ca7acb28cce7447fd79c8
7
- data.tar.gz: 2557110c83e61632dd70bc0bc86fd10d5add9561c1a2dbaccf3efa26bf4505b73dcc440cb55d97e931add3a52c83770a5a50c3db19a932ae797c83df65f00573
6
+ metadata.gz: 5c791efcae65fb6e4272a03d017eeabff91c9b919eb3df6cc8d8ee332beb6a4bc57dc019d0f781c051d72da00070638f2e0ad7823ae5699033172e040a9416d2
7
+ data.tar.gz: 21c7599fd13b8435637e5a61a2589d55ab233a7f6e70fc3b1d496b1b4ac62d580a61028650bf7b38286006070b12e7b13e33d2162496262f252d7f2d97991e37
@@ -7,7 +7,7 @@ module CmSms
7
7
  module VERSION
8
8
  MAJOR = 0
9
9
  MINOR = 2
10
- TINY = 4
10
+ TINY = 5
11
11
  PRE = nil
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -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 BodyToLong < ArgumentError; end
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 BodyToLong.new('The body of the message has a length greater than 160.') unless body_correct_length?
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
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-09-24 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler