mblox 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -1
- data/lib/mblox/sms.rb +2 -1
- data/lib/mblox/version.rb +1 -1
- data/spec/sms_spec.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTljMzE5Yzc5NDZiZmYyNzcyNmZlMDA4MDAyMjJjZjJkYmJiNjBlYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjdiZjViMTNmMDc0YTNjZDA3NDlkMjEyNzFkYmRkZWFlNzRjZGYxOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjlmY2NkNzFiNzYxMzNkYzBhZDIxZjM3ODFjZGE1NmZjZDAzMDk1YTYwMjlj
|
10
|
+
NWQyMWNjMTU5MGY4NjI4ZjcwZWE0ZWM0MWVhYzQ5MmE4MzcwMThkYjlkYTc0
|
11
|
+
MzU3NzQ3ZTgyZjNmZmM2MzY4OThlOTU5N2RiZGUzNTA4MTQzYzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGNkNGNiNTczNmY0NWVlZGNmZTVjZGFmYWFjMjFjY2Y5ODY4MWI3ZDE3YjI2
|
14
|
+
YmE3OTg3ZjlmY2I0OWIxYjY5ZWQxYzRjM2Q5ZmQyYmNhZDMzNDg0MzQ1NWI3
|
15
|
+
NGUxOTBkMjkzMzAxYWEwOTMxY2Y0ZDU0OWUzNTg3MGZmZDE2MWY=
|
data/README.md
CHANGED
@@ -56,7 +56,7 @@ Copy config.yml.example to config.yml and set all the values in that file. Run:
|
|
56
56
|
|
57
57
|
rspec
|
58
58
|
|
59
|
-
You should recieve
|
59
|
+
You should recieve 4 SMS messages to your phone within several seconds.
|
60
60
|
|
61
61
|
## Contributing
|
62
62
|
|
data/lib/mblox/sms.rb
CHANGED
@@ -12,7 +12,8 @@ module Mblox
|
|
12
12
|
class BatchIdOutOfRangeError < ::ArgumentError; end
|
13
13
|
MAX_LENGTH = 160
|
14
14
|
MAX_SECTION_LENGTH = MAX_LENGTH - "(MSG XXX/XXX): ".size
|
15
|
-
|
15
|
+
LEGAL_CHARACTERS = "~\`\!\"#\$\%&'\(\)*+,-.\/:;<=>?@_£¤¥§¿i¡ÄÅÆÇÉÑÖØÜßáäåæèéìñòöøóùüú\n\r\tí "
|
16
|
+
ILLEGAL_CHARACTERS = /([^a-zA-Z0-9#{LEGAL_CHARACTERS}])/
|
16
17
|
|
17
18
|
attr_reader :phone, :message
|
18
19
|
|
data/lib/mblox/version.rb
CHANGED
data/spec/sms_spec.rb
CHANGED
@@ -133,7 +133,7 @@ describe Mblox::Sms do
|
|
133
133
|
response.first.ok?.should be_false
|
134
134
|
end
|
135
135
|
|
136
|
-
|
136
|
+
Mblox::Sms::LEGAL_CHARACTERS.each_char do |i|
|
137
137
|
it "allows the special char #{i}, correctly escaping illegal XML characters where necessary" do
|
138
138
|
response = Mblox::Sms.new(LANDLINE,"#{the_message}#{i}#{the_message}").send
|
139
139
|
response.size.should eq(1)
|
@@ -141,6 +141,12 @@ describe Mblox::Sms do
|
|
141
141
|
response.first.unroutable?.should be_true
|
142
142
|
end
|
143
143
|
end
|
144
|
+
|
145
|
+
it "can send all the legal characters" do
|
146
|
+
response = Mblox::Sms.new(TEST_NUMBER,Mblox::Sms::LEGAL_CHARACTERS).send
|
147
|
+
response.size.should eq(1)
|
148
|
+
response.first.ok?.should be_true
|
149
|
+
end
|
144
150
|
end
|
145
151
|
|
146
152
|
describe "batch_id" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mblox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Betesh
|
@@ -176,7 +176,7 @@ summary: ! '# Mblox This gem is for subscribers to Mblox to send SMS messages.
|
|
176
176
|
to sending to must be a 10-digit number, including the area code. Can be a String
|
177
177
|
or Fixnum. phone_number = 2225555555 # or: phone_number = "2225555555" Mblox::Sms.new(phone_number,
|
178
178
|
"your message").send ## Testing Copy config.yml.example to config.yml and set
|
179
|
-
all the values in that file. Run: rspec You should recieve
|
179
|
+
all the values in that file. Run: rspec You should recieve 4 SMS messages to
|
180
180
|
your phone within several seconds. ## Contributing 1. Fork it 2. Create your feature
|
181
181
|
branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am
|
182
182
|
''Add some feature''`) 4. Push to the branch (`git push origin my-new-feature`)
|