capistrano-data_plane_api 0.1.5 → 0.3.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.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -2
  3. data/.ruby-version +1 -1
  4. data/CHANGELOG.md +12 -1
  5. data/Gemfile +7 -4
  6. data/Gemfile.lock +109 -69
  7. data/README.md +15 -0
  8. data/capistrano-data_plane_api.gemspec +5 -2
  9. data/exe/cap_data_plane_api +3 -2
  10. data/lib/capistrano/data_plane_api/configuration/backend.rb +3 -0
  11. data/lib/capistrano/data_plane_api/configuration/server.rb +4 -2
  12. data/lib/capistrano/data_plane_api/configuration/symbol.rb +2 -0
  13. data/lib/capistrano/data_plane_api/configuration.rb +3 -3
  14. data/lib/capistrano/data_plane_api/deploy/args.rb +79 -41
  15. data/lib/capistrano/data_plane_api/deploy/deployment_stats.rb +29 -25
  16. data/lib/capistrano/data_plane_api/deploy/group.rb +33 -24
  17. data/lib/capistrano/data_plane_api/deploy/helper.rb +3 -5
  18. data/lib/capistrano/data_plane_api/deploy/server_stats.rb +60 -43
  19. data/lib/capistrano/data_plane_api/deploy.rb +3 -2
  20. data/lib/capistrano/data_plane_api/diggable.rb +5 -2
  21. data/lib/capistrano/data_plane_api/equatable.rb +4 -2
  22. data/lib/capistrano/data_plane_api/helper.rb +31 -27
  23. data/lib/capistrano/data_plane_api/hooks.rb +1 -0
  24. data/lib/capistrano/data_plane_api/show_state.rb +15 -12
  25. data/lib/capistrano/data_plane_api/tasks.rb +26 -2
  26. data/lib/capistrano/data_plane_api/terminal_print_loop.rb +7 -4
  27. data/lib/capistrano/data_plane_api/type.rb +9 -5
  28. data/lib/capistrano/data_plane_api/version.rb +2 -2
  29. data/lib/capistrano/data_plane_api.rb +100 -73
  30. data/lib/capistrano-data_plane_api.rb +4 -0
  31. data/rbi/capistrano-data_plane_api.rbi +283 -0
  32. data/sorbet/config +6 -0
  33. data/sorbet/rbi/annotations/.gitattributes +1 -0
  34. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  35. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  36. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  37. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  38. data/sorbet/rbi/dsl/.gitattributes +1 -0
  39. data/sorbet/rbi/dsl/capistrano/data_plane_api/configuration/backend.rbi +56 -0
  40. data/sorbet/rbi/dsl/capistrano/data_plane_api/configuration/server.rbi +24 -0
  41. data/sorbet/rbi/dsl/capistrano/data_plane_api/configuration.rbi +52 -0
  42. data/sorbet/rbi/dsl/capistrano/data_plane_api/type.rbi +12 -0
  43. data/sorbet/rbi/gems/.gitattributes +1 -0
  44. data/sorbet/rbi/gems/addressable@2.8.7.rbi +1994 -0
  45. data/sorbet/rbi/gems/ast@2.4.3.rbi +585 -0
  46. data/sorbet/rbi/gems/base64@0.2.0.rbi +509 -0
  47. data/sorbet/rbi/gems/bigdecimal@3.1.9.rbi +8 -0
  48. data/sorbet/rbi/gems/booleans@0.1.3.rbi +28 -0
  49. data/sorbet/rbi/gems/byebug@12.0.0.rbi +37 -0
  50. data/sorbet/rbi/gems/crack@1.0.0.rbi +145 -0
  51. data/sorbet/rbi/gems/data_plane_api@0.2.0.rbi +238 -0
  52. data/sorbet/rbi/gems/faraday-net_http@3.4.0.rbi +147 -0
  53. data/sorbet/rbi/gems/faraday@2.13.0.rbi +2974 -0
  54. data/sorbet/rbi/gems/hashdiff@1.1.2.rbi +353 -0
  55. data/sorbet/rbi/gems/json@2.10.2.rbi +2113 -0
  56. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +240 -0
  57. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  58. data/sorbet/rbi/gems/minitest@5.25.5.rbi +1547 -0
  59. data/sorbet/rbi/gems/net-http@0.6.0.rbi +4247 -0
  60. data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
  61. data/sorbet/rbi/gems/pastel@0.8.0.rbi +733 -0
  62. data/sorbet/rbi/gems/public_suffix@6.0.1.rbi +936 -0
  63. data/sorbet/rbi/gems/racc@1.8.1.rbi +160 -0
  64. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +404 -0
  65. data/sorbet/rbi/gems/rake@13.0.6.rbi +3030 -0
  66. data/sorbet/rbi/gems/rexml@3.4.1.rbi +5346 -0
  67. data/sorbet/rbi/gems/rubocop-espago@1.1.8.rbi +9 -0
  68. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  69. data/sorbet/rbi/gems/shale-builder@0.2.4.rbi +9 -0
  70. data/sorbet/rbi/gems/shale@1.2.2.rbi +2323 -0
  71. data/sorbet/rbi/gems/shoulda-context@2.0.0.rbi +563 -0
  72. data/sorbet/rbi/gems/strings-ansi@0.2.0.rbi +178 -0
  73. data/sorbet/rbi/gems/strings@0.2.1.rbi +830 -0
  74. data/sorbet/rbi/gems/thor@1.2.1.rbi +3957 -0
  75. data/sorbet/rbi/gems/tty-box@0.7.0.rbi +593 -0
  76. data/sorbet/rbi/gems/tty-color@0.6.0.rbi +241 -0
  77. data/sorbet/rbi/gems/tty-cursor@0.7.1.rbi +443 -0
  78. data/sorbet/rbi/gems/unicode-display_width@2.6.0.rbi +66 -0
  79. data/sorbet/rbi/gems/unicode_utils@1.4.0.rbi +184 -0
  80. data/sorbet/rbi/gems/uri@1.0.3.rbi +2349 -0
  81. data/sorbet/rbi/gems/vcr@6.3.1.rbi +3040 -0
  82. data/sorbet/rbi/gems/webmock@3.25.1.rbi +1792 -0
  83. data/sorbet/rbi/shims/gems/faraday.rbi +21 -0
  84. data/sorbet/rbi/shims/gems/shoulda-context@2.0.0.rbi +15 -0
  85. data/sorbet/rbi/todo.rbi +7 -0
  86. data/sorbet/tapioca/config.yml +28 -0
  87. data/sorbet/tapioca/extensions/load_gem.rb +1 -0
  88. data/sorbet/tapioca/require.rb +4 -0
  89. data/templates/bin/deploy.rb +1 -0
  90. data/templates/config/data_plane_api.yml +1 -0
  91. metadata +106 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 297cd22ece0e041f4f66d9cc3152f484e3ae8b12521f90904231201fce8ab926
4
- data.tar.gz: 40f67d1856921f004299cc98f536f4de2a9a9f5c50a5871a2bac73f860cfd74f
3
+ metadata.gz: 502c957860848750f102b26efbdc1bae2e4aacc70d4597394806fa48f877bde5
4
+ data.tar.gz: 6be72e9c47e67a70ed54833f74bce86a736a40750dada0892f9481009318c55a
5
5
  SHA512:
6
- metadata.gz: 40544833867016abbd903eda2ae793e8ba8ec6c561d7d5d8358f1c0cd4b063acf6235c9dcc54027b3718f62e405fb0519df835a096867776bb6888d1425a9531
7
- data.tar.gz: 5e0e7a3ccc2a118d3161542f0a31fde548ee5b7e228aa7b92936b109095bc46d1f3dd70df2847ebf2e5821eff6773d4967fc21bccfdac8be928d13a6ce4e34ce
6
+ metadata.gz: 2cf8ee103dbf52dc98e19c3f3927b3e997cb7b2b5fd504338dd8d3f754dd44f4073e53218baa6a821d7d0667af0f99e595786b6ad5cf2343aeb150df5265fa76
7
+ data.tar.gz: d3efeff078f47dce3c04aa93ffb169da6b8c575e2725313adceea52a706d34c0d3b1fce63b610c2ebb6b68828e7e92a47675044ef271968d0f4b8bc243c0a9f8
data/.rubocop.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  inherit_gem:
2
- rubocop-espago: rubocop.yml
2
+ rubocop-espago: sorbet.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.7
5
+ TargetRubyVersion: 3.2
6
+
7
+ Naming/FileName:
8
+ Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.0
1
+ 3.4.5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2022-12-28
3
+ ## [0.3.0] - 09.09.2025
4
+
5
+ - Add `api_url` per HAProxy backend
6
+ - Add `--no-asset-precompilation` CLI flag
7
+
8
+ ## [0.2.0] - 11.04.2025
9
+
10
+ - Update `data_plane_api` to `>= 0.2.0`
11
+ - Add the `-C`/`--check` flag to `bin/deploy`
12
+ - Rewrite YARD to sorbet (with inline RBS)
13
+
14
+ ## [0.1.0] - 28.12.2022
4
15
 
5
16
  - Initial release
data/Gemfile CHANGED
@@ -5,11 +5,14 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in capistrano-data_plane_api.gemspec
6
6
  gemspec
7
7
 
8
- gem 'minitest', '~> 5.0' # Test framework
8
+ gem 'byebug', '~> 12.0' # debugger
9
+ gem 'minitest', '~> 5.0' # Tests framework
9
10
  gem 'rake', '~> 13.0' # Ruby automation tasks
10
11
  gem 'rubocop', '~> 1.21' # Ruby linter
11
12
  gem 'rubocop-espago', '~> 1.0' # Custom Ruby linter config
12
- gem 'solargraph' # Ruby language server
13
+ gem 'rubocop-sorbet', '~> 0.10.0' # Rubocop config for sorbet
13
14
  gem 'shoulda-context', '~> 2.0' # Testing utilities
14
- gem 'vcr' # Save HTTP interactions to files during tests
15
- gem 'webmock' # Mock network interactions
15
+ gem 'sorbet', '~> 0.5' # static typechecker
16
+ gem 'tapioca', '~> 0.16.11', require: false # RBI generator
17
+ gem 'vcr', '~> 6.3.1' # Save HTTP interactions to files during tests
18
+ gem 'webmock', '~> 3.25.1' # Mock network interactions
data/Gemfile.lock CHANGED
@@ -1,10 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-data_plane_api (0.1.5)
5
- data_plane_api (~> 0.1)
4
+ capistrano-data_plane_api (0.3.0)
5
+ booleans (~> 0.1)
6
+ data_plane_api (>= 0.2)
6
7
  pastel (< 1)
7
8
  shale (>= 1, < 2)
9
+ shale-builder (~> 0.2.4)
10
+ sorbet-runtime (~> 0.5)
8
11
  thor (> 1, < 2)
9
12
  tty-box (< 1)
10
13
  tty-cursor (< 1)
@@ -12,117 +15,154 @@ PATH
12
15
  GEM
13
16
  remote: https://rubygems.org/
14
17
  specs:
15
- addressable (2.8.1)
16
- public_suffix (>= 2.0.2, < 6.0)
17
- ast (2.4.2)
18
- backport (1.2.0)
18
+ addressable (2.8.7)
19
+ public_suffix (>= 2.0.2, < 7.0)
20
+ ast (2.4.3)
21
+ base64 (0.2.0)
19
22
  benchmark (0.2.1)
20
- crack (0.4.5)
23
+ bigdecimal (3.1.9)
24
+ booleans (0.1.3)
25
+ sorbet-runtime (>= 0.5)
26
+ byebug (12.0.0)
27
+ crack (1.0.0)
28
+ bigdecimal
21
29
  rexml
22
- data_plane_api (0.1.2)
30
+ data_plane_api (0.2.0)
31
+ booleans (~> 0.1.3)
23
32
  faraday (> 1, < 3)
24
- diff-lcs (1.5.0)
25
- e2mmap (0.1.0)
26
- faraday (2.7.2)
27
- faraday-net_http (>= 2.0, < 3.1)
28
- ruby2_keywords (>= 0.0.4)
29
- faraday-net_http (3.0.2)
30
- hashdiff (1.0.1)
31
- jaro_winkler (1.5.4)
32
- json (2.6.3)
33
- kramdown (2.4.0)
34
- rexml
35
- kramdown-parser-gfm (1.1.0)
36
- kramdown (~> 2.0)
37
- mini_portile2 (2.8.1)
38
- minitest (5.16.3)
39
- nokogiri (1.13.10)
40
- mini_portile2 (~> 2.8.0)
41
- racc (~> 1.4)
42
- parallel (1.22.1)
43
- parser (3.1.3.0)
33
+ sorbet-runtime (~> 0.5)
34
+ erubi (1.13.1)
35
+ faraday (2.13.0)
36
+ faraday-net_http (>= 2.0, < 3.5)
37
+ json
38
+ logger
39
+ faraday-net_http (3.4.0)
40
+ net-http (>= 0.5.0)
41
+ hashdiff (1.1.2)
42
+ json (2.10.2)
43
+ language_server-protocol (3.17.0.4)
44
+ lint_roller (1.1.0)
45
+ logger (1.7.0)
46
+ minitest (5.25.5)
47
+ net-http (0.6.0)
48
+ uri
49
+ netrc (0.11.0)
50
+ parallel (1.26.3)
51
+ parser (3.3.7.4)
44
52
  ast (~> 2.4.1)
53
+ racc
45
54
  pastel (0.8.0)
46
55
  tty-color (~> 0.5)
47
- public_suffix (5.0.1)
48
- racc (1.6.2)
56
+ prism (1.4.0)
57
+ public_suffix (6.0.1)
58
+ racc (1.8.1)
49
59
  rainbow (3.1.1)
50
60
  rake (13.0.6)
51
- regexp_parser (2.6.1)
52
- reverse_markdown (2.1.1)
53
- nokogiri
54
- rexml (3.2.5)
55
- rubocop (1.41.1)
61
+ rbi (0.3.1)
62
+ prism (~> 1.0)
63
+ rbs (>= 3.4.4)
64
+ sorbet-runtime (>= 0.5.9204)
65
+ rbs (3.9.2)
66
+ logger
67
+ regexp_parser (2.10.0)
68
+ rexml (3.4.1)
69
+ rubocop (1.75.2)
56
70
  json (~> 2.3)
71
+ language_server-protocol (~> 3.17.0.2)
72
+ lint_roller (~> 1.1.0)
57
73
  parallel (~> 1.10)
58
- parser (>= 3.1.2.1)
74
+ parser (>= 3.3.0.2)
59
75
  rainbow (>= 2.2.2, < 4.0)
60
- regexp_parser (>= 1.8, < 3.0)
61
- rexml (>= 3.2.5, < 4.0)
62
- rubocop-ast (>= 1.23.0, < 2.0)
76
+ regexp_parser (>= 2.9.3, < 3.0)
77
+ rubocop-ast (>= 1.44.0, < 2.0)
63
78
  ruby-progressbar (~> 1.7)
64
- unicode-display_width (>= 1.4.0, < 3.0)
65
- rubocop-ast (1.24.0)
66
- parser (>= 3.1.1.0)
67
- rubocop-espago (1.0.2)
79
+ unicode-display_width (>= 2.4.0, < 4.0)
80
+ rubocop-ast (1.44.0)
81
+ parser (>= 3.3.7.2)
82
+ prism (~> 1.4)
83
+ rubocop-espago (1.1.8)
68
84
  rubocop
69
- ruby-progressbar (1.11.0)
70
- ruby2_keywords (0.0.5)
71
- shale (1.0.0)
85
+ rubocop-sorbet (0.10.0)
86
+ rubocop (>= 1)
87
+ ruby-progressbar (1.13.0)
88
+ shale (1.2.2)
89
+ bigdecimal
90
+ shale-builder (0.2.4)
91
+ booleans (>= 0.1)
92
+ shale (< 2.0)
93
+ sorbet-runtime (> 0.5)
72
94
  shoulda-context (2.0.0)
73
- solargraph (0.48.0)
74
- backport (~> 1.2)
75
- benchmark
76
- bundler (>= 1.17.2)
77
- diff-lcs (~> 1.4)
78
- e2mmap
79
- jaro_winkler (~> 1.5)
80
- kramdown (~> 2.3)
81
- kramdown-parser-gfm (~> 1.1)
82
- parser (~> 3.0)
83
- reverse_markdown (>= 1.0.5, < 3)
84
- rubocop (>= 0.52)
85
- thor (~> 1.0)
86
- tilt (~> 2.0)
87
- yard (~> 0.9, >= 0.9.24)
95
+ sorbet (0.5.12003)
96
+ sorbet-static (= 0.5.12003)
97
+ sorbet-runtime (0.5.12003)
98
+ sorbet-static (0.5.12003-universal-darwin)
99
+ sorbet-static (0.5.12003-x86_64-linux)
100
+ sorbet-static-and-runtime (0.5.12003)
101
+ sorbet (= 0.5.12003)
102
+ sorbet-runtime (= 0.5.12003)
103
+ spoom (1.6.1)
104
+ erubi (>= 1.10.0)
105
+ prism (>= 0.28.0)
106
+ rbi (>= 0.2.3)
107
+ sorbet-static-and-runtime (>= 0.5.10187)
108
+ thor (>= 0.19.2)
88
109
  strings (0.2.1)
89
110
  strings-ansi (~> 0.2)
90
111
  unicode-display_width (>= 1.5, < 3.0)
91
112
  unicode_utils (~> 1.4)
92
113
  strings-ansi (0.2.0)
114
+ tapioca (0.16.11)
115
+ benchmark
116
+ bundler (>= 2.2.25)
117
+ netrc (>= 0.11.0)
118
+ parallel (>= 1.21.0)
119
+ rbi (~> 0.2)
120
+ sorbet-static-and-runtime (>= 0.5.11087)
121
+ spoom (>= 1.2.0)
122
+ thor (>= 1.2.0)
123
+ yard-sorbet
93
124
  thor (1.2.1)
94
- tilt (2.0.11)
95
125
  tty-box (0.7.0)
96
126
  pastel (~> 0.8)
97
127
  strings (~> 0.2.0)
98
128
  tty-cursor (~> 0.7)
99
129
  tty-color (0.6.0)
100
130
  tty-cursor (0.7.1)
101
- unicode-display_width (2.3.0)
131
+ unicode-display_width (2.6.0)
102
132
  unicode_utils (1.4.0)
103
- vcr (6.1.0)
104
- webmock (3.18.1)
133
+ uri (1.0.3)
134
+ vcr (6.3.1)
135
+ base64
136
+ webmock (3.25.1)
105
137
  addressable (>= 2.8.0)
106
138
  crack (>= 0.3.2)
107
139
  hashdiff (>= 0.4.0, < 2.0.0)
108
140
  webrick (1.7.0)
109
141
  yard (0.9.28)
110
142
  webrick (~> 1.7.0)
143
+ yard-sorbet (0.9.0)
144
+ sorbet-runtime
145
+ yard
111
146
 
112
147
  PLATFORMS
113
148
  arm64-darwin-20
149
+ arm64-darwin-23
150
+ arm64-darwin-24
114
151
  x86_64-linux
115
152
 
116
153
  DEPENDENCIES
154
+ byebug (~> 12.0)
117
155
  capistrano-data_plane_api!
118
156
  minitest (~> 5.0)
119
157
  rake (~> 13.0)
120
158
  rubocop (~> 1.21)
121
159
  rubocop-espago (~> 1.0)
160
+ rubocop-sorbet (~> 0.10.0)
122
161
  shoulda-context (~> 2.0)
123
- solargraph
124
- vcr
125
- webmock
162
+ sorbet (~> 0.5)
163
+ tapioca (~> 0.16.11)
164
+ vcr (~> 6.3.1)
165
+ webmock (~> 3.25.1)
126
166
 
127
167
  BUNDLED WITH
128
- 2.4.1
168
+ 2.7.2
data/README.md CHANGED
@@ -73,6 +73,7 @@ This script can be used to deploy this app to remote servers.
73
73
 
74
74
  -c, --current Deploy from the currently checked out branch
75
75
  -t, --test Show the commands that would be executed but do not carry out the deployment
76
+ -C, --check Test deployment dependencies. Checks things like directory permissions, necessary utilities, HaProxy backends and servers
76
77
  -g, --group=GROUP Deploy the code to every server in the passed HAProxy backend/group
77
78
  --no-haproxy Do not modify the state of any server in HAProxy
78
79
  --force-haproxy Ignore the current state of servers in HAProxy
@@ -84,6 +85,7 @@ This script can be used to deploy this app to remote servers.
84
85
  -h, --help Prints this help
85
86
  -b, --branch=BRANCH Deploy the code from the passed Git branch
86
87
  --no-migrations Do not carry out migrations
88
+ --no-asset-precompilation Skip asset precompilation during deployment
87
89
  ```
88
90
 
89
91
  ### Example of commands
@@ -144,6 +146,7 @@ $ bin/deploy -g production -r deploy:restart
144
146
 
145
147
  There are three new Rake tasks:
146
148
 
149
+ - `data_plane_api:server:check` -- check the state of the currently deployed server and log it to stdout
147
150
  - `data_plane_api:server:set_drain` -- sets the admin state of the currently deployed server to `DRAIN`
148
151
  - `data_plane_api:server:set_maint` -- sets the admin state of the currently deployed server to `MAINT`
149
152
  - `data_plane_api:server:set_ready` -- sets the admin state of the currently deployed server to `READY`
@@ -175,6 +178,9 @@ Our config works as follows:
175
178
  ```
176
179
  deploy
177
180
  deploy:starting
181
+ deploy:check
182
+ [before]
183
+ data_plane_api:server:check
178
184
  deploy:started
179
185
  [after]
180
186
  data_plane_api:server:set_drain
@@ -192,6 +198,15 @@ deploy
192
198
 
193
199
  These tasks will only run when the `:web` role is added to the deployment stage.
194
200
 
201
+ ## Database migrations and asset precompilation
202
+
203
+ In order for the `--no-migrations` and `--no-asset-precompilation` flags to work correctly, you need to use this configuration in your `Capfile`:
204
+
205
+ ```rb
206
+ require 'capistrano/rails/assets' if ::ENV['NO_ASSET_PRECOMPILATION'].nil?
207
+ require 'capistrano/rails/migrations' if ::ENV['NO_MIGRATIONS'].nil?
208
+ ```
209
+
195
210
  ## Development
196
211
 
197
212
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -12,7 +12,7 @@ require_relative 'lib/capistrano/data_plane_api/version'
12
12
  spec.description = 'Capistrano plugin which helps you automatically change the admin state of your HAProxy servers'
13
13
  spec.homepage = 'https://github.com/espago/capistrano-data_plane_api'
14
14
  spec.license = 'MIT'
15
- spec.required_ruby_version = '>= 2.7.0'
15
+ spec.required_ruby_version = '>= 3.2.0'
16
16
 
17
17
  spec.metadata['homepage_uri'] = spec.homepage
18
18
  spec.metadata['source_code_uri'] = 'https://github.com/espago/capistrano-data_plane_api'
@@ -30,9 +30,12 @@ require_relative 'lib/capistrano/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 'data_plane_api', '~> 0.1'
33
+ spec.add_dependency 'booleans', '~> 0.1'
34
+ spec.add_dependency 'data_plane_api', '>= 0.2'
34
35
  spec.add_dependency 'pastel', '< 1'
35
36
  spec.add_dependency 'shale', '>= 1', '< 2'
37
+ spec.add_dependency 'shale-builder', '~> 0.2.4'
38
+ spec.add_dependency 'sorbet-runtime', '~> 0.5'
36
39
  spec.add_dependency 'thor', '> 1', '< 2'
37
40
  spec.add_dependency 'tty-box', '< 1'
38
41
  spec.add_dependency 'tty-cursor', '< 1'
@@ -3,13 +3,14 @@
3
3
 
4
4
  require 'thor'
5
5
 
6
+ # Implements the installer script for `capistrano-data_plane_api`
6
7
  class ::CapistranoDataPlaneApiCommand < ::Thor
7
8
  include ::Thor::Actions
8
9
 
9
10
  class << self
10
11
  # Define the generator's root folder
11
12
  #
12
- # @return [String]
13
+ #: -> String
13
14
  def source_root
14
15
  ::File.expand_path('..', __dir__)
15
16
  end
@@ -17,7 +18,7 @@ class ::CapistranoDataPlaneApiCommand < ::Thor
17
18
 
18
19
  desc 'install', 'Install the `capistrano-data_plane_api` gem in your application'
19
20
 
20
- # @return [void]
21
+ #: -> void
21
22
  def install
22
23
  copy_file 'templates/bin/deploy', 'bin/deploy'
23
24
  chmod 'bin/deploy', 'a+x'
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require_relative 'symbol'
@@ -6,9 +7,11 @@ require_relative 'server'
6
7
  module Capistrano
7
8
  module DataPlaneApi
8
9
  class Configuration < Type
10
+ # Contains the configuration options of a backend
9
11
  class Backend < Type
10
12
  attribute :name, ::Shale::Type::String
11
13
  attribute :styles, Symbol, collection: true
14
+ attribute :api_url, ::Shale::Type::String
12
15
  attribute :basic_user, ::Shale::Type::String
13
16
  attribute :basic_password, ::Shale::Type::String
14
17
  attribute :servers, Server, collection: true
@@ -1,18 +1,20 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Capistrano
4
5
  module DataPlaneApi
5
6
  class Configuration < Type
7
+ # Contains the configuration options of a server
6
8
  class Server < Type
7
9
  attribute :name, ::Shale::Type::String
8
10
  attribute :stage, ::Shale::Type::String
9
11
 
10
- # @return [String, nil]
12
+ #: -> String?
11
13
  def stage
12
14
  @stage || @name
13
15
  end
14
16
 
15
- # @return [String, nil]
17
+ #: -> String?
16
18
  def name
17
19
  @name || @stage
18
20
  end
@@ -1,8 +1,10 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Capistrano
4
5
  module DataPlaneApi
5
6
  class Configuration < Type
7
+ # A Shale type that represents a ruby `Symbol`
6
8
  class Symbol < ::Shale::Type::String
7
9
  class << self
8
10
  def cast(value)
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require 'yaml'
@@ -8,7 +9,7 @@ require 'shale'
8
9
 
9
10
  require_relative 'type'
10
11
 
11
- ::Dir[::File.expand_path('configuration/*.rb', __dir__)].sort.each { require _1 }
12
+ ::Dir[::File.expand_path('configuration/*.rb', __dir__)].each { require _1 }
12
13
 
13
14
  module Capistrano
14
15
  module DataPlaneApi
@@ -22,8 +23,7 @@ module Capistrano
22
23
  attribute :basic_password, ::Shale::Type::String
23
24
 
24
25
  class << self
25
- # @param path [String]
26
- # @return [self]
26
+ #: (String) -> instance
27
27
  def from_file(path)
28
28
  from_yaml ::ERB.new(::File.read(path)).result
29
29
  end