gpx_doctor 0.6.2 → 0.7.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: '08f52b7255e18952f838ad2b348a8df20059212c1ef8109d19d09d2ac7a9eb64'
4
- data.tar.gz: 9ad7a941a8e3fa217560e9bf2acc64984ffe33cdb4b639e1288a027a5d8f8714
3
+ metadata.gz: c13f7a8d06c283b5a8dba624cced9d7244d60f2720918b495f35cf96ce8ae1e3
4
+ data.tar.gz: 4237a5927878077f57a7912e8cd61ec7d2300e31551890e653840aca9197049c
5
5
  SHA512:
6
- metadata.gz: f0ba58080565539a3d32e89cfb17f26b8712205e3f62a47dbcb03a61bdac557b3e46b36b634249fc5dd24422f137a8afebddeaed127b908a5d94123ec8a58b17
7
- data.tar.gz: 523325873b587abd8a951d72d3ef9ec4ec26b5b996ddd2b86518e2c9a4e4fd50fdb7a1beed9d932f91390822ab56c670ef1f701a8f9de90fb98232c3226c9dcf
6
+ metadata.gz: 9841a014b0a980fd3c980ad92cb6ad04affb45eb711058bca7575967086bf2edeb311833ed5117233c379a80c5616ee0c15ec1cecf3eef15c8d40ed2c6450cc8
7
+ data.tar.gz: e022a619a37fb50308ed5414644c8c82cc4e70cacc6b30c06a588718e70c71d54f56e1f49b953fb2875a628399cc50dde6424037da8760f88066db3079f26566
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GPX Doctor
2
2
 
3
- A Ruby gem for parsing and manipulating GPX 1.1 routes.
3
+ A Ruby gem for parsing and manipulating GPX routes. The parser reads GPX 1.1 and GPX 1.0 (`http://www.topografix.com/GPX/1/0`, e.g. Traseo and older RideWithGPS exports); the builder always writes GPX 1.1.
4
4
 
5
5
  ## Installation
6
6
 
@@ -6,6 +6,11 @@ require 'time'
6
6
  module GpxDoctor
7
7
  class Parser
8
8
  GPX_NS = 'http://www.topografix.com/GPX/1/1'
9
+ GPX_10_NS = 'http://www.topografix.com/GPX/1/0'
10
+ # Validator accepts both versions, so the parser must read both. Element
11
+ # names used here (wpt, rte, trk, trkseg, trkpt, ele, time, name) are the
12
+ # same in 1.0 and 1.1 — only the namespace differs.
13
+ GPX_NAMESPACES = [GPX_NS, GPX_10_NS].freeze
9
14
 
10
15
  Result = Struct.new(:waypoints, :routes, :tracks, :metadata, :pois, keyword_init: true) do
11
16
  # The path described by the file, in order: <rtept> then <trkpt>.
@@ -48,7 +53,7 @@ module GpxDoctor
48
53
 
49
54
  def detect_namespace(doc)
50
55
  root_ns = doc.root&.namespace&.href
51
- root_ns == GPX_NS ? GPX_NS : nil
56
+ GPX_NAMESPACES.include?(root_ns) ? root_ns : nil
52
57
  end
53
58
  end
54
59
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GpxDoctor
4
- VERSION = '0.6.2'
4
+ VERSION = '0.7.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gpx_doctor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Poltrax