tww 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/.gitignore +1 -0
- data/README.md +28 -4
- data/lib/tww/testing.rb +21 -0
- data/lib/tww/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a219a2a6c7e35cd577a66d93804ff9e0b5a68330
|
4
|
+
data.tar.gz: 326f855938c37d1a52be2858b6ffcfb74698ea2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f543d46042744f4ebf40722c83287595294f11d08429c50dee9ec5b55a114ef8aeb1e33bc1ecd12216010f8cdf32f8cbfaee11bdb468e35a5793f6420eac396e
|
7
|
+
data.tar.gz: ae97104afc9fa50f12868dd71362320ece6b18d019a5dcbc3208738a0ae28ec0c56e9acae0742315160485150ff0a3de6f2d8beb578355c2ec8ff2ca36e6a289
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# TWW
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/dlibanori/tww.svg?branch=master)](https://travis-ci.org/dlibanori/tww)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/dlibanori/tww/badges/gpa.svg)](https://codeclimate.com/github/dlibanori/tww)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/github/dlibanori/tww/badge.svg?branch=master)](https://coveralls.io/github/dlibanori/tww?branch=master)
|
4
6
|
|
5
|
-
|
7
|
+
Send SMS through TWW plataform. Avoid to handle with HTTP libraries or to parse XML response.
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -24,15 +26,37 @@ Or install it yourself as:
|
|
24
26
|
|
25
27
|
TODO: Write usage instructions here
|
26
28
|
|
29
|
+
```ruby
|
30
|
+
TWW.config do |config|
|
31
|
+
config.username = 'you username goes here'
|
32
|
+
config.password= 'you password goes here'
|
33
|
+
config.from = 'Your identification (OPTIONAL)'
|
34
|
+
end
|
35
|
+
|
36
|
+
client = TWW.client
|
37
|
+
resp = client.deliver('11987654321', 'Hello World from TWW Gem')
|
38
|
+
|
39
|
+
case
|
40
|
+
when resp.ok?
|
41
|
+
puts 'Everything is nice!'
|
42
|
+
when resp.nok?
|
43
|
+
puts 'Something goes wrong'
|
44
|
+
when resp.na?
|
45
|
+
puts 'Service not available!'
|
46
|
+
when resp.error?
|
47
|
+
puts 'Unknow error'
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
27
51
|
## Development
|
28
52
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake
|
53
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
54
|
|
31
55
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
56
|
|
33
57
|
## Contributing
|
34
58
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
59
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/dlibanori/tww.
|
36
60
|
|
37
61
|
|
38
62
|
## License
|
data/lib/tww/testing.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'tww/client'
|
2
|
+
require 'tww/response'
|
3
|
+
|
4
|
+
module TWW
|
5
|
+
class Client
|
6
|
+
attr_accessor :sent
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@sent = []
|
10
|
+
end
|
11
|
+
|
12
|
+
def deliver(phone, message)
|
13
|
+
sent.push(phone: phone, message: message)
|
14
|
+
Response.parse('<string>OK</string>')
|
15
|
+
end
|
16
|
+
|
17
|
+
def clear
|
18
|
+
sent.clear
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/tww/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tww
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Libanori
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- lib/tww/client.rb
|
171
171
|
- lib/tww/config.rb
|
172
172
|
- lib/tww/response.rb
|
173
|
+
- lib/tww/testing.rb
|
173
174
|
- lib/tww/version.rb
|
174
175
|
- tww.gemspec
|
175
176
|
homepage: https://github.com/dlibanori/tww
|