moonshado-sms 0.2.1 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/moonshado/sms.rb +7 -2
- metadata +3 -3
data/VERSION.yml
CHANGED
data/lib/moonshado/sms.rb
CHANGED
@@ -7,11 +7,16 @@ module Moonshado
|
|
7
7
|
cattr_accessor :config
|
8
8
|
attr_accessor :number, :message
|
9
9
|
|
10
|
+
def self.url
|
11
|
+
@url ||= URI.parse(config[:sms_api_url])
|
12
|
+
"#{@url.scheme}://#{@url.user}:#{@url.password}@#{@url.host}:#{@url.port}/sms"
|
13
|
+
end
|
14
|
+
|
10
15
|
def self.find(id)
|
11
16
|
if config[:test_env] == true
|
12
17
|
{:sms => {:id => id, :reports => '[{"update_date":"2010-01-03T22:56:45-08:00","status_info":"test"}]'}, :stat => "ok"}
|
13
18
|
else
|
14
|
-
response = RestClient.get("#{
|
19
|
+
response = RestClient.get("#{url}/#{id}")
|
15
20
|
JSON.parse(response.body)
|
16
21
|
end
|
17
22
|
end
|
@@ -28,7 +33,7 @@ module Moonshado
|
|
28
33
|
{:stat => 'ok', :id => Digest::SHA1.hexdigest(Time.now.to_s + rand(12341234).to_s)[1..16]}
|
29
34
|
else
|
30
35
|
response = RestClient.post(
|
31
|
-
|
36
|
+
Moonshado::Sms.url,
|
32
37
|
{:sms => {:device_address => format_number(@number), :message => @message}}
|
33
38
|
)
|
34
39
|
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 3
|
8
8
|
- 1
|
9
|
-
version: 0.
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kevin Patel
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-05-12 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|