pswincom 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +24 -7
- data/lib/pswincom/httpsender.rb +1 -1
- metadata +9 -9
data/README.md
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
PSWinCom Ruby Gem
|
2
2
|
=================
|
3
3
|
|
4
|
-
A Ruby interface to the [PSWinCom SMS Gateway
|
4
|
+
A Ruby interface to the [PSWinCom SMS Gateway](http://pswin.com/english/products/gateway).
|
5
5
|
|
6
6
|
Installation
|
7
7
|
------------
|
8
|
-
The PSWinCom Ruby API comes as a gem. Install it with gem install. Other than the ruby default libraries the only dependency is the builder gem.
|
9
8
|
|
10
9
|
gem install pswincom
|
11
10
|
|
@@ -19,22 +18,40 @@ This piece of code demonstrates how to send a simple SMS message:
|
|
19
18
|
require 'pswincom'
|
20
19
|
|
21
20
|
api = PSWinCom::API.new 'username', 'password'
|
22
|
-
api.send_sms
|
21
|
+
api.send_sms 4712345678, 'This is a test SMS'
|
23
22
|
|
24
|
-
|
25
|
-
|
23
|
+
Properties
|
24
|
+
----------
|
26
25
|
Receiver and message text are the two mandatory properties when sending a message. You may specify additional properties by using a hash as the last argument to `send_sms`.
|
27
26
|
|
28
27
|
For instance this is how you would specify a sender:
|
29
28
|
|
30
|
-
api.send_sms
|
29
|
+
api.send_sms 4712345678, 'This is a test', :sender => 'Ruby'
|
31
30
|
|
32
31
|
Properties currently supported are:
|
33
32
|
|
34
33
|
* :sender
|
35
|
-
* :TTL - time to live in
|
34
|
+
* :TTL - time to live in minutes
|
36
35
|
* :deliverytime - a Time object specifying when to send the message
|
37
36
|
|
37
|
+
Specifying Host
|
38
|
+
---------------
|
39
|
+
The gem is set to use a particular PSWinCom SMS Gateway by default. The host can be changed globaly by setting api_host:
|
40
|
+
|
41
|
+
PSWinCom::API.api_host = 'http://some.server/sms'
|
42
|
+
|
43
|
+
Modes
|
44
|
+
-----
|
45
|
+
For testing purposes the API provides a couple of modes you can set globally to control how the gem works.
|
46
|
+
|
47
|
+
PSWinCom::API.test_mode = true
|
48
|
+
|
49
|
+
.. will make you use the API without actually sending any messages.
|
50
|
+
|
51
|
+
PSWinCom::API.debug_mode = true
|
52
|
+
|
53
|
+
.. will make the API output debug information to standard out.
|
54
|
+
|
38
55
|
License
|
39
56
|
-------
|
40
57
|
This code is free to use under the terms of the MIT license.
|
data/lib/pswincom/httpsender.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pswincom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- PSWinCom AS
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-14 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 15
|
30
30
|
segments:
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
version:
|
31
|
+
- 2
|
32
|
+
- 1
|
33
|
+
- 2
|
34
|
+
version: 2.1.2
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
description: An easy to use API for the PSWinCom SMS Gateway, allowing you to send SMS messages.
|