tww 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 106cbb338670358dd0b1f4280144419472d9f998
4
- data.tar.gz: 8c5fd796774a5f896b4e0c78b538a77845997540
3
+ metadata.gz: a219a2a6c7e35cd577a66d93804ff9e0b5a68330
4
+ data.tar.gz: 326f855938c37d1a52be2858b6ffcfb74698ea2a
5
5
  SHA512:
6
- metadata.gz: 0ca0766656f33b1fccac89ebf852d2e798631c066d63658a40c191bb0f1fd36e2f5d36a543692d8d6859a1d33b4136d3f993d28fdb82bdaed74357075ecbea4d
7
- data.tar.gz: 73b2e9aff0300ae5b4e1ef69dcb70c4690c59851f595425d7b0ec4138ac55175c310ee95b3e78e65df85605ed4537b624fdd86fb42256dbdc0e1412d1733d464
6
+ metadata.gz: f543d46042744f4ebf40722c83287595294f11d08429c50dee9ec5b55a114ef8aeb1e33bc1ecd12216010f8cdf32f8cbfaee11bdb468e35a5793f6420eac396e
7
+ data.tar.gz: ae97104afc9fa50f12868dd71362320ece6b18d019a5dcbc3208738a0ae28ec0c56e9acae0742315160485150ff0a3de6f2d8beb578355c2ec8ff2ca36e6a289
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .byebug_history
11
+ *.gem
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # TWW
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tww`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
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 spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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/[USERNAME]/tww.
59
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dlibanori/tww.
36
60
 
37
61
 
38
62
  ## License
@@ -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
@@ -1,3 +1,3 @@
1
1
  module TWW
2
- VERSION = "0.1.0"
2
+ VERSION = '0.2.0'
3
3
  end
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.1.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-02-29 00:00:00.000000000 Z
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