uddf 0.1.0 → 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 +4 -4
- data/.github/workflows/main.yml +9 -9
- data/.rubocop.yml +15 -0
- data/.ruby-version +1 -0
- data/Gemfile +0 -5
- data/Gemfile.lock +85 -0
- data/README.md +55 -18
- data/dive_files/BaMQZdEhp3djeDxQ5HyCreOntBm1-1753908953.uddf +6060 -0
- data/dive_files/Peregrine TX[93CBB2BB]#140_2025-03-21.uddf +4735 -0
- data/dive_files/Peregrine TX[93CBB2BB]#148_2025-06-26.uddf +2414 -0
- data/lib/uddf/base/models.rb +39 -0
- data/lib/uddf/v300/schema.xsd +1645 -0
- data/lib/uddf/v301/schema.xsd +1645 -0
- data/lib/uddf/v310/schema.xsd +1798 -0
- data/lib/uddf/v320/schema.xsd +1834 -0
- data/lib/uddf/v321/schema.xsd +1834 -0
- data/lib/uddf/v322/schema.xsd +1883 -0
- data/lib/uddf/v323/models.rb +1629 -0
- data/lib/uddf/v323/schema.xsd +1890 -0
- data/lib/uddf/v330/schema.xsd +2126 -0
- data/lib/uddf/v331/schema.xsd +2155 -0
- data/lib/uddf/version.rb +2 -2
- data/lib/uddf.rb +67 -4
- data/test_files/v330/diver_data.uddf +311 -0
- data/uddf.gemspec +8 -5
- metadata +106 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2940685ef35816892c65ed029b230a73674018fa36801b53b4923d36da744c61
|
4
|
+
data.tar.gz: b750a7bd240203df8aa939d73405c6fa003cc4f857612074edf0b6e84d5b1e63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9afdce2237a0fb1c4ac923b6ef881a936f7d352f2f18f8d603b32b76a112fadfcf0a7ba8ce33023ea1d4144bc78446fdee4e1ba4a02fa9b3c39bb9bbe20138e
|
7
|
+
data.tar.gz: cfc3637fdb8cb46dba294f36328c3952494ddf26c21558ada177accc57239f5b630424c4e1d6352bb3b91f086e468de11f26d9990f6bdf41763b647101d7b001
|
data/.github/workflows/main.yml
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
name: Ruby
|
2
2
|
|
3
|
-
on: [push,pull_request]
|
3
|
+
on: [push, pull_request]
|
4
4
|
|
5
5
|
jobs:
|
6
6
|
build:
|
7
7
|
runs-on: ubuntu-latest
|
8
8
|
steps:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
- uses: actions/checkout@v5
|
10
|
+
- name: Set up Ruby
|
11
|
+
uses: ruby/setup-ruby@v1
|
12
|
+
with:
|
13
|
+
ruby-version: 3.4
|
14
|
+
bundler-cache: true
|
15
|
+
- name: Run the default task
|
16
|
+
run: bundle exec rake
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
+
plugins: rubocop-rake
|
2
|
+
|
1
3
|
AllCops:
|
4
|
+
NewCops: enable
|
2
5
|
TargetRubyVersion: 2.4
|
3
6
|
|
7
|
+
Gemspec/DevelopmentDependencies:
|
8
|
+
EnforcedStyle: gemspec
|
9
|
+
|
4
10
|
Style/StringLiterals:
|
5
11
|
Enabled: true
|
6
12
|
EnforcedStyle: double_quotes
|
@@ -11,3 +17,12 @@ Style/StringLiteralsInInterpolation:
|
|
11
17
|
|
12
18
|
Layout/LineLength:
|
13
19
|
Max: 120
|
20
|
+
|
21
|
+
Metrics/ModuleLength:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
Style/Documentation:
|
25
|
+
Exclude:
|
26
|
+
- "spec/**/*"
|
27
|
+
- "test/**/*"
|
28
|
+
- "lib/uddf/v323/models.rb"
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.4.4
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
uddf (0.2.0)
|
5
|
+
nokogiri (~> 1.18)
|
6
|
+
nokogiri-happymapper
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ast (2.4.3)
|
12
|
+
cgi (0.5.0)
|
13
|
+
date (3.4.1)
|
14
|
+
erb (4.0.4)
|
15
|
+
cgi (>= 0.3.3)
|
16
|
+
io-console (0.8.1)
|
17
|
+
irb (1.15.2)
|
18
|
+
pp (>= 0.6.0)
|
19
|
+
rdoc (>= 4.0.0)
|
20
|
+
reline (>= 0.4.2)
|
21
|
+
json (2.13.2)
|
22
|
+
language_server-protocol (3.17.0.5)
|
23
|
+
lint_roller (1.1.0)
|
24
|
+
nokogiri (1.18.9-arm64-darwin)
|
25
|
+
racc (~> 1.4)
|
26
|
+
nokogiri (1.18.9-x86_64-linux-gnu)
|
27
|
+
racc (~> 1.4)
|
28
|
+
nokogiri-happymapper (0.10.0)
|
29
|
+
nokogiri (~> 1.5)
|
30
|
+
parallel (1.27.0)
|
31
|
+
parser (3.3.9.0)
|
32
|
+
ast (~> 2.4.1)
|
33
|
+
racc
|
34
|
+
pp (0.6.2)
|
35
|
+
prettyprint
|
36
|
+
prettyprint (0.2.0)
|
37
|
+
prism (1.4.0)
|
38
|
+
psych (5.2.6)
|
39
|
+
date
|
40
|
+
stringio
|
41
|
+
racc (1.8.1)
|
42
|
+
rainbow (3.1.1)
|
43
|
+
rake (13.3.0)
|
44
|
+
rdoc (6.14.2)
|
45
|
+
erb
|
46
|
+
psych (>= 4.0.0)
|
47
|
+
regexp_parser (2.11.2)
|
48
|
+
reline (0.6.2)
|
49
|
+
io-console (~> 0.5)
|
50
|
+
rubocop (1.80.0)
|
51
|
+
json (~> 2.3)
|
52
|
+
language_server-protocol (~> 3.17.0.2)
|
53
|
+
lint_roller (~> 1.1.0)
|
54
|
+
parallel (~> 1.10)
|
55
|
+
parser (>= 3.3.0.2)
|
56
|
+
rainbow (>= 2.2.2, < 4.0)
|
57
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
58
|
+
rubocop-ast (>= 1.46.0, < 2.0)
|
59
|
+
ruby-progressbar (~> 1.7)
|
60
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
61
|
+
rubocop-ast (1.46.0)
|
62
|
+
parser (>= 3.3.7.2)
|
63
|
+
prism (~> 1.4)
|
64
|
+
rubocop-rake (0.7.1)
|
65
|
+
lint_roller (~> 1.1)
|
66
|
+
rubocop (>= 1.72.1)
|
67
|
+
ruby-progressbar (1.13.0)
|
68
|
+
stringio (3.1.7)
|
69
|
+
unicode-display_width (3.1.5)
|
70
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
71
|
+
unicode-emoji (4.0.4)
|
72
|
+
|
73
|
+
PLATFORMS
|
74
|
+
arm64-darwin-24
|
75
|
+
x86_64-linux
|
76
|
+
|
77
|
+
DEPENDENCIES
|
78
|
+
irb
|
79
|
+
rake (~> 13.0)
|
80
|
+
rubocop (~> 1.7)
|
81
|
+
rubocop-rake (~> 0.7)
|
82
|
+
uddf!
|
83
|
+
|
84
|
+
BUNDLED WITH
|
85
|
+
2.7.1
|
data/README.md
CHANGED
@@ -1,35 +1,72 @@
|
|
1
|
-
|
1
|
+
[](https://badge.fury.io/rb/uddf)
|
2
2
|
|
3
|
-
|
3
|
+
# UDDF
|
4
4
|
|
5
|
-
|
5
|
+
Ruby parser and validator for Universal Dive Data Format (UDDF) files. Supports multiple UDDF versions with version-specific model loading.
|
6
6
|
|
7
|
-
##
|
7
|
+
## Features
|
8
|
+
|
9
|
+
- Parse UDDF XML files into Ruby objects using HappyMapper
|
10
|
+
- Automatic version detection from UDDF files
|
11
|
+
- Version-specific model loading
|
12
|
+
- XML schema validation
|
13
|
+
- Extensible architecture for multiple UDDF versions
|
14
|
+
|
15
|
+
### Supported Versions
|
16
|
+
|
17
|
+
| UDDF Version | Parser | Validator |
|
18
|
+
|--------------|--------|-----------|
|
19
|
+
| 3.0.0 | ✗ | ✓ |
|
20
|
+
| 3.0.1 | ✗ | ✓ |
|
21
|
+
| 3.1.0 | ✗ | ✓ |
|
22
|
+
| 3.2.0 | ✗ | ✓ |
|
23
|
+
| 3.2.1 | ✗ | ✓ |
|
24
|
+
| 3.2.2 | ✗ | ✓ |
|
25
|
+
| 3.2.3 | ✓ | ✓ |
|
26
|
+
| 3.3.0 | ✗ | ✓ |
|
27
|
+
| 3.3.1 | ✗ | ✓ |
|
8
28
|
|
9
|
-
|
29
|
+
> **Note**: The UDDF 3.3.0 and 3.3.1 schema files included in this gem have been locally modified to fix XML Schema validation errors that prevented them from loading with Nokogiri. These fixes address syntax issues in the original schemas but may not represent the upstream maintainers' intentions. The modifications ensure compatibility with standard XML Schema validators while preserving the core schema structure and validation rules.
|
30
|
+
|
31
|
+
## Usage
|
10
32
|
|
11
33
|
```ruby
|
12
|
-
|
13
|
-
```
|
34
|
+
require 'uddf'
|
14
35
|
|
15
|
-
|
36
|
+
# Load and parse a UDDF file (auto-detects version)
|
37
|
+
dive_data = UDDF.load('path/to/dive.uddf')
|
16
38
|
|
17
|
-
|
39
|
+
# Parse UDDF XML string directly
|
40
|
+
dive_data = UDDF.parse(xml_string)
|
18
41
|
|
19
|
-
|
42
|
+
# Force a specific version (bypasses auto-detection)
|
43
|
+
dive_data = UDDF.load('path/to/dive.uddf', force_version: '3.2.3')
|
44
|
+
dive_data = UDDF.parse(xml_string, force_version: '3.2.3')
|
20
45
|
|
21
|
-
|
46
|
+
# Validate UDDF XML against schema
|
47
|
+
errors = UDDF.validate(xml_string)
|
48
|
+
errors = UDDF.validate(xml_string, force_version: '3.2.3')
|
22
49
|
|
23
|
-
|
50
|
+
# Access parsed data
|
51
|
+
puts dive_data.generator.name
|
52
|
+
dive_data.profile_data.repetition_groups.each do |group|
|
53
|
+
group.dives.each do |dive|
|
54
|
+
puts "Depth: #{dive.information_after_dive&.greatest_depth}m"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
```
|
24
58
|
|
25
|
-
|
59
|
+
## Installation
|
26
60
|
|
27
|
-
|
61
|
+
```ruby
|
62
|
+
gem 'uddf'
|
63
|
+
```
|
28
64
|
|
29
|
-
|
65
|
+
## Architecture
|
30
66
|
|
31
|
-
|
67
|
+
The gem uses a modular architecture with version-specific models:
|
32
68
|
|
33
|
-
|
69
|
+
- `UDDF::Models::Base` - Shared base models across versions
|
70
|
+
- `UDDF::Models::V323` - UDDF 3.2.3 specific models
|
71
|
+
- Automatic model loading based on file version attribute
|
34
72
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/uddf.
|