nuva 0.1.8 → 0.2.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: 91add977fc84455f8034b67572e407e66fc72883f2bb4222a1110d075f8f5fa6
4
- data.tar.gz: 613fcbda7fe1c0700c966f86d76795629325919ff47e36b14a3ff5c40e74ff35
3
+ metadata.gz: 391786d07b2a721da8b3c80f24937cd69c62221c0e67f0eaa2803ecbb243fe54
4
+ data.tar.gz: 5e31145383cf0e4c70686d2f65121401f49465a4c72ca18f6cb2291085fdbd0e
5
5
  SHA512:
6
- metadata.gz: d1ad7b17c479dd8721b145407b2680389179d397873560b511f9014ea9a113beef0896ffc84865e5ced911f1b91afa06b0defa7f5d971b8e2ea6594e941c1882
7
- data.tar.gz: a657ba25891700583e6c219bef5677977c42a860f1d6e64c6b96bc08ce6aae8b0e6f517733d4f9a64503489d20424f08bfabb9b5cad9bce4c611e939e9eded51
6
+ metadata.gz: f387e49eb07942ba3192aa92a34632662bc9fcf6ffaae18c5ea85225ea8a7c897f345fb3112c5c0c4795f4a8be540a4d7e49a7490abffd4ba19ce6ed09f5e860
7
+ data.tar.gz: 26e0ba31d8834da784eae5da7915360caf1bc26f134c19875ddaef477fb7131b12e53b9547e8bb4daca21ca330d7ba315c833b1c26e08695ebe6ba76b24670c9
@@ -0,0 +1,25 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3
+ {
4
+ "name": "nuva-ruby",
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image": "mcr.microsoft.com/devcontainers/ruby:1-3.3-bullseye",
7
+ "features": {
8
+ "ghcr.io/devcontainers/features/common-utils:2": {}
9
+ }
10
+
11
+ // Features to add to the dev container. More info: https://containers.dev/features.
12
+ // "features": {},
13
+
14
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
15
+ // "forwardPorts": [],
16
+
17
+ // Use 'postCreateCommand' to run commands after the container is created.
18
+ // "postCreateCommand": "ruby --version",
19
+
20
+ // Configure tool-specific properties.
21
+ // "customizations": {},
22
+
23
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
24
+ // "remoteUser": "root"
25
+ }
data/Changelog.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.0] - 2025-01-17
9
+
10
+ ### Added
11
+
12
+ - Support finding entities (vaccines, diseases, valences) by numeric code (not just uuid)
13
+ - Add changelog file
@@ -6,10 +6,11 @@ module Nuva
6
6
 
7
7
  def initialize(data)
8
8
  @data = index_array_by_id(data)
9
+ @data_by_code = data.each_with_object({}) { |item, acc| acc[item.code] = item }
9
10
  end
10
11
 
11
- def find(id)
12
- @data[id]
12
+ def find(id_or_code)
13
+ @data_by_code[id_or_code] || @data[id_or_code]
13
14
  end
14
15
 
15
16
  def all
@@ -20,10 +21,6 @@ module Nuva
20
21
  ids.map { |x| find x }.compact
21
22
  end
22
23
 
23
- # def by_ids(ids)
24
- # @data.select { |k, _v| ids.include?(k) }.values
25
- # end
26
-
27
24
  private
28
25
 
29
26
  def index_array_by_id(array)
data/lib/nuva/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nuva
4
- VERSION = '0.1.8'
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nuva
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Syadem
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-23 00:00:00.000000000 Z
11
+ date: 2025-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -52,8 +52,10 @@ executables: []
52
52
  extensions: []
53
53
  extra_rdoc_files: []
54
54
  files:
55
+ - ".devcontainer/devcontainer.json"
55
56
  - ".rspec"
56
57
  - ".rubocop.yml"
58
+ - Changelog.md
57
59
  - Rakefile
58
60
  - gen_proto.sh
59
61
  - lib/nuva.rb