debian_codename 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/debian_codename.rb +11 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e20e9d4a61f0222b1c3a4550a5fc8f50af1ac73b446a2b0e20ffa96ab2377e00
4
- data.tar.gz: dac229d1fccf6e6f63b11ea0fba3a2ada0d6eb1c3b41d90e5e24fa4fd1d00641
3
+ metadata.gz: c363a439873bce2913c1a7612cd3163044671a5b511f05000d899a54049babc4
4
+ data.tar.gz: 9cff5cd8b29cc2065001ee8bbfbd1fc7aff2d751c75470cc67f6f8792912051e
5
5
  SHA512:
6
- metadata.gz: 0df33843a57febb6de376e308c068a8c54c5c6d27917b30f809d062fb6cee25944884037696b88acf6833af72f3f7afafd15ec42fdba2c1a927c0c7186232389
7
- data.tar.gz: 1fa53b11dcf85c2c7fdc19b5caaf24e601403964db8b48db6831e8063e4e1b9ef5d0374fc5edfe954736b8b677a737562ae85286e796014e79e301f82d2f46b8
6
+ metadata.gz: 6c9bfc361fddd81f609896772407e780a6374bd0587c9f6bfdda4002a0e19f0523983514eac16b176fd3039772681482ceff4d115e0ac4f21bb320dd863e7a44
7
+ data.tar.gz: 13d9c211b2bc1e0d7bae669f3f4de4801e58a5b8bdbff328f0d2578b881e5e99cf9e4417c4f3cf78406fbe1cb1c53da29f9613271877e51a1029ac1e949bc8c4
@@ -7,6 +7,7 @@ module DebianCodename
7
7
 
8
8
  # https://wiki.debian.org/DebianReleases#Production_Releases
9
9
  DEBIAN_CODENAMES = {
10
+ '@distribution' => 'debian',
10
11
  '14' => %w[forky],
11
12
  '13' => %w[trixie],
12
13
  '12' => %w[bookworm],
@@ -33,6 +34,7 @@ module DebianCodename
33
34
  # Codename nouns ignored here at the moment but kept for consistency and possible future
34
35
  # improvements
35
36
  UBUNTU_CODENAMES = {
37
+ '@distribution' => 'ubuntu',
36
38
  '23.04' => %w[lunar lobster],
37
39
  '22.10' => %w[kinetic kudu],
38
40
  '22.04' => %w[jammy jellyfish],
@@ -87,7 +89,7 @@ module DebianCodename
87
89
  raise DebianCodenameError, "No match for #{user_search_string}"
88
90
  end
89
91
 
90
- # Return a canonical form (Hash with ':version' and ':codename' keys)
92
+ # Return a canonical form (Hash with ':version', ':codename', and ':distribution' keys)
91
93
  def find(user_search_string)
92
94
  search_string = user_search_string.downcase
93
95
 
@@ -95,7 +97,8 @@ module DebianCodename
95
97
  if code_catalog.key?(search_string)
96
98
  return {
97
99
  version: search_string,
98
- codename: codename(code_catalog, search_string)
100
+ codename: codename(code_catalog, search_string),
101
+ distribution: distribution(code_catalog)
99
102
  }
100
103
  end
101
104
 
@@ -103,7 +106,8 @@ module DebianCodename
103
106
  unless version_found.nil?
104
107
  return {
105
108
  version: version_found.first,
106
- codename: search_string
109
+ codename: search_string,
110
+ distribution: distribution(code_catalog)
107
111
  }
108
112
  end
109
113
  end
@@ -114,4 +118,8 @@ module DebianCodename
114
118
  def codename(code_catalog, version_string)
115
119
  code_catalog[version_string][0]
116
120
  end
121
+
122
+ def distribution(code_catalog)
123
+ code_catalog['@distribution']
124
+ end
117
125
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debian_codename
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Release Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-24 00:00:00.000000000 Z
11
+ date: 2023-06-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Convert Debian/Ubuntu codenames to version numbers and vice-versa
14
14
  email: