uddf 0.1.0 → 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: 1c183d9405ff7a1e3b9b30b07f1d212fee2e28c65f5142e5c9d9fccc68e76955
4
- data.tar.gz: bfc297bf0f18ae7b014570390ca6947bb5f3dd0a2e60f19753c518927934bb19
3
+ metadata.gz: '09cfbcdb61be33c2f4197bdc466092bdc4c074054964b3aa19ed5acbf1922872'
4
+ data.tar.gz: dbba5685e435e1a8b13944101b0ba73c1bfd34db6401b035290c0edefdc03231
5
5
  SHA512:
6
- metadata.gz: db3181cbe9e0e08a94648d614f953c5b444ad0f1da5c0705f532d642126077076fb2940e14944b9c82291dd35a9ad6fdf7cdf4ffbf788e2a4a4d2f5c90ef3c4f
7
- data.tar.gz: 89376df069f290d30e767437a7b176e7905d092f7d57a6a8f66451a27ffcae7962d112532f4085b06f3ef14377423df90cb9e47d399039cef07f88f1b4e22551
6
+ metadata.gz: 8fe628617c563846e599200c543c8bee52537e341587c4f283352af229f20c2557e7f31f48c139f00697c96e63cdc0581bd5b6a4db63e70474c58ed37e0163f0
7
+ data.tar.gz: 22b6415ea1545394a71225cde9b06aee15b579e218bbaccb5c245bcd6262912a49d5ccdabac639872aff152f639fe83728c694beb3f13e14e1c973a53df12b6b
@@ -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
- - uses: actions/checkout@v2
10
- - name: Set up Ruby
11
- uses: ruby/setup-ruby@v1
12
- with:
13
- ruby-version: 3.0.0
14
- bundler-cache: true
15
- - name: Run the default task
16
- run: bundle exec rake
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/Gemfile CHANGED
@@ -2,9 +2,4 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # Specify your gem's dependencies in uddf.gemspec
6
5
  gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rubocop", "~> 1.7"
data/Gemfile.lock ADDED
@@ -0,0 +1,84 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ uddf (0.1.0)
5
+ nokogiri-happymapper
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.3)
11
+ cgi (0.5.0)
12
+ date (3.4.1)
13
+ erb (4.0.4)
14
+ cgi (>= 0.3.3)
15
+ io-console (0.8.1)
16
+ irb (1.15.2)
17
+ pp (>= 0.6.0)
18
+ rdoc (>= 4.0.0)
19
+ reline (>= 0.4.2)
20
+ json (2.13.2)
21
+ language_server-protocol (3.17.0.5)
22
+ lint_roller (1.1.0)
23
+ nokogiri (1.17.2-arm64-darwin)
24
+ racc (~> 1.4)
25
+ nokogiri (1.17.2-x86_64-linux)
26
+ racc (~> 1.4)
27
+ nokogiri-happymapper (0.10.0)
28
+ nokogiri (~> 1.5)
29
+ parallel (1.27.0)
30
+ parser (3.3.9.0)
31
+ ast (~> 2.4.1)
32
+ racc
33
+ pp (0.6.2)
34
+ prettyprint
35
+ prettyprint (0.2.0)
36
+ prism (1.4.0)
37
+ psych (5.2.6)
38
+ date
39
+ stringio
40
+ racc (1.8.1)
41
+ rainbow (3.1.1)
42
+ rake (13.3.0)
43
+ rdoc (6.14.2)
44
+ erb
45
+ psych (>= 4.0.0)
46
+ regexp_parser (2.11.2)
47
+ reline (0.6.2)
48
+ io-console (~> 0.5)
49
+ rubocop (1.80.0)
50
+ json (~> 2.3)
51
+ language_server-protocol (~> 3.17.0.2)
52
+ lint_roller (~> 1.1.0)
53
+ parallel (~> 1.10)
54
+ parser (>= 3.3.0.2)
55
+ rainbow (>= 2.2.2, < 4.0)
56
+ regexp_parser (>= 2.9.3, < 3.0)
57
+ rubocop-ast (>= 1.46.0, < 2.0)
58
+ ruby-progressbar (~> 1.7)
59
+ unicode-display_width (>= 2.4.0, < 4.0)
60
+ rubocop-ast (1.46.0)
61
+ parser (>= 3.3.7.2)
62
+ prism (~> 1.4)
63
+ rubocop-rake (0.7.1)
64
+ lint_roller (~> 1.1)
65
+ rubocop (>= 1.72.1)
66
+ ruby-progressbar (1.13.0)
67
+ stringio (3.1.7)
68
+ unicode-display_width (3.1.5)
69
+ unicode-emoji (~> 4.0, >= 4.0.4)
70
+ unicode-emoji (4.0.4)
71
+
72
+ PLATFORMS
73
+ arm64-darwin-24
74
+ x86_64-linux
75
+
76
+ DEPENDENCIES
77
+ irb
78
+ rake (~> 13.0)
79
+ rubocop (~> 1.7)
80
+ rubocop-rake (~> 0.7)
81
+ uddf!
82
+
83
+ BUNDLED WITH
84
+ 2.5.23
data/README.md CHANGED
@@ -1,35 +1,68 @@
1
- # Uddf
1
+ # UDDF
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/uddf`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Ruby parser and validator for Universal Dive Data Format (UDDF) files. Supports multiple UDDF versions with version-specific model loading.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ ## Features
6
6
 
7
- ## Installation
7
+ - Parse UDDF XML files into Ruby objects using HappyMapper
8
+ - Automatic version detection from UDDF files
9
+ - Version-specific model loading
10
+ - XML schema validation
11
+ - Extensible architecture for multiple UDDF versions
12
+
13
+ ### Supported Versions
14
+
15
+ | UDDF Version | Parser | Validator |
16
+ |--------------|--------|-----------|
17
+ | 3.0.0 | ✗ | ✓ |
18
+ | 3.0.1 | ✗ | ✓ |
19
+ | 3.1.0 | ✗ | ✓ |
20
+ | 3.2.0 | ✗ | ✓ |
21
+ | 3.2.1 | ✗ | ✓ |
22
+ | 3.2.2 | ✗ | ✓ |
23
+ | 3.2.3 | ✓ | ✓ |
24
+ | 3.3.0 | ✗ | ✓ |
25
+ | 3.3.1 | ✗ | ✓ |
8
26
 
9
- Add this line to your application's Gemfile:
27
+ ## Usage
10
28
 
11
29
  ```ruby
12
- gem 'uddf'
13
- ```
30
+ require 'uddf'
14
31
 
15
- And then execute:
32
+ # Load and parse a UDDF file (auto-detects version)
33
+ dive_data = UDDF.load('path/to/dive.uddf')
16
34
 
17
- $ bundle install
35
+ # Parse UDDF XML string directly
36
+ dive_data = UDDF.parse(xml_string)
18
37
 
19
- Or install it yourself as:
38
+ # Force a specific version (bypasses auto-detection)
39
+ dive_data = UDDF.load('path/to/dive.uddf', force_version: '3.2.3')
40
+ dive_data = UDDF.parse(xml_string, force_version: '3.2.3')
20
41
 
21
- $ gem install uddf
42
+ # Validate UDDF XML against schema
43
+ errors = UDDF.validate(xml_string)
44
+ errors = UDDF.validate(xml_string, force_version: '3.2.3')
22
45
 
23
- ## Usage
46
+ # Access parsed data
47
+ puts dive_data.generator.name
48
+ dive_data.profile_data.repetition_groups.each do |group|
49
+ group.dives.each do |dive|
50
+ puts "Depth: #{dive.information_after_dive&.greatest_depth}m"
51
+ end
52
+ end
53
+ ```
24
54
 
25
- TODO: Write usage instructions here
55
+ ## Installation
26
56
 
27
- ## Development
57
+ ```ruby
58
+ gem 'uddf'
59
+ ```
28
60
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
61
+ ## Architecture
30
62
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
63
+ The gem uses a modular architecture with version-specific models:
32
64
 
33
- ## Contributing
65
+ - `UDDF::Models::Base` - Shared base models across versions
66
+ - `UDDF::Models::V323` - UDDF 3.2.3 specific models
67
+ - Automatic model loading based on file version attribute
34
68
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/uddf.