scalingo 3.0.0.beta.1 → 3.0.0.beta.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/.gitignore +1 -1
- data/CHANGELOG.md +13 -1
- data/README.md +41 -27
- data/lib/scalingo.rb +1 -1
- data/lib/scalingo/api/client.rb +34 -17
- data/lib/scalingo/api/endpoint.rb +1 -1
- data/lib/scalingo/api/response.rb +21 -32
- data/lib/scalingo/bearer_token.rb +11 -5
- data/lib/scalingo/billing.rb +11 -0
- data/lib/scalingo/billing/profile.rb +46 -0
- data/lib/scalingo/client.rb +52 -26
- data/lib/scalingo/configuration.rb +98 -0
- data/lib/scalingo/regional/addons.rb +2 -2
- data/lib/scalingo/regional/containers.rb +1 -1
- data/lib/scalingo/regional/events.rb +2 -2
- data/lib/scalingo/regional/logs.rb +1 -1
- data/lib/scalingo/regional/metrics.rb +1 -1
- data/lib/scalingo/regional/notifiers.rb +1 -1
- data/lib/scalingo/regional/operations.rb +9 -1
- data/lib/scalingo/version.rb +1 -1
- data/samples/billing/profile/_meta.json +23 -0
- data/samples/billing/profile/create-201.json +50 -0
- data/samples/billing/profile/create-400.json +27 -0
- data/samples/billing/profile/create-422.json +44 -0
- data/samples/billing/profile/show-200.json +41 -0
- data/samples/billing/profile/show-404.json +22 -0
- data/samples/billing/profile/update-200.json +47 -0
- data/samples/billing/profile/update-422.json +32 -0
- data/scalingo.gemspec +1 -3
- data/spec/scalingo/api/client_spec.rb +168 -0
- data/spec/scalingo/api/endpoint_spec.rb +30 -0
- data/spec/scalingo/api/response_spec.rb +285 -0
- data/spec/scalingo/auth_spec.rb +15 -0
- data/spec/scalingo/bearer_token_spec.rb +72 -0
- data/spec/scalingo/billing/profile_spec.rb +55 -0
- data/spec/scalingo/client_spec.rb +93 -0
- data/spec/scalingo/configuration_spec.rb +55 -0
- data/spec/scalingo/regional/operations_spec.rb +11 -3
- data/spec/scalingo/regional_spec.rb +14 -0
- metadata +33 -40
- data/Gemfile.lock +0 -110
- data/lib/scalingo/config.rb +0 -38
data/Gemfile.lock
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
scalingo (3.0.0.beta.1)
|
5
|
-
activemodel (>= 5, < 7)
|
6
|
-
activesupport (>= 5, < 7)
|
7
|
-
dry-configurable (~> 0.11)
|
8
|
-
faraday (~> 1.0.1)
|
9
|
-
faraday_middleware (~> 1.0.0)
|
10
|
-
multi_json (~> 1.0, >= 1.0.3)
|
11
|
-
|
12
|
-
GEM
|
13
|
-
remote: https://rubygems.org/
|
14
|
-
specs:
|
15
|
-
activemodel (6.0.3.1)
|
16
|
-
activesupport (= 6.0.3.1)
|
17
|
-
activesupport (6.0.3.1)
|
18
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
|
-
i18n (>= 0.7, < 2)
|
20
|
-
minitest (~> 5.1)
|
21
|
-
tzinfo (~> 1.1)
|
22
|
-
zeitwerk (~> 2.2, >= 2.2.2)
|
23
|
-
addressable (2.7.0)
|
24
|
-
public_suffix (>= 2.0.2, < 5.0)
|
25
|
-
ast (2.4.0)
|
26
|
-
coderay (1.1.2)
|
27
|
-
concurrent-ruby (1.1.6)
|
28
|
-
crack (0.4.3)
|
29
|
-
safe_yaml (~> 1.0.0)
|
30
|
-
diff-lcs (1.3)
|
31
|
-
dry-configurable (0.11.5)
|
32
|
-
concurrent-ruby (~> 1.0)
|
33
|
-
dry-core (~> 0.4, >= 0.4.7)
|
34
|
-
dry-equalizer (~> 0.2)
|
35
|
-
dry-core (0.4.9)
|
36
|
-
concurrent-ruby (~> 1.0)
|
37
|
-
dry-equalizer (0.3.0)
|
38
|
-
faraday (1.0.1)
|
39
|
-
multipart-post (>= 1.2, < 3)
|
40
|
-
faraday_middleware (1.0.0)
|
41
|
-
faraday (~> 1.0)
|
42
|
-
hashdiff (1.0.1)
|
43
|
-
i18n (1.8.3)
|
44
|
-
concurrent-ruby (~> 1.0)
|
45
|
-
method_source (1.0.0)
|
46
|
-
minitest (5.14.1)
|
47
|
-
multi_json (1.14.1)
|
48
|
-
multipart-post (2.1.1)
|
49
|
-
parallel (1.19.1)
|
50
|
-
parser (2.7.1.2)
|
51
|
-
ast (~> 2.4.0)
|
52
|
-
pry (0.13.1)
|
53
|
-
coderay (~> 1.1)
|
54
|
-
method_source (~> 1.0)
|
55
|
-
public_suffix (4.0.4)
|
56
|
-
rainbow (3.0.0)
|
57
|
-
rake (10.5.0)
|
58
|
-
rexml (3.2.4)
|
59
|
-
rspec (3.9.0)
|
60
|
-
rspec-core (~> 3.9.0)
|
61
|
-
rspec-expectations (~> 3.9.0)
|
62
|
-
rspec-mocks (~> 3.9.0)
|
63
|
-
rspec-core (3.9.1)
|
64
|
-
rspec-support (~> 3.9.1)
|
65
|
-
rspec-expectations (3.9.1)
|
66
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
-
rspec-support (~> 3.9.0)
|
68
|
-
rspec-mocks (3.9.1)
|
69
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
-
rspec-support (~> 3.9.0)
|
71
|
-
rspec-support (3.9.2)
|
72
|
-
rubocop (0.83.0)
|
73
|
-
parallel (~> 1.10)
|
74
|
-
parser (>= 2.7.0.1)
|
75
|
-
rainbow (>= 2.2.2, < 4.0)
|
76
|
-
rexml
|
77
|
-
ruby-progressbar (~> 1.7)
|
78
|
-
unicode-display_width (>= 1.4.0, < 2.0)
|
79
|
-
rubocop-performance (1.5.2)
|
80
|
-
rubocop (>= 0.71.0)
|
81
|
-
ruby-progressbar (1.10.1)
|
82
|
-
safe_yaml (1.0.5)
|
83
|
-
standard (0.4.2)
|
84
|
-
rubocop (~> 0.83.0)
|
85
|
-
rubocop-performance (~> 1.5.2)
|
86
|
-
thread_safe (0.3.6)
|
87
|
-
tzinfo (1.2.7)
|
88
|
-
thread_safe (~> 0.1)
|
89
|
-
unicode-display_width (1.7.0)
|
90
|
-
webmock (3.8.3)
|
91
|
-
addressable (>= 2.3.6)
|
92
|
-
crack (>= 0.3.2)
|
93
|
-
hashdiff (>= 0.4.0, < 2.0.0)
|
94
|
-
zeitwerk (2.3.0)
|
95
|
-
|
96
|
-
PLATFORMS
|
97
|
-
ruby
|
98
|
-
|
99
|
-
DEPENDENCIES
|
100
|
-
bundler (~> 2.0)
|
101
|
-
pry (~> 0.13.1)
|
102
|
-
rake (~> 10.0)
|
103
|
-
rspec (~> 3.0)
|
104
|
-
rubocop (~> 0.83.0)
|
105
|
-
scalingo!
|
106
|
-
standard (~> 0.4.2)
|
107
|
-
webmock (~> 3.8.0)
|
108
|
-
|
109
|
-
BUNDLED WITH
|
110
|
-
2.1.4
|
data/lib/scalingo/config.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require "active_support/core_ext/numeric/time"
|
2
|
-
require "dry-configurable"
|
3
|
-
require "scalingo/version"
|
4
|
-
|
5
|
-
module Scalingo
|
6
|
-
extend Dry::Configurable
|
7
|
-
|
8
|
-
# Known regions. Each region should have a corresponding entry in the urls settings below
|
9
|
-
setting :regions, %i[osc_fr1 osc_secnum_fr1]
|
10
|
-
|
11
|
-
# Default region
|
12
|
-
setting :default_region, :osc_fr1
|
13
|
-
|
14
|
-
# Endpoints URLS
|
15
|
-
setting :urls do
|
16
|
-
setting :auth, "https://auth.scalingo.com/v1"
|
17
|
-
setting :osc_fr1, "https://api.osc-fr1.scalingo.com/v1"
|
18
|
-
setting :osc_secnum_fr1, "https://api.osc-secnum-fr1.scalingo.com/v1"
|
19
|
-
end
|
20
|
-
|
21
|
-
# Configure the User Agent header
|
22
|
-
setting :user_agent, "Scalingo Ruby Client v#{Scalingo::VERSION}"
|
23
|
-
|
24
|
-
# For how long is a bearer token considered valid (it will raise passed this delay).
|
25
|
-
# Set to nil to never raise.
|
26
|
-
setting :exchanged_token_validity, 1.hour
|
27
|
-
|
28
|
-
# Raise an exception when trying to use an authenticated connection without a bearer token set
|
29
|
-
# Having this setting to true prevents performing requests that would fail due to lack of authentication headers.
|
30
|
-
setting :raise_on_missing_authentication, true
|
31
|
-
|
32
|
-
# These headers will be added to every request. Individual methods may override them.
|
33
|
-
# This should be a hash or a callable object that returns a hash.
|
34
|
-
setting :additional_headers, {}
|
35
|
-
|
36
|
-
# Raise an exception when the bearer token in use is supposed to be invalid
|
37
|
-
setting :raise_on_expired_token, false
|
38
|
-
end
|