activesms 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
data/lib/activesms/base.rb
CHANGED
@@ -102,7 +102,7 @@ module ActiveSms #:nodoc:
|
|
102
102
|
cattr_accessor :deliveries
|
103
103
|
|
104
104
|
# The recipient numbers for the message, either as a string (for a single
|
105
|
-
# recipient) or an array (for multiple
|
105
|
+
# recipient) or an array (for multiple recipientipients).
|
106
106
|
adv_attr_accessor :recipients
|
107
107
|
|
108
108
|
# Specify the from number or identifier for the message.
|
@@ -23,11 +23,13 @@ module ActiveSms
|
|
23
23
|
super(logger)
|
24
24
|
@config = config.dup
|
25
25
|
@config.symbolize_keys!
|
26
|
-
|
27
|
-
|
26
|
+
@subscriber_id = @config[:subscriber_id]
|
27
|
+
@subscriber_password = @config[:subscriber_password]
|
28
|
+
|
29
|
+
if @subscriber_id.nil?
|
28
30
|
raise "subscriber_id is required for simplewire"
|
29
31
|
end
|
30
|
-
|
32
|
+
if @subscriber_password.nil?
|
31
33
|
raise "subscriber_password is required for simplewire"
|
32
34
|
end
|
33
35
|
end
|
@@ -39,7 +41,7 @@ module ActiveSms
|
|
39
41
|
|
40
42
|
# Send the sms message using the simplewire adapter
|
41
43
|
def deliver(sms)
|
42
|
-
create_sms(sms).
|
44
|
+
create_sms(sms).msg_send()
|
43
45
|
end
|
44
46
|
|
45
47
|
def parse(sms)
|
@@ -48,8 +50,10 @@ module ActiveSms
|
|
48
50
|
# Create the simplewire sms message to send
|
49
51
|
def create_sms(sms)
|
50
52
|
s = SMS.new
|
51
|
-
s.
|
52
|
-
s.
|
53
|
+
s.subscriber_id = @subscriber_id
|
54
|
+
s.subscriber_password = @subscriber_password
|
55
|
+
s.msg_pin = sms.recipients
|
56
|
+
s.msg_callback = sms.from
|
53
57
|
s.msg_text = sms.body
|
54
58
|
s
|
55
59
|
end
|
data/lib/activesms/version.rb
CHANGED
@@ -16,12 +16,16 @@ if RUBY_PLATFORM =~ /java/
|
|
16
16
|
|
17
17
|
def test_create_sms
|
18
18
|
sms = flexmock("sms")
|
19
|
+
sms.should_receive(:subscriber_id).and_return("id")
|
20
|
+
sms.should_receive(:subscriber_password).and_return("password")
|
19
21
|
sms.should_receive(:recipients).and_return("4081234567")
|
20
22
|
sms.should_receive(:from).and_return("6502435555")
|
21
23
|
sms.should_receive(:body).and_return("This is the body of the sms")
|
22
24
|
|
23
25
|
s = @simplewire_adapter.create_sms(sms)
|
24
26
|
|
27
|
+
assert_equal "id", s.subscriber_id
|
28
|
+
assert_equal "password", s.subscriber_password
|
25
29
|
assert_equal "4081234567", s.destination_addr.address
|
26
30
|
assert_equal "6502435555", s.source_addr.address
|
27
31
|
assert_equal "This is the body of the sms", s.msg_text
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>ActiveSms</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/activesms"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/activesms" class="numbers">0.0
|
36
|
+
<a href="http://rubyforge.org/projects/activesms" class="numbers">0.6.0</a>
|
37
37
|
</div>
|
38
38
|
<h2>What</h2>
|
39
39
|
|
@@ -52,6 +52,12 @@
|
|
52
52
|
<p><span class="caps">TBD</span>.</p>
|
53
53
|
|
54
54
|
|
55
|
+
<h2><span class="caps">API</span> Documentation</h2>
|
56
|
+
|
57
|
+
|
58
|
+
<p>Check out the <a href="http://activesms.rubyforge.org/rdoc/">rdocs.</a></p>
|
59
|
+
|
60
|
+
|
55
61
|
<h2>Supported Gateways</h2>
|
56
62
|
|
57
63
|
|
data/website/index.txt
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: activesms
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.6.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.6.1
|
7
|
+
date: 2007-08-30 00:00:00 -07:00
|
8
8
|
summary: Active SMS is a framework for sending and receiving SMS messages
|
9
9
|
require_paths:
|
10
10
|
- lib
|