sently-sms 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +3 -3
- data/lib/sently/sms.rb +1 -1
- data/sently-sms.gemspec +59 -0
- data/test/sms_test.rb +5 -0
- metadata +3 -2
data/VERSION.yml
CHANGED
data/lib/sently/sms.rb
CHANGED
@@ -46,7 +46,7 @@ module Sently
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def format_number(number)
|
49
|
-
formatted = number.
|
49
|
+
formatted = number.gsub(/[^0-9+]/, '')
|
50
50
|
return is_number_valid?(formatted) ? formatted : (raise SentlySMSException.new("Phone number (#{number}) is not formatted correctly"))
|
51
51
|
end
|
52
52
|
|
data/sently-sms.gemspec
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{sently-sms}
|
8
|
+
s.version = "0.1.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Jerome Lacoste"]
|
12
|
+
s.date = %q{2012-07-15}
|
13
|
+
s.default_executable = %q{sently}
|
14
|
+
s.description = %q{Allow to send SMSes using the sent.ly service}
|
15
|
+
s.email = %q{jerome.lacoste@gmail.com}
|
16
|
+
s.executables = ["sently"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION.yml",
|
26
|
+
"bin/sently",
|
27
|
+
"lib/sently-sms.rb",
|
28
|
+
"lib/sently/configuration.rb",
|
29
|
+
"lib/sently/sender.rb",
|
30
|
+
"lib/sently/sms.rb",
|
31
|
+
"sently-sms.gemspec",
|
32
|
+
"test/helper.rb",
|
33
|
+
"test/sms_test.rb"
|
34
|
+
]
|
35
|
+
s.homepage = %q{http://github.com/lacostej/sently-sms}
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = %q{1.3.6}
|
38
|
+
s.summary = %q{Sent.ly SMS gem}
|
39
|
+
|
40
|
+
if s.respond_to? :specification_version then
|
41
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
42
|
+
s.specification_version = 3
|
43
|
+
|
44
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
45
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
46
|
+
s.add_development_dependency(%q<mocha>, [">= 0"])
|
47
|
+
s.add_runtime_dependency(%q<rest-client>, [">= 1.6.0"])
|
48
|
+
else
|
49
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
50
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
51
|
+
s.add_dependency(%q<rest-client>, [">= 1.6.0"])
|
52
|
+
end
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
55
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
56
|
+
s.add_dependency(%q<rest-client>, [">= 1.6.0"])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
data/test/sms_test.rb
CHANGED
@@ -38,6 +38,11 @@ class Sently::SmsTest < Test::Unit::TestCase
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
should "keep + prefixes" do
|
42
|
+
sms = Sently::Sms.new(" +47 12345678", "doh")
|
43
|
+
assert_equal(sms.format_number(" +47 12345678"), "+4712345678")
|
44
|
+
end
|
45
|
+
|
41
46
|
should "raise on invalidate message length" do
|
42
47
|
sms = Sently::Sms.new("123", "Well, if you like burgers give 'em a try sometime. I can't usually get 'em myself because my girlfriend's a vegitarian which pretty much makes me a vegitarian. But I do love the taste of a good burger. Mm-mm-mm. You know what they call a Quarter Pounder with cheese in France?")
|
43
48
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jerome Lacoste
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- lib/sently/configuration.rb
|
75
75
|
- lib/sently/sender.rb
|
76
76
|
- lib/sently/sms.rb
|
77
|
+
- sently-sms.gemspec
|
77
78
|
- test/helper.rb
|
78
79
|
- test/sms_test.rb
|
79
80
|
has_rdoc: true
|