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.
Files changed (3) hide show
  1. data/README.md +24 -7
  2. data/lib/pswincom/httpsender.rb +1 -1
  3. 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 API](http://pswin.com/english/products/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 '4712345678', 'This is a test SMS'
21
+ api.send_sms 4712345678, 'This is a test SMS'
23
22
 
24
- Advanced Usage
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 '4712345678', 'This is a test', :sender => 'Ruby'
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 seconds
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.
@@ -6,7 +6,7 @@ module PSWinCom
6
6
  API_HOST = 'http://gw2-fro.pswin.com:81/'
7
7
 
8
8
  def initialize
9
- @host = PSWinCom::API.api_host.nil? ? API_HOST : PSWinCom::API.api_host
9
+ @host = API.api_host || API_HOST
10
10
  PSWinCom.debug "Host", @host
11
11
  end
12
12
 
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: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.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-07 00:00:00 +01:00
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: 7
29
+ hash: 15
30
30
  segments:
31
- - 3
32
- - 0
33
- - 0
34
- version: 3.0.0
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.