data_plane_api 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef9b77e23457f82223d970f629f3a49cd9d014d842f63b5b09ed69426728dcf5
4
- data.tar.gz: 2ddee17d5f8ca74c2c26a371aade290f8eed7318ef0ee4007a1d7bf5c5755250
3
+ metadata.gz: d93eeb2af8e44546e13b5e38c3265a7f8d93a953ad495a941adbf4016988e50b
4
+ data.tar.gz: 03ee9087558116db2daad2cda2614fdc680c345298abc38bedbf0f3969770022
5
5
  SHA512:
6
- metadata.gz: 8bc942ceebb102d2fb5805b48df7468e0cfcafe33ff7ee3508f9aef3c5b1ed7704dbfa29199fb990d5de992b24868cb274bcb37082a29e52a07fcb72834a6065
7
- data.tar.gz: fe7567a34f721e700674a8d0e4e156b0ed368d74897c08de38c150f0bfe5d8fbe399ae6efc9462c22175b0f447e5975f471bdd1f3b88a2f2ef499c03ed1f988e
6
+ metadata.gz: 18a2aaefd1a9ab73a275e4f9f6b7f99de59153ba2ac4f1645bccf336117e7ca09a2c0db5c7be1b549e2a54552f5e3062d915f948e34627703b878f20cc4c333c
7
+ data.tar.gz: 164860275acf0d67adf6e1216ac39c6f096757c517ea079e9922b42ddfda2f83e01b20f3514735747257848f6deb519dccbbeb8762ed74680cbb0616434f39a9
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.0
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gem 'minitest', '~> 5.0' # Tests framework
9
9
  gem 'rake', '~> 13.0' # Ruby automation tasks
10
10
  gem 'rubocop', '~> 1.21' # Ruby linter
11
11
  gem 'rubocop-espago', '~> 1.0' # Custom Ruby linter config
12
+ gem 'solargraph' # Ruby language server
12
13
  gem 'shoulda-context', '~> 2.0' # Testing utilities
13
- gem 'debug' # Ruby debugger
14
14
  gem 'vcr' # Save HTTP interactions to files during tests
15
15
  gem 'webmock' # Mock network interactions
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- data_plane_api (0.1.0)
5
- faraday (~> 2.7)
4
+ data_plane_api (0.1.2)
5
+ faraday (> 1, < 3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -10,30 +10,38 @@ GEM
10
10
  addressable (2.8.1)
11
11
  public_suffix (>= 2.0.2, < 6.0)
12
12
  ast (2.4.2)
13
+ backport (1.2.0)
14
+ benchmark (0.2.1)
13
15
  crack (0.4.5)
14
16
  rexml
15
- debug (1.7.0)
16
- irb (>= 1.5.0)
17
- reline (>= 0.3.1)
17
+ diff-lcs (1.5.0)
18
+ e2mmap (0.1.0)
18
19
  faraday (2.7.2)
19
20
  faraday-net_http (>= 2.0, < 3.1)
20
21
  ruby2_keywords (>= 0.0.4)
21
22
  faraday-net_http (3.0.2)
22
23
  hashdiff (1.0.1)
23
- io-console (0.6.0)
24
- irb (1.6.1)
25
- reline (>= 0.3.0)
24
+ jaro_winkler (1.5.4)
26
25
  json (2.6.3)
26
+ kramdown (2.4.0)
27
+ rexml
28
+ kramdown-parser-gfm (1.1.0)
29
+ kramdown (~> 2.0)
30
+ mini_portile2 (2.8.1)
27
31
  minitest (5.16.3)
32
+ nokogiri (1.13.10)
33
+ mini_portile2 (~> 2.8.0)
34
+ racc (~> 1.4)
28
35
  parallel (1.22.1)
29
36
  parser (3.1.3.0)
30
37
  ast (~> 2.4.1)
31
38
  public_suffix (5.0.1)
39
+ racc (1.6.1)
32
40
  rainbow (3.1.1)
33
41
  rake (13.0.6)
34
42
  regexp_parser (2.6.1)
35
- reline (0.3.2)
36
- io-console (~> 0.5)
43
+ reverse_markdown (2.1.1)
44
+ nokogiri
37
45
  rexml (3.2.5)
38
46
  rubocop (1.41.1)
39
47
  json (~> 2.3)
@@ -52,24 +60,45 @@ GEM
52
60
  ruby-progressbar (1.11.0)
53
61
  ruby2_keywords (0.0.5)
54
62
  shoulda-context (2.0.0)
63
+ solargraph (0.48.0)
64
+ backport (~> 1.2)
65
+ benchmark
66
+ bundler (>= 1.17.2)
67
+ diff-lcs (~> 1.4)
68
+ e2mmap
69
+ jaro_winkler (~> 1.5)
70
+ kramdown (~> 2.3)
71
+ kramdown-parser-gfm (~> 1.1)
72
+ parser (~> 3.0)
73
+ reverse_markdown (>= 1.0.5, < 3)
74
+ rubocop (>= 0.52)
75
+ thor (~> 1.0)
76
+ tilt (~> 2.0)
77
+ yard (~> 0.9, >= 0.9.24)
78
+ thor (1.2.1)
79
+ tilt (2.0.11)
55
80
  unicode-display_width (2.3.0)
56
81
  vcr (6.1.0)
57
82
  webmock (3.18.1)
58
83
  addressable (>= 2.8.0)
59
84
  crack (>= 0.3.2)
60
85
  hashdiff (>= 0.4.0, < 2.0.0)
86
+ webrick (1.7.0)
87
+ yard (0.9.28)
88
+ webrick (~> 1.7.0)
61
89
 
62
90
  PLATFORMS
63
91
  arm64-darwin-20
92
+ x86_64-linux
64
93
 
65
94
  DEPENDENCIES
66
95
  data_plane_api!
67
- debug
68
96
  minitest (~> 5.0)
69
97
  rake (~> 13.0)
70
98
  rubocop (~> 1.21)
71
99
  rubocop-espago (~> 1.0)
72
100
  shoulda-context (~> 2.0)
101
+ solargraph
73
102
  vcr
74
103
  webmock
75
104
 
@@ -30,7 +30,7 @@ require_relative 'lib/data_plane_api/version'
30
30
  spec.require_paths = ['lib']
31
31
 
32
32
  # Uncomment to register a new dependency of your gem
33
- spec.add_dependency 'faraday', '~> 2.7'
33
+ spec.add_dependency 'faraday', '> 1', '< 3'
34
34
 
35
35
  # For more information and examples about making a new gem, check out our
36
36
  # guide at: https://bundler.io/guides/creating_gem.html
@@ -43,6 +43,7 @@ module DataPlaneApi
43
43
  @logger = logger
44
44
  @timeout = timeout
45
45
  @parent = parent
46
+ @connection = nil
46
47
 
47
48
  return unless global
48
49
 
@@ -105,15 +106,31 @@ module DataPlaneApi
105
106
 
106
107
  private
107
108
 
108
- # @return [Faraday::Connection]
109
- def build_connection
110
- headers = { 'Content-Type' => 'application/json' }
109
+ if ::Faraday::VERSION > '2'
110
+ # @return [Faraday::Connection]
111
+ def build_connection
112
+ headers = { 'Content-Type' => 'application/json' }
111
113
 
112
- ::Faraday.new(url: "#{url}/v2/", headers: headers) do |f|
113
- f.request :json
114
- f.response :json
115
- f.request :authorization, :basic, basic_user, basic_password
114
+ ::Faraday.new(url: "#{url}/v2/", headers: headers) do |f|
115
+ f.request :json
116
+ f.response :json
117
+ f.request :authorization, :basic, basic_user, basic_password
118
+ end
119
+ end
120
+ else
121
+ # Faraday 1.x compatibility
122
+
123
+ # @return [Faraday::Connection]
124
+ def build_connection
125
+ headers = { 'Content-Type' => 'application/json' }
126
+
127
+ ::Faraday.new(url: "#{url}/v2/", headers: headers) do |f|
128
+ f.request :json
129
+ f.response :json
130
+ f.request :basic_auth, basic_user, basic_password
131
+ end
116
132
  end
117
133
  end
134
+
118
135
  end
119
136
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module DataPlaneApi
4
4
  # @return [String]
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.2'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_plane_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Drewniak
@@ -9,22 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-12-27 00:00:00.000000000 Z
12
+ date: 2022-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">"
19
19
  - !ruby/object:Gem::Version
20
- version: '2.7'
20
+ version: '1'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '3'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">"
29
+ - !ruby/object:Gem::Version
30
+ version: '1'
31
+ - - "<"
26
32
  - !ruby/object:Gem::Version
27
- version: '2.7'
33
+ version: '3'
28
34
  description: Ruby gem which covers a limited subset of the HAProxy Data Plane API.
29
35
  email:
30
36
  - m.drewniak@espago.com
@@ -33,6 +39,7 @@ extensions: []
33
39
  extra_rdoc_files: []
34
40
  files:
35
41
  - ".rubocop.yml"
42
+ - ".ruby-version"
36
43
  - CHANGELOG.md
37
44
  - Gemfile
38
45
  - Gemfile.lock
@@ -67,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
74
  - !ruby/object:Gem::Version
68
75
  version: '0'
69
76
  requirements: []
70
- rubygems_version: 3.3.26
77
+ rubygems_version: 3.4.1
71
78
  signing_key:
72
79
  specification_version: 4
73
80
  summary: Ruby gem which covers a limited subset of the HAProxy Data Plane API.