cloud-instancetype 0.0.3 → 1.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: 81c783ece53d23f3c54b8614a4047b0db47aca667b970aea3af18e1041f93d5a
4
- data.tar.gz: 3a04df93d869a656d0cfd9fda1a27c4d4fab3b969564b9339348ba6f73da48b0
3
+ metadata.gz: 8e816cc2954520421bf0199595ab06035f262da484fcd046950269cb2b61fc1d
4
+ data.tar.gz: c01ee4b3979df11673abb3ecc10d8e17e25ed0e79b028c06e6676439610c86aa
5
5
  SHA512:
6
- metadata.gz: e6f6ff0e2130290469860f6606efc7bf7d1a473cbb14a04870646fab79be5dff0671a0bf18af9ed7bfb79978985b6249c4a430d8cd531ad3293ec209c1006f3e
7
- data.tar.gz: d4e9bbdd652ac8358fde25c527d009182384e35cd337b6044c29e4311dd5d40fb59757ffc19ec1373db4b1256a18cb000d6f388004442b52bab581fb42b8e691
6
+ metadata.gz: 5f960ac3b96dcf14606bf4784c09151003d9bff80d968cdd5aa9254ac9a9ab009fc735cb535eba3c7088967b941304ce441018c032152584e19067300c5e0bb4
7
+ data.tar.gz: 1eb60f2260787b5ab9d19859ac4b21dab107c0cf2663bcf6ca964f56f2576a95f9957f774944b39515ac13e982d9bf5d81d839b4c90f4d8ca789b41dfb0070ac
data/README.md CHANGED
@@ -60,6 +60,8 @@ Either way, the return is a collection of `InstanceType`, so iterate along your
60
60
  ```
61
61
  instance_types.each do |instance_type|
62
62
  puts instance_type.key
63
+ puts instance_type.name
64
+ puts instance_type.vcpu_count
63
65
  puts instance_type.category.features
64
66
  end
65
67
  ```
@@ -4,17 +4,23 @@ require "json"
4
4
  module Cloud
5
5
  # Describe a public cloud instance type
6
6
  class InstanceType
7
- attr_reader :sort_value, :key, :category, :vcpu_count, :ram_bytes,
7
+ attr_reader :name, :sort_value, :key, :category, :vcpu_count, :ram_bytes,
8
8
  :ram_si_units, :details
9
9
 
10
10
  def initialize(key, raw_data)
11
11
  @key = key
12
+ @name = raw_data["name"]
12
13
  @sort_value = raw_data["sort_value"]
13
- @category = Cloud::InstanceCategory.new(raw_data["category"])
14
14
  @vcpu_count = raw_data["vcpu_count"]
15
15
  @ram_bytes = raw_data["ram_bytes"]
16
16
  @ram_si_units = raw_data["ram_si_units"]
17
17
  @details = raw_data["details"]
18
+ return unless raw_data["category_key"]
19
+
20
+ @category = Cloud::InstanceCategory.new(
21
+ raw_data["category_key"],
22
+ raw_data["category"]
23
+ )
18
24
  end
19
25
 
20
26
  def <=>(other)
@@ -46,6 +52,7 @@ module Cloud
46
52
 
47
53
  def instance_type_collection_factory(raw_types, raw_categories)
48
54
  raw_types.collect do |key, values|
55
+ values["category_key"] = values["category"]
49
56
  values["category"] = raw_categories[values["category"]]
50
57
  InstanceType.new(key, values)
51
58
  end.sort!
@@ -55,10 +62,11 @@ module Cloud
55
62
 
56
63
  # Describe a public cloud category
57
64
  class InstanceCategory
58
- attr_reader :name, :description, :features
65
+ attr_reader :key, :name, :description, :features
59
66
 
60
- def initialize(args)
61
- @name = args["key"]
67
+ def initialize(key, args)
68
+ @key = key
69
+ @name = args["name"]
62
70
  @description = args["description"]
63
71
  @features = args["features"]
64
72
  end
@@ -1,5 +1,5 @@
1
1
  module Cloud
2
2
  class InstanceType
3
- VERSION = "0.0.3"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # spec file for package blue-horizon
2
+ # spec file for package rubygem-cloud-instancetype
3
3
  # this code base is under development
4
4
  #
5
5
  # Copyright (c) 2020 SUSE LLC
@@ -17,7 +17,7 @@
17
17
  #
18
18
 
19
19
  Name: rubygem-cloud-instancetype
20
- Version: 0.0.2
20
+ Version: 1.0.0
21
21
  Release: 0
22
22
  %define mod_name cloud-instancetype
23
23
  %define mod_full_name %{mod_name}-%{version}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud-instancetype
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Mason
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-27 00:00:00.000000000 Z
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.0.6
106
+ rubygems_version: 3.0.8
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Describe public cloud instance types