bleepy 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/lib/bleepy/client/messages.rb +6 -3
- data/lib/bleepy/helpers.rb +5 -0
- data/lib/bleepy/request.rb +2 -4
- data/lib/bleepy/version.rb +1 -1
- data/lib/bleepy.rb +2 -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: 3be39a4ed863a03a17b0f2baf8c24882890ba7df
|
4
|
+
data.tar.gz: 523b0149eca76ce19524bfedc93975e298f9c3d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f28bb2b1933a06a9ec36e70aa5f3a21ff461d2029c6a2307992d92e616f22effdbebf27476813231143f548fad1b82aee8c4ff0ae29d013e6922e897ddfdac2
|
7
|
+
data.tar.gz: be8562ea5b70156b1224b3f92cc82dbb416a06aa2a1fe4420f41b5dbe92fd04676cb8fa96fb60767d0549f316828f7d48ca975b35d38941b2d8e2899a3308af9
|
@@ -3,11 +3,12 @@ module Bleepy
|
|
3
3
|
|
4
4
|
module Messages
|
5
5
|
def messages
|
6
|
-
get('messages')
|
6
|
+
get('messages').body['result']['entry']
|
7
7
|
end
|
8
8
|
|
9
9
|
def send_message(options = {})
|
10
|
-
post('messages', body(options))
|
10
|
+
message = post('messages', body(options))
|
11
|
+
message['location'].gsub(Bleepy::Helpers::BASE_URL + 'messages/', '')
|
11
12
|
end
|
12
13
|
|
13
14
|
private
|
@@ -15,7 +16,9 @@ module Bleepy
|
|
15
16
|
def body(options)
|
16
17
|
{
|
17
18
|
'entry' => {
|
18
|
-
'recipients' => [
|
19
|
+
'recipients' => [
|
20
|
+
{ 'value' => "tel:+55#{options.fetch(:recipient)}" }
|
21
|
+
],
|
19
22
|
'body' => options.fetch(:body),
|
20
23
|
'type' => 'sms',
|
21
24
|
'ackUri' => Bleepy.callback_url
|
data/lib/bleepy/request.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
module Bleepy
|
2
2
|
class Request
|
3
3
|
|
4
|
-
BASE_URL = 'http://api.take.io/rest/1.0/'
|
5
|
-
|
6
4
|
def get(url)
|
7
5
|
connection.get do |request|
|
8
6
|
request.url url
|
@@ -21,7 +19,7 @@ module Bleepy
|
|
21
19
|
private
|
22
20
|
|
23
21
|
def connection
|
24
|
-
Faraday.new BASE_URL do |conn|
|
22
|
+
Faraday.new Bleepy::Helpers::BASE_URL do |conn|
|
25
23
|
conn.request :oauth, oauth_params
|
26
24
|
conn.request :json
|
27
25
|
conn.response :json, content_type: /\bjson$/
|
@@ -31,7 +29,7 @@ module Bleepy
|
|
31
29
|
|
32
30
|
def headers
|
33
31
|
{
|
34
|
-
'User-Agent' =>
|
32
|
+
'User-Agent' => "Bleepy-#{Bleepy::VERSION}",
|
35
33
|
'Content-Type' => 'application/json'
|
36
34
|
}
|
37
35
|
end
|
data/lib/bleepy/version.rb
CHANGED
data/lib/bleepy.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'faraday_middleware'
|
3
3
|
require 'simple_oauth'
|
4
|
+
require 'bleepy/version'
|
4
5
|
|
5
6
|
module Bleepy
|
6
7
|
class << self
|
@@ -21,6 +22,6 @@ module Bleepy
|
|
21
22
|
end
|
22
23
|
|
23
24
|
autoload :Client, 'bleepy/client'
|
25
|
+
autoload :Helpers, 'bleepy/helpers'
|
24
26
|
autoload :Request, 'bleepy/request'
|
25
|
-
autoload :Version, 'bleepy/version'
|
26
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bleepy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Machado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- lib/bleepy.rb
|
121
121
|
- lib/bleepy/client.rb
|
122
122
|
- lib/bleepy/client/messages.rb
|
123
|
+
- lib/bleepy/helpers.rb
|
123
124
|
- lib/bleepy/request.rb
|
124
125
|
- lib/bleepy/version.rb
|
125
126
|
homepage: http://github.com/raisesistemas/bleepy
|