sms_gateway 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5da65ee20b61e04afa2d252edb032ef0595a3a2d
4
- data.tar.gz: 2457d1ec22f250b82a3a6568532b5ab2136dff12
3
+ metadata.gz: 03a54a6eeddebf3a65ff4cbcc689f7516332bd0f
4
+ data.tar.gz: d22ce1156c432c0fe8a44df5696911c6d60cb0b3
5
5
  SHA512:
6
- metadata.gz: 7062407b54906de2506b5a18f430a72c10f0d94bfd7e3fa02386889a9c02124bdd9b8823842e54f3f0379cf4b06dc74acb56df78fad730c5bf77e7ea7a9372c9
7
- data.tar.gz: dad6fc449ea60413b949394217be9b9c7599042dfa8d36c46e32a3600a4e043da4ede7bd0bf299d22f470e129b195ae45a424158b38c484cd7c98ccdb15a0919
6
+ metadata.gz: cbd74262c9f4396b08d34e725da84a4919f78f850e97e42881555659a601e808c3afca681b7dd0c967c4602608515059f5c343e475fdcc1ae7e9e0d9d459eb46
7
+ data.tar.gz: 228739afcdaa6b13a52e91edc3b3ad298a8f259ef879e601c9bf73881e80bbe199da50f47ca48186f916d252023fe09b2243c2d4fd75ba3be8841342d977effd
@@ -10,6 +10,7 @@ module SmsGateway
10
10
  def initialize(config={})
11
11
  @config = {:key => SmsGateway::Base.key, :from => SmsGateway::Base.from, :route => SmsGateway::Base.route}
12
12
  @config.merge!(config)
13
+ self.class.base_uri SmsGateway::Base.base_uri
13
14
  end
14
15
 
15
16
  def send_sms(sms)
@@ -3,7 +3,7 @@ module SmsGateway
3
3
  class Base
4
4
 
5
5
  class << self
6
- attr_accessor :from, :user, :password, :key, :route
6
+ attr_accessor :from, :user, :password, :key, :route, :base_uri
7
7
  attr_reader :adapter
8
8
 
9
9
  def configure
@@ -1,4 +1,4 @@
1
1
  module SmsGateway
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
4
4
 
@@ -7,7 +7,8 @@ describe SmsGateway::Adapters::SmsGlobal do
7
7
  :adapter => 'sms_trade',
8
8
  :route => 'direct',
9
9
  :key => 'KEY',
10
- :from => 'SMSTRADE'
10
+ :from => 'SMSTRADE',
11
+ :base_uri => 'http://gateway.smspromote.de'
11
12
  }
12
13
  end
13
14
 
@@ -15,24 +16,24 @@ describe SmsGateway::Adapters::SmsGlobal do
15
16
 
16
17
  sms = SmsGateway::Sms.new(:to => '491701234567', :text => "Hallö Ümläut.", :from => 'SENDER')
17
18
 
18
- stub_request(:get, "http://gateway.smstrade.de/?charset=UTF-8&from=SENDER&key=KEY&message=#{URI.encode(sms.text)}&route=direct&to=491701234567").
19
+ stub_request(:get, "http://gateway.smspromote.de/?charset=UTF-8&from=SENDER&key=KEY&message=#{URI.encode(sms.text)}&route=direct&to=491701234567").
19
20
  to_return(:status => 200, :body => "", :headers => {})
20
21
 
21
22
  sms.deliver
22
23
 
23
- assert_requested(:get, "http://gateway.smstrade.de/?key=KEY&to=491701234567&message=#{URI.encode(sms.text)}&route=direct&from=SENDER&charset=UTF-8")
24
+ assert_requested(:get, "http://gateway.smspromote.de/?key=KEY&to=491701234567&message=#{URI.encode(sms.text)}&route=direct&from=SENDER&charset=UTF-8")
24
25
  end
25
26
 
26
27
  it 'allows changing the route on the fly' do
27
28
 
28
29
  sms = SmsGateway::Sms.new(:to => '491701234567', :text => "SMSTEXT", :from => 'SENDER', :route => 'basic')
29
30
 
30
- stub_request(:get, "http://gateway.smstrade.de/?charset=UTF-8&from=SENDER&key=KEY&message=#{URI.encode(sms.text)}&route=basic&to=491701234567").
31
+ stub_request(:get, "http://gateway.smspromote.de/?charset=UTF-8&from=SENDER&key=KEY&message=#{URI.encode(sms.text)}&route=basic&to=491701234567").
31
32
  to_return(:status => 200, :body => "", :headers => {})
32
33
 
33
34
  sms.deliver
34
35
 
35
- assert_requested(:get, "http://gateway.smstrade.de/?key=KEY&to=491701234567&message=#{URI.encode(sms.text)}&route=basic&from=SENDER&charset=UTF-8")
36
+ assert_requested(:get, "http://gateway.smspromote.de/?key=KEY&to=491701234567&message=#{URI.encode(sms.text)}&route=basic&from=SENDER&charset=UTF-8")
36
37
 
37
38
  end
38
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sms_gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kai Rubarth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-21 00:00:00.000000000 Z
11
+ date: 2015-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -134,4 +134,9 @@ rubygems_version: 2.2.2
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Simple and flexible interface to SMS Gateways
137
- test_files: []
137
+ test_files:
138
+ - test/adapters/sms_global_test.rb
139
+ - test/adapters/sms_trade_test.rb
140
+ - test/adapters/test_adapter_test.rb
141
+ - test/configuration_test.rb
142
+ - test/test_helper.rb