bootic_client 0.0.23 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98a14f476c54dfe735ec39a74e9cc18e99e43bec
4
- data.tar.gz: 80339cfa940e046dac0c6120be2038660c5cf9b8
3
+ metadata.gz: 34a1f5f52be0931537722e1a90599316a94fc25a
4
+ data.tar.gz: 994665adf0866edd214518729480b3ee3689cd6c
5
5
  SHA512:
6
- metadata.gz: e1473d2577f407922fe2da780b207b9622383b47c0affe0b7aceae38033aa05bd34edbcfb9c2d089fb5a84d6fa476457928f658654d4db59bcd9e669e6d4a303
7
- data.tar.gz: e7ab8af34d8acf10a1e81fc26605d99dbf9ae47470b8d786e4bc1f6a4f385c3435639dcd5bd954868b2b1f69adfc4769dfbb50ad6f627a3e82d9430c9eb52358
6
+ metadata.gz: 3d786e2494e082587bbb684a0a7b078b2f6c43e3b3ba55d8b07c5a929b7deaf47db16a6a122e71574e64dfdaae8331edd39492ff38567f8fa48b078ac8d1820e
7
+ data.tar.gz: a9a3950497449be5c852b9bc4e4cc99a001e81084cc78ac5f7abc3c8acd924c86326ab768e5fcb4ebdca1021a3adbebaf81b2606e14961ba547254d0d55e70e0
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "bootic_client"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -18,12 +18,11 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "faraday", '~> 0.9'
21
+ spec.add_dependency "faraday", '~> 0.15'
22
22
  spec.add_dependency "uri_template", '~> 0.7'
23
- spec.add_dependency "faraday_middleware", '~> 0.9'
24
- spec.add_dependency "faraday-http-cache", '1.2.2'
23
+ spec.add_dependency "faraday-http-cache", '~> 2'
25
24
  spec.add_dependency "net-http-persistent", '~> 2.9'
26
- spec.add_dependency "oauth2", "1.3.1"
25
+ spec.add_dependency "oauth2", "~> 1.4"
27
26
 
28
27
  spec.add_development_dependency "bundler", "~> 1.3"
29
28
  spec.add_development_dependency "rake"
@@ -1,6 +1,5 @@
1
1
  require 'base64'
2
2
  require 'faraday'
3
- require 'faraday_middleware'
4
3
  require 'faraday-http-cache'
5
4
  require "bootic_client/errors"
6
5
  require 'faraday/adapter/net_http_persistent'
@@ -60,14 +59,25 @@ module BooticClient
60
59
  end
61
60
  end
62
61
 
62
+ class UTF8JSON
63
+ def self.dump(data)
64
+ data[:body] = data[:body].force_encoding('UTF-8') if data[:body].is_a?(String)
65
+ JSON.dump(data)
66
+ end
67
+
68
+ def self.load(string)
69
+ JSON.load(string)
70
+ end
71
+ end
72
+
63
73
  private
64
74
 
65
75
  def conn(&block)
66
76
  @conn ||= Faraday.new do |f|
67
- cache_options = {serializer: Marshal, shared_cache: false, store: options[:cache_store]}
77
+ cache_options = {serializer: UTF8JSON, shared_cache: false, store: options[:cache_store]}
68
78
  cache_options[:logger] = options[:logger] if options[:logging]
69
79
 
70
- # f.use :http_cache, cache_options
80
+ f.use :http_cache, cache_options
71
81
  f.response :logger, options[:logger] if options[:logging]
72
82
  yield f if block_given?
73
83
  f.adapter *Array(options[:faraday_adapter])
@@ -1,3 +1,3 @@
1
1
  module BooticClient
2
- VERSION = "0.0.23".freeze
2
+ VERSION = "0.0.24".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootic_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ismael Celis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-04 00:00:00.000000000 Z
11
+ date: 2019-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.9'
19
+ version: '0.15'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.9'
26
+ version: '0.15'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: uri_template
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,33 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.7'
41
41
  - !ruby/object:Gem::Dependency
42
- name: faraday_middleware
42
+ name: faraday-http-cache
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.9'
47
+ version: '2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.9'
55
- - !ruby/object:Gem::Dependency
56
- name: faraday-http-cache
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '='
60
- - !ruby/object:Gem::Version
61
- version: 1.2.2
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '='
67
- - !ruby/object:Gem::Version
68
- version: 1.2.2
54
+ version: '2'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: net-http-persistent
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +70,16 @@ dependencies:
84
70
  name: oauth2
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - '='
73
+ - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: 1.3.1
75
+ version: '1.4'
90
76
  type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - '='
80
+ - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: 1.3.1
82
+ version: '1.4'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: bundler
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -167,7 +153,8 @@ dependencies:
167
153
  description: Official Ruby client for the Bootic API
168
154
  email:
169
155
  - ismaelct@gmail.com
170
- executables: []
156
+ executables:
157
+ - console
171
158
  extensions: []
172
159
  extra_rdoc_files: []
173
160
  files:
@@ -180,6 +167,7 @@ files:
180
167
  - LICENSE.txt
181
168
  - README.md
182
169
  - Rakefile
170
+ - bin/console
183
171
  - bootic_client.gemspec
184
172
  - lib/bootic_client.rb
185
173
  - lib/bootic_client/client.rb