mblox 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mblox/configuration.rb +0 -1
- data/lib/mblox/sms.rb +0 -4
- data/lib/mblox/version.rb +1 -1
- data/mblox.gemspec +1 -1
- data/spec/sms_spec.rb +1 -15
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4afe4f1bb68705976b81afbcdac07d1a86f2752
|
4
|
+
data.tar.gz: a945756f97e91facdc964ddf88a97066b462480f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c75e1e051744f8bfb70ce5bb627e1d8cb0973975cc690f9d5aae6dc39bb44af39d52be48d03fd33bb2548fe1b404dca088ae6a063be896361071fabef76e64a
|
7
|
+
data.tar.gz: d49aae35fc881f46aff618f3c59d21f15e7b9e00c3f5e137450a8dc7f583064fa6211cf3fe90408f62f9f586a884aad762f0a617bc43e913700c418f3b0352a2
|
data/lib/mblox/configuration.rb
CHANGED
data/lib/mblox/sms.rb
CHANGED
@@ -10,13 +10,9 @@ module Mblox
|
|
10
10
|
class Sms < SmsValidation::Sms
|
11
11
|
class BatchIdOutOfRangeError < ::ArgumentError; end
|
12
12
|
class InvalidSenderIdError < ::ArgumentError; end
|
13
|
-
LEGAL_CHARACTERS = "~\`!\"#\$\%&'\(\)*+,-.\/:;<=>?@_£¤¥§¿i¡ÄÅÃÆÇÉÑÖØÜßâáäåãæçèéìíñòöøóùüú\n\r\t ©"
|
14
|
-
ILLEGAL_CHARACTERS = /([^a-zA-Z0-9#{LEGAL_CHARACTERS}\\])/
|
15
13
|
|
16
14
|
def initialize(phone, message, batch_id=nil)
|
17
15
|
super(phone, message)
|
18
|
-
illegal_characters = ILLEGAL_CHARACTERS.match(message).to_a
|
19
|
-
raise InvalidMessageError, "Message cannot contain the following special characters: #{illegal_characters.uniq.join(', ')}" unless illegal_characters.size.zero?
|
20
16
|
raise BatchIdOutOfRangeError, "batch_id must be in the range 1 to #{MAX_BATCH_ID}. The batch_id specified (#{batch_id}) is out of range." if !batch_id.blank? && (MAX_BATCH_ID < batch_id.to_i)
|
21
17
|
@batch_id = batch_id.to_i unless batch_id.blank?
|
22
18
|
end
|
data/lib/mblox/version.rb
CHANGED
data/mblox.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_runtime_dependency 'activemodel'
|
26
26
|
spec.add_runtime_dependency 'activesupport'
|
27
27
|
spec.add_runtime_dependency 'addressable'
|
28
|
-
spec.add_runtime_dependency 'sms_validation'
|
28
|
+
spec.add_runtime_dependency 'sms_validation', ">= 0.0.2"
|
29
29
|
spec.add_runtime_dependency 'builder'
|
30
30
|
spec.add_runtime_dependency "nokogiri", ">= 1.5.0"
|
31
31
|
end
|
data/spec/sms_spec.rb
CHANGED
@@ -179,24 +179,10 @@ describe Mblox::Sms do
|
|
179
179
|
let(:phone_number) { LANDLINE }
|
180
180
|
|
181
181
|
it { should_have_unroutable_response }
|
182
|
-
|
183
|
-
described_class::LEGAL_CHARACTERS.each_char do |i|
|
184
|
-
describe "when message contains legal character '#{i}'" do
|
185
|
-
let(:message) { "#{super()}#{i}#{super()}" }
|
186
|
-
|
187
|
-
it { should_have_unroutable_response }
|
188
|
-
end
|
189
|
-
end
|
190
|
-
end
|
191
|
-
|
192
|
-
describe "when message contains legal character '\'" do
|
193
|
-
let(:message) { "#{super()}\A#{super()}" }
|
194
|
-
|
195
|
-
it { should_have_ok_response }
|
196
182
|
end
|
197
183
|
|
198
184
|
describe "when all legal characters are in message" do
|
199
|
-
let(:message) { described_class::LEGAL_CHARACTERS }
|
185
|
+
let(:message) { "#{described_class::LEGAL_CHARACTERS}\\" }
|
200
186
|
it { should_have_ok_response }
|
201
187
|
end
|
202
188
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mblox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Betesh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 0.0.2
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 0.0.2
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: builder
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
requirements: []
|
186
186
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.
|
187
|
+
rubygems_version: 2.2.2
|
188
188
|
signing_key:
|
189
189
|
specification_version: 4
|
190
190
|
summary: '# Mblox This gem is for subscribers to Mblox to send SMS messages. ##
|