scaleway_api 0.1.0 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2f6e0c846f73845abc1e2ca6d6f6cd188273f499cd324618f20e06b531de873
4
- data.tar.gz: f6f2284456ca24ee9ac2e74835c84abef0f4c5d4629eeff9bb55b7f8c9992b72
3
+ metadata.gz: 831c0d0fff2fa97e366490aba1835edc66c878c5588423375ca09f2ba73c596f
4
+ data.tar.gz: 4cefae66223196c64bd8c9e7df2f0e7e02e6c5bcfb1132080c317bdc15ad89fa
5
5
  SHA512:
6
- metadata.gz: 15d868c8967d39ae350ed092e84c6da46a977eccf9110c89f1cc146d1486d6815ebef63cb4f139d03518b8433ee0846546ea6a8758fdfa4f2ac84b00f315f9e8
7
- data.tar.gz: c6a7f71225d542adaf29d5b0ca538345fe5f280fda9af747841ae1d51b07f6ae5f46b8355586d0c492b2a488dbf7c7660f8d83dd1a140b8802a6ea86cf403cb5
6
+ metadata.gz: 60cc99083ce4703d39b2dc8d5a7778b13e98a2da8dc89e2343b34d4366f0d6338a7ae72d7ef0ddf81689131fb9f5f7f04673d1d94fae7ee38da365f9085e2547
7
+ data.tar.gz: 5a4c18f4ad99702f3b2890e2e893018e336c0de865bbb734497e727ae0455c31e0510043a9f5c28be47af1ba7a7f3e814b8dd9ab982ff06663a79abe47778b25
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'activeresource'
4
+
3
5
  module ScalewayApi
4
6
  class Image < ActiveResource::Base # rubocop:disable Style/Documentation
5
- self.site = "https://api.scaleway.com/instance/v1/zones/#{ScalewayApi.configuration.region}"
6
- headers['X-Auth-Token'] = ScalewayApi.configuration.api_key
7
+ self.site = "https://api.scaleway.com/instance/v1/zones/#{ScalewayApi::Settings.config.region}"
8
+ headers['X-Auth-Token'] = ScalewayApi::Settings.config.api_key
7
9
  self.include_format_in_path = false
8
10
  end
9
11
  end
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'activeresource'
4
+
3
5
  module ScalewayApi
4
- class Image < ActiveResource::Base # rubocop:disable Style/Documentation
5
- self.site = "https://api.scaleway.com/instance/v1/zones/#{ScalewayApi.configuration.region}"
6
- headers['X-Auth-Token'] = ScalewayApi.configuration.api_key
6
+ class Server < ActiveResource::Base # rubocop:disable Style/Documentation
7
+ self.site = "https://api.scaleway.com/instance/v1/zones/#{ScalewayApi::Settings.config.region}"
8
+ headers['X-Auth-Token'] = ScalewayApi::Settings.config.api_key
7
9
  self.include_format_in_path = false
8
10
  end
9
11
  end
@@ -0,0 +1,10 @@
1
+ require 'dry-configurable'
2
+
3
+ module ScalewayApi # rubocop:disable Style/Documentation
4
+ class Settings # rubocop:disable Style/Documentation
5
+ extend Dry::Configurable
6
+
7
+ setting :region
8
+ setting :api_key
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ScalewayApi
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/scaleway_api.rb CHANGED
@@ -1,24 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'scaleway_api/settings'
4
+ require_relative 'scaleway_api/image'
5
+ require_relative 'scaleway_api/server'
3
6
  require_relative 'scaleway_api/version'
4
7
 
5
8
  module ScalewayApi # rubocop:disable Style/Documentation
6
9
  class Error < StandardError; end
7
-
8
- class << self
9
- attr_accessor :configuration
10
- end
11
-
12
- def self.configure
13
- self.configuration ||= Configuration.new
14
- yield(configuration)
15
- end
16
-
17
- class Configuration # rubocop:disable Style/Documentation
18
- attr_accessor :region, :api_key
19
-
20
- def initialize
21
- @region = 'fr-par-1'
22
- end
23
- end
24
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scaleway_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas_Skywalker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-30 00:00:00.000000000 Z
11
+ date: 2023-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: dry-configurable
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
27
41
  description: Ruby bindings for the Scaleway API.
28
42
  email:
29
43
  - LukasSkywalker@users.noreply.github.com
@@ -39,6 +53,7 @@ files:
39
53
  - lib/scaleway_api.rb
40
54
  - lib/scaleway_api/image.rb
41
55
  - lib/scaleway_api/server.rb
56
+ - lib/scaleway_api/settings.rb
42
57
  - lib/scaleway_api/version.rb
43
58
  - sig/scaleway_api.rbs
44
59
  homepage: https://github.com/code-fabrik/scaleway_ruby