unitsdb 2.2.14 → 2.2.15

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: dc8319a7f7071aa32927e33ac9bbc733d4a72b57e59b2d34e0eac4deaa248374
4
- data.tar.gz: e8796f58446055853641ed48b944ff419a36082393ee995ceee4f1b42be1dd5a
3
+ metadata.gz: 55e391b1db0e3521dcf36db024b126f85b3c6bcc02119aa48ef8ce5bbfb48870
4
+ data.tar.gz: 3d4d7e953cc747bf13221262560e4b154a93b4e316ee6ee8a81c57217f6040da
5
5
  SHA512:
6
- metadata.gz: 1411431ed28960026d29ec9bb64b301d34d096419416cb56e2347e847ebe8c55204d89f452a4130f08dc25d46a4ce83e2f11bdc28fc0e774d9631aa300ce595d
7
- data.tar.gz: 26163de5af38f2696c03fa32db11d36bc7b7c063767d6b7cc9c9de546fd31885a337b42f25a5c7c7b8caa5dfe8be0faee723243b06385da5587a32c110c79ec0
6
+ metadata.gz: 1a3600232a5b3dc822ab6a58f1a9670ff126237c282220ac3d521c1e5a711fcf4e3754bcc3db7aed4324438e8a85c6daeca769a108eff5b75ce897d74a300e24
7
+ data.tar.gz: 213c67af95062fa9cbef20d6663b26a55b3f072e803b3d0d3b15d30c9857d5dc2c68cbcd980edbdd238a5cb0317862e237f02e4ace7559678f0e88ad1684d02c
data/data/units.yaml CHANGED
@@ -6692,9 +6692,12 @@ units:
6692
6692
  root: false
6693
6693
  root_units:
6694
6694
  - power: 1
6695
+ prefix_reference:
6696
+ type: nist
6697
+ id: NISTp10_2
6695
6698
  unit_reference:
6696
6699
  type: nist
6697
- id: NISTu203
6700
+ id: NISTu201
6698
6701
  short: hundredweight
6699
6702
  symbols:
6700
6703
  - latex: "\\ensuremath{\\mathrm{cwt (US)}}"
@@ -14494,6 +14497,9 @@ units:
14494
14497
  root: false
14495
14498
  root_units:
14496
14499
  - power: 1
14500
+ prefix_reference:
14501
+ type: nist
14502
+ id: NISTp10_3
14497
14503
  unit_reference:
14498
14504
  type: nist
14499
14505
  id: NISTu196
@@ -23,6 +23,7 @@ module Unitsdb
23
23
  # participates in all validation like a required file.
24
24
  OPTIONAL_DATABASE_FILES = {
25
25
  "currencies" => "currencies.yaml",
26
+ "scales" => "scales.yaml",
26
27
  }.freeze
27
28
 
28
29
  DATABASE_FILES = REQUIRED_DATABASE_FILES.merge(OPTIONAL_DATABASE_FILES).freeze
@@ -21,6 +21,7 @@ module Unitsdb
21
21
  attribute :dimensions, Dimension, collection: true
22
22
  attribute :unit_systems, UnitSystem, collection: true
23
23
  attribute :currencies, Currency, collection: true
24
+ attribute :scales, Scale, collection: true
24
25
 
25
26
  # Resolve a collection name (String or Symbol) to its typed Array.
26
27
  # Validates against COLLECTIONS so caller-supplied names can never
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Unitsdb
4
- VERSION = "2.2.14"
4
+ VERSION = "2.2.15"
5
5
 
6
6
  # The version of the bundled UnitsDB data (from the data/ submodule).
7
7
  # This version corresponds to a tag/commit in https://github.com/unitsml/unitsdb.
8
- UNITS_DATA_VERSION = "2.2.1"
8
+ UNITS_DATA_VERSION = "2.2.2"
9
9
  end
data/unitsdb.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
25
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
26
  `git ls-files -z`.split("\x0").reject do |f|
27
- f.match(%r{^(test|spec|features)/})
27
+ f.match(%r{^(?:(?:test|spec|features)/|(?:AGENTS|CLAUDE)\.md$)})
28
28
  end
29
29
  end
30
30
  # Include YAML data files in the gem
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unitsdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.14
4
+ version: 2.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-11 00:00:00.000000000 Z
11
+ date: 2026-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fuzzy_match
@@ -141,7 +141,6 @@ files:
141
141
  - ".rspec"
142
142
  - ".rubocop.yml"
143
143
  - ".rubocop_todo.yml"
144
- - CLAUDE.md
145
144
  - CODE_OF_CONDUCT.md
146
145
  - Gemfile
147
146
  - LICENSE.txt
data/CLAUDE.md DELETED
@@ -1,55 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Development Commands
6
-
7
- ```bash
8
- bundle install # Install dependencies
9
- bundle exec rake # Run full default task (rspec + rubocop)
10
- bundle exec rspec # Run all tests
11
- bundle exec rspec spec/path/to/file_spec.rb # Run single spec
12
- bundle exec rubocop # Lint all files
13
- bundle exec rake build # Build the gem
14
- ```
15
-
16
- ## Architecture
17
-
18
- ### Bundled Data
19
-
20
- The gem ships UnitsDB YAML data files in `data/` (a git submodule at https://github.com/unitsml/unitsdb). These are included in the published gem via `spec.files += Dir.glob("data/**/*.yaml")` in the gemspec.
21
-
22
- Two entry points for the bundled data:
23
- - `Unitsdb.data_dir` — path to the `data/` directory inside the gem
24
- - `Unitsdb.database` — pre-loaded `Database.from_db(data_dir)` instance (cached)
25
-
26
- The correspondence between gem version and data version is tracked via
27
- `Unitsdb::UNITS_DATA_VERSION` (e.g. `"2.0.0"`). **The UnitsDB data must be
28
- released (tagged) before the gem can be released with updated data.** When
29
- releasing with new data: tag the data in `unitsml/unitsdb`, then update
30
- `.gitmodules` (`branch = refs/tags/new-data-tag`) and bump both `VERSION` and
31
- `UNITS_DATA_VERSION` in `lib/unitsdb/version.rb`.
32
-
33
- ### Core Classes
34
-
35
- - **`Unitsdb::Database`** — Loads all YAML files, provides `search`, `get_by_id`, `find_by_type`, `find_by_symbol`, `match_entities`, `validate_uniqueness`, `validate_references`
36
- - **`Unitsdb::Cli`** (Thor-based) — Command-line interface with subcommands: `validate`, `search`, `get`, `check_si`, `ucum`, `qudt`, `_modify`, `release`
37
- - **`lib/unitsdb/commands/base.rb`** — Base class for commands; provides `load_database` and `@options[:database]`
38
-
39
- ### Model Pattern
40
-
41
- Entity types (Unit, Prefix, Dimension, Quantity, UnitSystem, etc.) are Lutaml::Model-serializable classes. They are loaded from YAML via `Database.from_db`, which validates `schema_version: "2.0.0"` across all files and merges them into a single object.
42
-
43
- ### Workflow Files
44
-
45
- Workflows in `.github/workflows/` are auto-generated by **Cimas** (metanorma/cimas) and delegate to shared reusable workflows in `metanorma/ci`:
46
- - `rake.yml` → `generic-rake.yml@main` — runs tests/lint on push/PR
47
- - `release.yml` → `rubygems-release.yml@main` — builds and publishes gem
48
- - `dependent-gems.yml` → `dependent-rake.yml@main` — tests downstream consumers
49
-
50
- ### Git Submodule
51
-
52
- `data/` is a git submodule pinned to a specific tag in https://github.com/unitsml/unitsdb
53
- (e.g. `branch = refs/tags/v2.0.0` in `.gitmodules`). The CI `rake.yml` uses
54
- `submodules: 'recursive'` so tests have the data available. The release workflow
55
- uses `submodules: true` to initialize the submodule during checkout.