nuva 0.1.8 → 0.2.1

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: 8b154ba6248832c6f2eea8ed10db604eda6513ef8b814b73497e077dcaa52f77
4
+ data.tar.gz: d4a418365dd22e1c82a8fedcb703c01493f13f2751adbe554c7bffb9ef96fdfd
5
5
  SHA512:
6
- metadata.gz: d1ad7b17c479dd8721b145407b2680389179d397873560b511f9014ea9a113beef0896ffc84865e5ced911f1b91afa06b0defa7f5d971b8e2ea6594e941c1882
7
- data.tar.gz: a657ba25891700583e6c219bef5677977c42a860f1d6e64c6b96bc08ce6aae8b0e6f517733d4f9a64503489d20424f08bfabb9b5cad9bce4c611e939e9eded51
6
+ metadata.gz: 10d45ea6ef1e9cce71565fcafd02e2df3eb218b04b3f45af08d100eb3c44be48198cb31565851e8ae0affe395d913d2e6efc0c5f997cc2b79ba8952959a1e389
7
+ data.tar.gz: b6ab046950ae07facea0f22db916489c50d5032d7ee2bff460288806e52baeebde79972bb7a00ce917f8f4f4d0c10307639ba909f5ae42cd6931359440ad1ec7
@@ -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,19 @@
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.1] - 2025-01-17
9
+
10
+ ### Added
11
+
12
+ - Implement `inspect` method that does not print all data on repositories
13
+
14
+ ## [0.2.0] - 2025-01-17
15
+
16
+ ### Added
17
+
18
+ - Support finding entities (vaccines, diseases, valences) by numeric code (not just uuid)
19
+ - Add changelog file
@@ -6,10 +6,12 @@ module Nuva
6
6
 
7
7
  def initialize(data)
8
8
  @data = index_array_by_id(data)
9
+ @data_by_code =
10
+ data.each_with_object({}) { |item, acc| acc[item.code] = item }
9
11
  end
10
12
 
11
- def find(id)
12
- @data[id]
13
+ def find(id_or_code)
14
+ @data_by_code[id_or_code] || @data[id_or_code]
13
15
  end
14
16
 
15
17
  def all
@@ -20,9 +22,9 @@ module Nuva
20
22
  ids.map { |x| find x }.compact
21
23
  end
22
24
 
23
- # def by_ids(ids)
24
- # @data.select { |k, _v| ids.include?(k) }.values
25
- # end
25
+ def inspect
26
+ "#<#{self.class.name} count=#{data.count}>"
27
+ end
26
28
 
27
29
  private
28
30
 
@@ -32,6 +34,6 @@ module Nuva
32
34
  end
33
35
  end
34
36
 
35
- require_relative 'repositories/disease_repository'
36
- require_relative 'repositories/vaccine_repository'
37
- require_relative 'repositories/valence_repository'
37
+ require_relative "repositories/disease_repository"
38
+ require_relative "repositories/vaccine_repository"
39
+ require_relative "repositories/valence_repository"
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.1"
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.1
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