smsapi-client 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/smsapi/bulk_sms.rb +2 -2
- data/lib/smsapi/client.rb +1 -1
- data/lib/smsapi/defaults.rb +1 -1
- data/lib/smsapi/group_sms.rb +2 -2
- data/lib/smsapi/server.rb +5 -5
- data/lib/smsapi/server/connection.rb +1 -1
- data/lib/smsapi/sms.rb +3 -3
- data/lib/smsapi/smsapi.rb +2 -2
- data/smsapi-client.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d3b9d0bfa832e3b08c12271a46baa9f3c2111a0
|
4
|
+
data.tar.gz: 970f448af0780ee8b96ef7fe0640804c81351962
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 892fa8a907f6b9f6d3bf0f9aab3931ca3864f2abcde86143ceff4d76631b02be6ac21986c36181186814ad60d1171271614a5823ba68eb1616593032629e1e46
|
7
|
+
data.tar.gz: d09630489721bc5338010204b973719e79a3334c109c429bbd5d42277e299cf6b17beb6bc0522ffda329cd0c8cd8ac3bb9bd93f9834cc9ccc3fa3b733fd710ab
|
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# Smsapi::Client
|
2
2
|
|
3
3
|
## Installation
|
4
4
|
|
5
5
|
Add this line to your application's Gemfile:
|
6
6
|
|
7
7
|
```ruby
|
8
|
-
gem 'smsapi-client'
|
8
|
+
gem 'smsapi-client', '~> 0.2'
|
9
9
|
```
|
10
10
|
|
11
11
|
And then execute:
|
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
```ruby
|
22
22
|
# Create the client
|
23
|
-
client =
|
23
|
+
client = Smsapi::Client.new('username', 'password')
|
24
24
|
|
25
25
|
# Send a single text message
|
26
26
|
sms = client.send_single 500500500, 'Text Message'
|
data/lib/smsapi/bulk_sms.rb
CHANGED
data/lib/smsapi/client.rb
CHANGED
data/lib/smsapi/defaults.rb
CHANGED
data/lib/smsapi/group_sms.rb
CHANGED
data/lib/smsapi/server.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module Smsapi
|
2
2
|
class Server
|
3
3
|
def initialize(username, password)
|
4
4
|
@username = username
|
@@ -7,16 +7,16 @@ module SMSApi
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def sms(params = {})
|
10
|
-
api_response = make_request(
|
10
|
+
api_response = make_request(Smsapi::API[:sms_path], params)
|
11
11
|
api_response.split(';')
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def setup_connection
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
Smsapi::Server::Connection.new(
|
18
|
+
Smsapi::API[:uri],
|
19
|
+
Smsapi::API[:port]
|
20
20
|
)
|
21
21
|
end
|
22
22
|
|
data/lib/smsapi/sms.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
module
|
1
|
+
module Smsapi
|
2
2
|
class SMS
|
3
|
-
include
|
3
|
+
include Smsapi::Defaults
|
4
4
|
|
5
5
|
attr_accessor :to, :message, :id, :points, :status, :error_code, :date
|
6
6
|
def initialize(to, message, server, options = {})
|
@@ -36,7 +36,7 @@ module SMSApi
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def error_message
|
39
|
-
|
39
|
+
Smsapi::ERROR_MESSAGES[error_code]
|
40
40
|
end
|
41
41
|
|
42
42
|
def read_response(response)
|
data/lib/smsapi/smsapi.rb
CHANGED
@@ -6,11 +6,11 @@ require 'smsapi/sms'
|
|
6
6
|
require 'smsapi/bulk_sms'
|
7
7
|
require 'smsapi/group_sms'
|
8
8
|
|
9
|
-
module
|
9
|
+
module Smsapi
|
10
10
|
class Error < StandardError; end
|
11
11
|
class ServerError < Error; end
|
12
12
|
|
13
|
-
VERSION = "0.
|
13
|
+
VERSION = "0.2.0"
|
14
14
|
API = {
|
15
15
|
uri: 'ssl.smsapi.pl',
|
16
16
|
port: 443,
|
data/smsapi-client.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'smsapi/smsapi'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "smsapi-client"
|
8
|
-
spec.version =
|
8
|
+
spec.version = Smsapi::VERSION
|
9
9
|
spec.authors = ["Alek Niemczyk", "Marek Machula", "Marcin Drozd", "Michal Musialik"]
|
10
10
|
spec.email = ["info@rubylogic.pl"]
|
11
11
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smsapi-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alek Niemczyk
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-
|
14
|
+
date: 2015-10-02 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|