sms_gateway 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
data/lib/sms_gateway.rb
CHANGED
@@ -1,13 +1,9 @@
|
|
1
|
-
require 'rails'
|
2
|
-
require 'rails/generators'
|
3
|
-
|
4
1
|
require 'sms_gateway/base'
|
5
2
|
require 'sms_gateway/sms'
|
6
3
|
require 'sms_gateway/adapters/sms_global'
|
7
4
|
require 'sms_gateway/adapters/sms_trade'
|
8
5
|
require 'sms_gateway/adapters/test'
|
9
6
|
require 'sms_gateway/jobs/sms_job'
|
10
|
-
require 'sms_gateway/generators/install/install_generator'
|
11
7
|
|
12
8
|
module SmsGateway
|
13
9
|
end
|
@@ -18,11 +18,10 @@ module SmsGateway
|
|
18
18
|
attr_accessor :deliveries
|
19
19
|
|
20
20
|
def initialize(config={})
|
21
|
-
|
21
|
+
#@logger = Logger.new(STDOUT)
|
22
22
|
end
|
23
23
|
|
24
24
|
def send_sms(sms)
|
25
|
-
#@logger.info "would be sending sms: #{sms.to_s}"
|
26
25
|
SmsGateway::Base.deliveries << sms
|
27
26
|
end
|
28
27
|
|
data/lib/sms_gateway/base.rb
CHANGED
@@ -21,7 +21,7 @@ module SmsGateway
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def config=(options)
|
24
|
-
@config = options
|
24
|
+
@config = options
|
25
25
|
adapter = @config.delete(:adapter)
|
26
26
|
@config.each do |k,v|
|
27
27
|
self.send "#{k}=", v
|
@@ -30,7 +30,7 @@ module SmsGateway
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def deliver(options)
|
33
|
-
self.adapter.send_sms(SmsGateway::Sms.new(options
|
33
|
+
self.adapter.send_sms(SmsGateway::Sms.new(options))
|
34
34
|
end
|
35
35
|
|
36
36
|
def self.deliver_later(text, to, from=Base.config[:from])
|
data/lib/sms_gateway/version.rb
CHANGED