hetznercloud 1.7.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 186a93045de45b6cf305dda61558933994de8a109e319e2c5fe6454f56be667f
4
- data.tar.gz: b36eb396bb305052e67e5eda6b2f21a615013cdedcb57d8eceaae0ead59ca421
3
+ metadata.gz: 06a4e896b46519c4a0958035850492707d7daa2d1a31e47fea371b6a41c227d6
4
+ data.tar.gz: fba0bd660575d033ad085695bd973bdf5f322b74fd42e50b404e4948cd140020
5
5
  SHA512:
6
- metadata.gz: d2ff10c4bae59a8e32695d52546d3ca42121578ea79468e046d61d162d6e3055edcc2608ae2acb3fe99717f74a78ab4fe6fab89233ca2160e94a0fc99788d791
7
- data.tar.gz: 3bd2eb8a1960b9a417e0405d0f5653d56542a1d282308972f39d50451bd67c3dc3f7f5e36c358c315e6146babe2b390490f211c27de65a02a0615fd17570d351
6
+ metadata.gz: f6eb5ee3785442e6306114ed9d2dd9493c21101042f42d96f8160ece9daadaad207e9f0f97194252a71fece6e80df9816f8d4837b2dd1353156f8b607aec2cf9
7
+ data.tar.gz: f915b96269c8f87357ee9ae76b45d43700a6bda2ad95206e7306afaae56391d1aa840151d450cdd6b5c29f48c4a4e982912fcb70524b21b14c25f79b09b7ea7d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## HCloud v2.0.0 (2024-01-10)
4
+
5
+ - Remove `deprecated` attribute from `ISO`
6
+
7
+ ## HCloud v1.7.2 (2023-10-16)
8
+
9
+ - Add `deprecation` attribute to `ISO`
10
+
3
11
  ## HCloud v1.7.1 (2023-07-25)
4
12
 
5
13
  - Add deprecation warning for `HCloud::Action.all`
data/Gemfile CHANGED
@@ -14,6 +14,7 @@ group :development, :test do
14
14
  gem "rubocop", require: false
15
15
  gem "rubocop-performance", require: false
16
16
  gem "rubocop-rspec", require: false
17
+ gem "simplecov", require: false
17
18
  gem "timecop", require: false
18
19
  gem "webmock", require: false
19
20
  end
@@ -55,7 +55,7 @@ module HCloud
55
55
 
56
56
  def count
57
57
  # Fetch total_entries if not present
58
- @count ||= (total_entries || proc.call(params.merge(page: 1)).last.dig(:pagination, :total_entries))
58
+ @count ||= total_entries || proc.call(params.merge(page: 1)).last.dig(:pagination, :total_entries)
59
59
  end
60
60
 
61
61
  def empty?
@@ -33,7 +33,7 @@ module HCloud
33
33
  attributes
34
34
  .slice(*simple_attributes.map(&:to_s))
35
35
  .transform_values { |v| v&.send_wrap { |o| o.try(:to_h) || o } || v&.send_wrap(:to_s) }
36
- .merge(nested_attributes.reduce(&:merge)&.map { |k, v| [k.to_s, Array(v).filter_map { |w| send(k)&.send_wrap(w) }.first] }.to_h)
36
+ .merge(nested_attributes.reduce(&:merge).to_h { |k, v| [k.to_s, Array(v).filter_map { |w| send(k)&.send_wrap(w) }.first] })
37
37
  .compact_blank
38
38
  end
39
39
  # rubocop:enable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
data/lib/hcloud/errors.rb CHANGED
@@ -8,7 +8,7 @@ module HCloud
8
8
  def initialize(data = {})
9
9
  @data = data
10
10
 
11
- super [data[:message], full_messages&.join("\n")].compact.join("\n\n")
11
+ super([data[:message], full_messages&.join("\n")].compact.join("\n\n"))
12
12
  end
13
13
 
14
14
  def full_messages
@@ -9,6 +9,14 @@ module HCloud
9
9
  # HCloud::Datacenter.all
10
10
  # # => [#<HCloud::Datacenter id: 2, ...>, ...]
11
11
  #
12
+ # == Sort datacenters
13
+ #
14
+ # HCloud::Datacenter.sort(name: :desc)
15
+ # # => [#<HCloud::Datacenter id: 1, ...>, ...]
16
+ #
17
+ # HCloud::Datacenter.sort(:id, name: :asc)
18
+ # # => [#<HCloud::Datacenter id: 1, ...>, ...]
19
+ #
12
20
  # == Search datacenters
13
21
  #
14
22
  # HCloud::Datacenter.where(name: "fsn1-dc8")
@@ -28,10 +28,11 @@ module HCloud
28
28
 
29
29
  attribute :architecture
30
30
  attribute :type
31
- attribute :deprecated, :datetime
31
+
32
+ attribute :deprecation, :deprecation
32
33
 
33
34
  def deprecated?
34
- deprecated.present?
35
+ deprecation.present?
35
36
  end
36
37
  end
37
38
  end
@@ -9,6 +9,14 @@ module HCloud
9
9
  # HCloud::Location.all
10
10
  # # => [#<HCloud::Location id: 1, ...>, ...]
11
11
  #
12
+ # == Sort locations
13
+ #
14
+ # HCloud::Location.sort(name: :desc)
15
+ # # => [#<HCloud::Location id: 1, ...>, ...]
16
+ #
17
+ # HCloud::Location.sort(:id, name: :asc)
18
+ # # => [#<HCloud::Location id: 1, ...>, ...]
19
+ #
12
20
  # == Search locations
13
21
  #
14
22
  # HCloud::Location.where(name: "fsn1")
@@ -40,6 +40,12 @@ module HCloud
40
40
  attribute :deprecated, :boolean
41
41
  attribute :deprecation, :deprecation
42
42
 
43
+ def deprecated
44
+ warn "[DEPRECATION] Field \"deprecated\" on server types is deprecated."
45
+
46
+ super
47
+ end
48
+
43
49
  alias deprecated? deprecated
44
50
  end
45
51
  end
@@ -2,9 +2,9 @@
2
2
 
3
3
  module HCloud
4
4
  module Version
5
- MAJOR = 1
6
- MINOR = 7
7
- PATCH = 1
5
+ MAJOR = 2
6
+ MINOR = 0
7
+ PATCH = 0
8
8
  PRE = nil
9
9
 
10
10
  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: 1.7.1
4
+ version: 2.0.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: 2023-07-25 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -179,7 +179,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
179
  requirements:
180
180
  - - ">="
181
181
  - !ruby/object:Gem::Version
182
- version: '2.7'
182
+ version: '3.0'
183
183
  required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ">="