billimatic-client 0.1.2 → 0.2.1

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/.travis.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.8
4
- - 2.2.4
5
- - 2.3.0
3
+ - 2.2.5
4
+ - 2.3.1
6
5
  env:
7
6
  global:
8
7
  # CODECLIMATE_REPO_TOKEN
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- billimatic-client (0.1.2)
5
- multi_json (~> 1.11.2)
6
- typhoeus (~> 1.0.1)
4
+ billimatic-client (0.2.1)
5
+ multi_json (~> 1.11)
6
+ typhoeus (~> 0.8)
7
7
  virtus (~> 1.0.5)
8
8
  wisper (~> 1.6.1)
9
9
 
@@ -14,8 +14,8 @@ GEM
14
14
  descendants_tracker (~> 0.0.4)
15
15
  ice_nine (~> 0.11.0)
16
16
  thread_safe (~> 0.3, >= 0.3.1)
17
- byebug (8.2.4)
18
- codeclimate-test-reporter (0.5.0)
17
+ byebug (9.0.5)
18
+ codeclimate-test-reporter (0.5.2)
19
19
  simplecov (>= 0.7.1, < 1.0.0)
20
20
  coderay (1.1.1)
21
21
  coercible (1.0.0)
@@ -29,9 +29,9 @@ GEM
29
29
  ffi (>= 1.3.0)
30
30
  ffi (1.9.10)
31
31
  formatador (0.2.5)
32
- guard (2.13.0)
32
+ guard (2.14.0)
33
33
  formatador (>= 0.2.4)
34
- listen (>= 2.7, <= 4.0)
34
+ listen (>= 2.7, < 4.0)
35
35
  lumberjack (~> 1.0)
36
36
  nenv (~> 0.1)
37
37
  notiffany (~> 0.0)
@@ -39,31 +39,32 @@ GEM
39
39
  shellany (~> 0.0)
40
40
  thor (>= 0.18.1)
41
41
  guard-compat (1.2.1)
42
- guard-rspec (4.6.5)
42
+ guard-rspec (4.7.2)
43
43
  guard (~> 2.1)
44
44
  guard-compat (~> 1.1)
45
45
  rspec (>= 2.99.0, < 4.0)
46
46
  ice_nine (0.11.2)
47
47
  json (1.8.3)
48
- listen (3.0.6)
49
- rb-fsevent (>= 0.9.3)
50
- rb-inotify (>= 0.9.7)
48
+ listen (3.1.5)
49
+ rb-fsevent (~> 0.9, >= 0.9.4)
50
+ rb-inotify (~> 0.9, >= 0.9.7)
51
+ ruby_dep (~> 1.2)
51
52
  lumberjack (1.0.10)
52
53
  method_source (0.8.2)
53
- multi_json (1.11.3)
54
+ multi_json (1.12.1)
54
55
  nenv (0.3.0)
55
- notiffany (0.0.8)
56
+ notiffany (0.1.0)
56
57
  nenv (~> 0.1)
57
58
  shellany (~> 0.0)
58
- notifier (0.5.1)
59
+ notifier (0.5.2)
59
60
  pry (0.10.3)
60
61
  coderay (~> 1.1.0)
61
62
  method_source (~> 0.8.1)
62
63
  slop (~> 3.4)
63
- pry-byebug (3.3.0)
64
- byebug (~> 8.0)
64
+ pry-byebug (3.4.0)
65
+ byebug (~> 9.0)
65
66
  pry (~> 0.10)
66
- rake (11.1.2)
67
+ rake (11.2.2)
67
68
  rb-fsevent (0.9.7)
68
69
  rb-inotify (0.9.7)
69
70
  ffi (>= 0.5.0)
@@ -80,6 +81,7 @@ GEM
80
81
  diff-lcs (>= 1.2.0, < 2.0)
81
82
  rspec-support (~> 3.4.0)
82
83
  rspec-support (3.4.1)
84
+ ruby_dep (1.3.1)
83
85
  shellany (0.0.1)
84
86
  simplecov (0.11.2)
85
87
  docile (~> 1.1.0)
@@ -91,9 +93,9 @@ GEM
91
93
  notifier
92
94
  thor (0.19.1)
93
95
  thread_safe (0.3.5)
94
- typhoeus (1.0.2)
95
- ethon (>= 0.9.0)
96
- vcr (3.0.1)
96
+ typhoeus (0.8.0)
97
+ ethon (>= 0.8.0)
98
+ vcr (3.0.3)
97
99
  virtus (1.0.5)
98
100
  axiom-types (~> 0.1)
99
101
  coercible (~> 1.0)
data/README.md CHANGED
@@ -32,7 +32,7 @@ Or install it yourself as:
32
32
  require 'billimatic'
33
33
 
34
34
  Billimatic.configure do |config|
35
- config.url = 'https://sandbox.billimatic.com.br/api/v1' # defaults to 'https://app.billimatic.com.br/api/v1'
35
+ config.host = 'https://sandbox.billimatic.com.br' # defaults to 'https://app.billimatic.com.br'
36
36
  config.user_agent = 'My App v1.0' # optional, but you should pass a custom user-agent identifying your app
37
37
  end
38
38
  ```
@@ -6,8 +6,8 @@ require 'billimatic/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'billimatic-client'
8
8
  spec.version = Billimatic::VERSION
9
- spec.authors = ['Rodrigo Tassinari de Oliveira', 'Victor Franco']
10
- spec.email = ['rodrigo@pittlandia.net', 'victor.alexandrefs@gmail.com']
9
+ spec.authors = ['Rodrigo Tassinari de Oliveira', 'Leandro Thimóteo', 'Victor Franco']
10
+ spec.email = ['rodrigo@pittlandia.net', 'leandro.s.thimoteo@gmail.com', 'victor.alexandrefs@gmail.com']
11
11
 
12
12
  spec.summary = %q{This is the official Ruby client for the Billimatic API.}
13
13
  spec.description = %q{This is the official Ruby client for the Billimatic API. See http://www.billimatic.com.br for more information.}
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ['lib']
28
28
 
29
- spec.add_dependency 'typhoeus', '~> 1.0.1'
30
- spec.add_dependency 'multi_json', '~> 1.11.2'
29
+ spec.add_dependency 'typhoeus', '~> 0.8'
30
+ spec.add_dependency 'multi_json', '~> 1.11'
31
31
  spec.add_dependency 'virtus', '~> 1.0.5'
32
32
  spec.add_dependency 'wisper', '~> 1.6.1'
33
33
 
@@ -2,11 +2,15 @@ require "base64"
2
2
 
3
3
  module Billimatic
4
4
  class Configuration
5
- attr_accessor :url, :user_agent
5
+ attr_accessor :host, :user_agent
6
6
 
7
7
  def initialize
8
- @url = "https://app.billimatic.com.br/api/v1"
8
+ @host = "https://app.billimatic.com.br"
9
9
  @user_agent = "Billimatic Ruby Client v#{Billimatic::VERSION}"
10
10
  end
11
+
12
+ def url
13
+ "#{self.host}/api/v1"
14
+ end
11
15
  end
12
16
  end
@@ -1,6 +1,11 @@
1
1
  module Billimatic
2
2
  module Entities
3
3
  class Subscription < Contract
4
+ def checkout_url
5
+ # TODO should this come from the JSON from Billimatic?
6
+ fake_http = nil
7
+ Billimatic::Resources::Subscription.new(fake_http).checkout_url(token: self.token)
8
+ end
4
9
  end
5
10
  end
6
11
  end
@@ -14,6 +14,10 @@ module Billimatic
14
14
  respond_with_entity response
15
15
  end
16
16
  end
17
+
18
+ def checkout_url(token:)
19
+ "#{Billimatic.configuration.host}#{resource_base_path}/checkout/#{token}"
20
+ end
17
21
  end
18
22
  end
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module Billimatic
2
- VERSION = '0.1.2'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,211 +1,214 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billimatic-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Tassinari de Oliveira
8
+ - Leandro Thimóteo
8
9
  - Victor Franco
9
10
  autorequire:
10
11
  bindir: exe
11
12
  cert_chain: []
12
- date: 2016-06-22 00:00:00.000000000 Z
13
+ date: 2016-06-24 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: typhoeus
16
17
  requirement: !ruby/object:Gem::Requirement
17
18
  requirements:
18
- - - ~>
19
+ - - "~>"
19
20
  - !ruby/object:Gem::Version
20
- version: 1.0.1
21
+ version: '0.8'
21
22
  type: :runtime
22
23
  prerelease: false
23
24
  version_requirements: !ruby/object:Gem::Requirement
24
25
  requirements:
25
- - - ~>
26
+ - - "~>"
26
27
  - !ruby/object:Gem::Version
27
- version: 1.0.1
28
+ version: '0.8'
28
29
  - !ruby/object:Gem::Dependency
29
30
  name: multi_json
30
31
  requirement: !ruby/object:Gem::Requirement
31
32
  requirements:
32
- - - ~>
33
+ - - "~>"
33
34
  - !ruby/object:Gem::Version
34
- version: 1.11.2
35
+ version: '1.11'
35
36
  type: :runtime
36
37
  prerelease: false
37
38
  version_requirements: !ruby/object:Gem::Requirement
38
39
  requirements:
39
- - - ~>
40
+ - - "~>"
40
41
  - !ruby/object:Gem::Version
41
- version: 1.11.2
42
+ version: '1.11'
42
43
  - !ruby/object:Gem::Dependency
43
44
  name: virtus
44
45
  requirement: !ruby/object:Gem::Requirement
45
46
  requirements:
46
- - - ~>
47
+ - - "~>"
47
48
  - !ruby/object:Gem::Version
48
49
  version: 1.0.5
49
50
  type: :runtime
50
51
  prerelease: false
51
52
  version_requirements: !ruby/object:Gem::Requirement
52
53
  requirements:
53
- - - ~>
54
+ - - "~>"
54
55
  - !ruby/object:Gem::Version
55
56
  version: 1.0.5
56
57
  - !ruby/object:Gem::Dependency
57
58
  name: wisper
58
59
  requirement: !ruby/object:Gem::Requirement
59
60
  requirements:
60
- - - ~>
61
+ - - "~>"
61
62
  - !ruby/object:Gem::Version
62
63
  version: 1.6.1
63
64
  type: :runtime
64
65
  prerelease: false
65
66
  version_requirements: !ruby/object:Gem::Requirement
66
67
  requirements:
67
- - - ~>
68
+ - - "~>"
68
69
  - !ruby/object:Gem::Version
69
70
  version: 1.6.1
70
71
  - !ruby/object:Gem::Dependency
71
72
  name: bundler
72
73
  requirement: !ruby/object:Gem::Requirement
73
74
  requirements:
74
- - - ~>
75
+ - - "~>"
75
76
  - !ruby/object:Gem::Version
76
77
  version: '1.11'
77
78
  type: :development
78
79
  prerelease: false
79
80
  version_requirements: !ruby/object:Gem::Requirement
80
81
  requirements:
81
- - - ~>
82
+ - - "~>"
82
83
  - !ruby/object:Gem::Version
83
84
  version: '1.11'
84
85
  - !ruby/object:Gem::Dependency
85
86
  name: rake
86
87
  requirement: !ruby/object:Gem::Requirement
87
88
  requirements:
88
- - - ~>
89
+ - - "~>"
89
90
  - !ruby/object:Gem::Version
90
91
  version: '11.1'
91
92
  type: :development
92
93
  prerelease: false
93
94
  version_requirements: !ruby/object:Gem::Requirement
94
95
  requirements:
95
- - - ~>
96
+ - - "~>"
96
97
  - !ruby/object:Gem::Version
97
98
  version: '11.1'
98
99
  - !ruby/object:Gem::Dependency
99
100
  name: vcr
100
101
  requirement: !ruby/object:Gem::Requirement
101
102
  requirements:
102
- - - ~>
103
+ - - "~>"
103
104
  - !ruby/object:Gem::Version
104
105
  version: '3.0'
105
106
  type: :development
106
107
  prerelease: false
107
108
  version_requirements: !ruby/object:Gem::Requirement
108
109
  requirements:
109
- - - ~>
110
+ - - "~>"
110
111
  - !ruby/object:Gem::Version
111
112
  version: '3.0'
112
113
  - !ruby/object:Gem::Dependency
113
114
  name: pry-byebug
114
115
  requirement: !ruby/object:Gem::Requirement
115
116
  requirements:
116
- - - ~>
117
+ - - "~>"
117
118
  - !ruby/object:Gem::Version
118
119
  version: '3.3'
119
120
  type: :development
120
121
  prerelease: false
121
122
  version_requirements: !ruby/object:Gem::Requirement
122
123
  requirements:
123
- - - ~>
124
+ - - "~>"
124
125
  - !ruby/object:Gem::Version
125
126
  version: '3.3'
126
127
  - !ruby/object:Gem::Dependency
127
128
  name: rspec
128
129
  requirement: !ruby/object:Gem::Requirement
129
130
  requirements:
130
- - - ~>
131
+ - - "~>"
131
132
  - !ruby/object:Gem::Version
132
133
  version: '3.4'
133
134
  type: :development
134
135
  prerelease: false
135
136
  version_requirements: !ruby/object:Gem::Requirement
136
137
  requirements:
137
- - - ~>
138
+ - - "~>"
138
139
  - !ruby/object:Gem::Version
139
140
  version: '3.4'
140
141
  - !ruby/object:Gem::Dependency
141
142
  name: codeclimate-test-reporter
142
143
  requirement: !ruby/object:Gem::Requirement
143
144
  requirements:
144
- - - ~>
145
+ - - "~>"
145
146
  - !ruby/object:Gem::Version
146
147
  version: '0.5'
147
148
  type: :development
148
149
  prerelease: false
149
150
  version_requirements: !ruby/object:Gem::Requirement
150
151
  requirements:
151
- - - ~>
152
+ - - "~>"
152
153
  - !ruby/object:Gem::Version
153
154
  version: '0.5'
154
155
  - !ruby/object:Gem::Dependency
155
156
  name: simplecov
156
157
  requirement: !ruby/object:Gem::Requirement
157
158
  requirements:
158
- - - ~>
159
+ - - "~>"
159
160
  - !ruby/object:Gem::Version
160
161
  version: '0.11'
161
162
  type: :development
162
163
  prerelease: false
163
164
  version_requirements: !ruby/object:Gem::Requirement
164
165
  requirements:
165
- - - ~>
166
+ - - "~>"
166
167
  - !ruby/object:Gem::Version
167
168
  version: '0.11'
168
169
  - !ruby/object:Gem::Dependency
169
170
  name: guard-rspec
170
171
  requirement: !ruby/object:Gem::Requirement
171
172
  requirements:
172
- - - ~>
173
+ - - "~>"
173
174
  - !ruby/object:Gem::Version
174
175
  version: '4.6'
175
176
  type: :development
176
177
  prerelease: false
177
178
  version_requirements: !ruby/object:Gem::Requirement
178
179
  requirements:
179
- - - ~>
180
+ - - "~>"
180
181
  - !ruby/object:Gem::Version
181
182
  version: '4.6'
182
183
  - !ruby/object:Gem::Dependency
183
184
  name: test_notifier
184
185
  requirement: !ruby/object:Gem::Requirement
185
186
  requirements:
186
- - - ~>
187
+ - - "~>"
187
188
  - !ruby/object:Gem::Version
188
189
  version: '2.0'
189
190
  type: :development
190
191
  prerelease: false
191
192
  version_requirements: !ruby/object:Gem::Requirement
192
193
  requirements:
193
- - - ~>
194
+ - - "~>"
194
195
  - !ruby/object:Gem::Version
195
196
  version: '2.0'
196
197
  description: This is the official Ruby client for the Billimatic API. See http://www.billimatic.com.br
197
198
  for more information.
198
199
  email:
199
200
  - rodrigo@pittlandia.net
201
+ - leandro.s.thimoteo@gmail.com
200
202
  - victor.alexandrefs@gmail.com
201
203
  executables: []
202
204
  extensions: []
203
205
  extra_rdoc_files: []
204
206
  files:
205
- - .codeclimate.yml
206
- - .gitignore
207
- - .rspec
208
- - .travis.yml
207
+ - ".codeclimate.yml"
208
+ - ".gitignore"
209
+ - ".rspec"
210
+ - ".rubocop.yml"
211
+ - ".travis.yml"
209
212
  - Gemfile
210
213
  - Gemfile.lock
211
214
  - Guardfile
@@ -256,19 +259,18 @@ require_paths:
256
259
  - lib
257
260
  required_ruby_version: !ruby/object:Gem::Requirement
258
261
  requirements:
259
- - - ! '>='
262
+ - - ">="
260
263
  - !ruby/object:Gem::Version
261
264
  version: '0'
262
265
  required_rubygems_version: !ruby/object:Gem::Requirement
263
266
  requirements:
264
- - - ! '>='
267
+ - - ">="
265
268
  - !ruby/object:Gem::Version
266
269
  version: '0'
267
270
  requirements: []
268
271
  rubyforge_project:
269
- rubygems_version: 2.6.4
272
+ rubygems_version: 2.5.1
270
273
  signing_key:
271
274
  specification_version: 4
272
275
  summary: This is the official Ruby client for the Billimatic API.
273
276
  test_files: []
274
- has_rdoc: