hetznercloud 5.0.1 → 5.1.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: 220ef3f63a226743147fd71ad2f2441be908155e0758d3947045b77de875b4ba
4
- data.tar.gz: f412e6bb398c7d9cb23009c8ebb73a92446ccdea7188823c490be2ab43023a8d
3
+ metadata.gz: 75059c7c37ac0cb1f885b4af4f6c02567f926bb22ce3f77985456219da87546d
4
+ data.tar.gz: 3b02d023297bc5a4376901591f790b2d2009ba0ec0f8add1c51da405cee1d0ff
5
5
  SHA512:
6
- metadata.gz: 8cc014d12efa68db494767c628f3790566f997b39e52fb9fef61410e3a15c2055473f51d29634c95904633c9e1677c65d7c7065e0a5189cccf27b3d8ddf48814
7
- data.tar.gz: bbc5074702e469266bcf56791eb533d30265a60916bf56d4a8e8bd95de37c30b4cbe5e79171428963b0d7c717b1281995a316c593caa5b9a302c81a25f47e2e1
6
+ metadata.gz: 33a26943527f4e9136c21699670f01771f92d3bee9fe50c64347b2c33562005f692c9f1c3784c6d34e3b64ca8c5f956793678c698b4b89b2e6dc4bac66c99632
7
+ data.tar.gz: 7e9768db1f0e803dca01b1d8f698cc6c49a1f6737544cc43c88e64079003a2ff31889dfcb1b7939b2ad7408d08a61761d05c842efae64955cce7265fa97b1956
data/CHANGELOG.md CHANGED
@@ -10,6 +10,16 @@
10
10
 
11
11
  ### Fixed
12
12
 
13
+ ## HCloud v5.1.0 (2026-03-03)
14
+
15
+ ### Added
16
+
17
+ - Add `recommended` and `available` attributes to `HCloud::ServerTypeLocation`
18
+
19
+ ### Changed
20
+
21
+ - Deprecate `HCloud::DatacenterServerType#available`, `#available_for_migration`, `#supported` and `HCloud::Datacenter.recommendation`
22
+
13
23
  ## HCloud v5.0.1 (2026-01-15)
14
24
 
15
25
  ### Fixed
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HCloud
4
+ # @!visibility private
5
+ module DeprecatedAttributes
6
+ extend ActiveSupport::Concern
7
+
8
+ class_methods do
9
+ def attribute(name, *, deprecated: false, **)
10
+ super(name, *, **)
11
+
12
+ define_method(name) do |**params|
13
+ warn "[DEPRECATION] Field \"#{name}\" on #{self.class.name} is deprecated." if deprecated
14
+
15
+ super(**params)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HCloud
4
+ # @!visibility private
5
+ module InspectAttributes
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ def inspect
10
+ "#<#{self.class} #{attributes.filter_map do |name, value|
11
+ "#{name}: #{
12
+ if value.is_a?(Resource) || value.is_a?(Entity)
13
+ '<...>'
14
+ else
15
+ value.is_a?(Enumerable) ? '[...]' : value.inspect
16
+ end}"
17
+ end.join(', ')}>"
18
+ end
19
+ end
20
+ end
21
+ end
@@ -2,8 +2,19 @@
2
2
 
3
3
  module HCloud
4
4
  class DatacenterServerType < Entity
5
- attribute :available, array: true, default: -> { [] }
6
- attribute :available_for_migration, array: true, default: -> { [] }
7
- attribute :supported, array: true, default: -> { [] }
5
+ attribute :available,
6
+ array: true,
7
+ default: -> { [] },
8
+ deprecated: true
9
+
10
+ attribute :available_for_migration,
11
+ array: true,
12
+ default: -> { [] },
13
+ deprecated: true
14
+
15
+ attribute :supported,
16
+ array: true,
17
+ default: -> { [] },
18
+ deprecated: true
8
19
  end
9
20
  end
@@ -5,5 +5,8 @@ module HCloud
5
5
  attribute :id, :integer
6
6
  attribute :name
7
7
  attribute :deprecation, :deprecation
8
+
9
+ attribute :available, :boolean
10
+ attribute :recommended, :boolean
8
11
  end
9
12
  end
data/lib/hcloud/entity.rb CHANGED
@@ -6,16 +6,16 @@ module HCloud
6
6
  include ActiveModel::Attributes
7
7
  include ActiveModel::AttributeAssignment
8
8
 
9
+ include DeprecatedAttributes
10
+ include DynamicAttributes
11
+ include InspectAttributes
12
+
9
13
  def initialize(attributes = {})
10
14
  super()
11
15
 
12
16
  assign_attributes(attributes) if attributes
13
17
  end
14
18
 
15
- def inspect
16
- "#<#{self.class} #{attributes.filter_map { |name, value| "#{name}: #{value.inspect}" }.join(', ')}>"
17
- end
18
-
19
19
  def to_h
20
20
  attributes
21
21
  .transform_values { |v| v.try(:to_h) || v }
data/lib/hcloud/http.rb CHANGED
@@ -107,16 +107,16 @@ module HCloud
107
107
  def transform_params(params)
108
108
  params
109
109
  .transform_values do |value|
110
- # Don't transform if value is single argument: { sort: :id }
111
- next value unless value.respond_to?(:each)
110
+ # Don't transform if value is single argument: { sort: :id }
111
+ next value unless value.respond_to?(:each)
112
112
 
113
- value.map do |element|
114
- # Don't transform if element is single argument: { sort: [:id] }
115
- next element unless element.respond_to?(:each)
113
+ value.map do |element|
114
+ # Don't transform if element is single argument: { sort: [:id] }
115
+ next element unless element.respond_to?(:each)
116
116
 
117
- # Join elements with : { sort: [id: :asc] }
118
- element.to_a.join(":")
119
- end
117
+ # Join elements with : { sort: [id: :asc] }
118
+ element.to_a.join(":")
119
+ end
120
120
  end
121
121
  .compact
122
122
  end
@@ -6,7 +6,9 @@ module HCloud
6
6
  include ActiveModel::AttributeAssignment
7
7
 
8
8
  include Concerns
9
+ include DeprecatedAttributes
9
10
  include DynamicAttributes
11
+ include InspectAttributes
10
12
  include Subresource
11
13
 
12
14
  def initialize(attributes = {})
@@ -21,10 +23,6 @@ module HCloud
21
23
 
22
24
  delegate :[], to: :attributes
23
25
 
24
- def inspect
25
- "#<#{self.class} #{attributes.filter_map { |name, value| "#{name}: #{value.inspect}" }.join(', ')}>"
26
- end
27
-
28
26
  def to_h
29
27
  {
30
28
  id: id,
@@ -35,16 +33,6 @@ module HCloud
35
33
  id && id == other.id
36
34
  end
37
35
 
38
- def self.attribute(name, *, deprecated: false, **)
39
- super(name, *, **)
40
-
41
- define_method(name) do |**params|
42
- warn "[DEPRECATION] Field \"#{name}\" on #{self.class.name} is deprecated." if deprecated
43
-
44
- super(**params)
45
- end
46
- end
47
-
48
36
  def self.resource_name
49
37
  name.demodulize.underscore
50
38
  end
@@ -43,6 +43,8 @@ module HCloud
43
43
  attribute :server_types, :datacenter_server_type
44
44
 
45
45
  def self.recommendation
46
+ warn "[DEPRECATION] Field \"recommendation\" on #{self.class.name} is deprecated."
47
+
46
48
  find client
47
49
  .get(resource_path)
48
50
  .fetch(:recommendation)
@@ -4,8 +4,8 @@ module HCloud
4
4
  # @!visibility private
5
5
  module Version
6
6
  MAJOR = 5
7
- MINOR = 0
8
- PATCH = 1
7
+ MINOR = 1
8
+ PATCH = 0
9
9
  PRE = nil
10
10
 
11
11
  VERSION = [MAJOR, MINOR, PATCH].compact.join(".")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hetznercloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Dejonckheere
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-15 00:00:00.000000000 Z
11
+ date: 2026-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -101,7 +101,9 @@ files:
101
101
  - lib/hcloud/concerns/concerns.rb
102
102
  - lib/hcloud/concerns/creatable.rb
103
103
  - lib/hcloud/concerns/deletable.rb
104
+ - lib/hcloud/concerns/deprecated_attributes.rb
104
105
  - lib/hcloud/concerns/dynamic_attributes.rb
106
+ - lib/hcloud/concerns/inspect_attributes.rb
105
107
  - lib/hcloud/concerns/labelable.rb
106
108
  - lib/hcloud/concerns/meterable.rb
107
109
  - lib/hcloud/concerns/queryable.rb