smscru 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smscru/client.rb +9 -4
- data/lib/smscru/version.rb +1 -1
- data/smscru.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f87c0f9add477537a8db1112af0d0c19f65954d4
|
4
|
+
data.tar.gz: 217854a5c9d3f71097a5c338b79dd5d2d59f60ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a15830f6b50c1379e5b9c04652abdce262ff902aeb6ee38f40ea0f7caf25aeaaa86d3caf2a77b6c79e13d692dcc3eefc1c847a1a6e16280a6f635163ef925f21
|
7
|
+
data.tar.gz: 022a2ba1797dc292bbd5cade3785527b42da6db23270bec721333b9472d03a1228e19cb19191bf3d6fb700b4013ec3dd9ae9f90db917b09fc88a3acaf9accc74
|
data/lib/smscru/client.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require 'json'
|
2
|
-
require '
|
2
|
+
require 'faraday'
|
3
3
|
|
4
4
|
module Smscru
|
5
5
|
class Client
|
6
|
+
SEND_URL = 'http://smsc.ru/sys/send.php'
|
6
7
|
attr_reader :config
|
7
8
|
|
8
9
|
def initialize(options={})
|
@@ -13,15 +14,19 @@ module Smscru
|
|
13
14
|
def send_message(text, phones, options={})
|
14
15
|
params = {
|
15
16
|
mes: text,
|
16
|
-
phones: Array(phones),
|
17
|
+
phones: Array(phones).join(','),
|
17
18
|
login: config.login,
|
18
19
|
psw: config.password,
|
19
20
|
charset: 'utf-8',
|
20
21
|
fmt: 3
|
21
22
|
}
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
connection = Faraday.new do |i|
|
25
|
+
i.request :url_encoded
|
26
|
+
i.response :logger
|
27
|
+
i.adapter Faraday.default_adapter
|
28
|
+
end
|
29
|
+
response = connection.post SEND_URL, params
|
25
30
|
|
26
31
|
JSON.parse(response.body)
|
27
32
|
end
|
data/lib/smscru/version.rb
CHANGED
data/smscru.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smscru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Nartimov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 5.0.8
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: Ruby interface to the smsc.ru SMS gateway service.
|
56
70
|
email:
|
57
71
|
- just.lest@gmail.com
|