git-fit 0.21.4 → 0.21.5
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48c6e4ae806fb763ebd6be23722a4f8bf491fcbed981a89e71aa77aee0565ca1
|
|
4
|
+
data.tar.gz: 12e2af6687f1c71c70dfb304d851c7654daa0c1c3edc77e7fd38788bce9f3368
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4ab815d72f0dbe551350b16a34b2fd3777c9a621d4129bc5a32591849fe1f8534431542bb155f63277e9a8b4071caff1f220854e98a192ca673dc57bcb1c7aaf
|
|
7
|
+
data.tar.gz: 749027f7c6100142698c8db163e7a4d41309e6aef41671aa21149977d0ae03f5f41d0dbc9020232ff6ee3b8194f26db32d4d1003e423930a52fcee5ab98f83d8
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# rubocop:disable Metrics/BlockLength
|
|
1
4
|
Sequel.migration do
|
|
2
5
|
up do
|
|
3
6
|
create_table?(:activities) do
|
|
@@ -7,7 +10,7 @@ Sequel.migration do
|
|
|
7
10
|
Float :distance
|
|
8
11
|
Integer :moving_time
|
|
9
12
|
Integer :elapsed_time
|
|
10
|
-
String :sport_category, null: false, default:
|
|
13
|
+
String :sport_category, null: false, default: 'run'
|
|
11
14
|
String :sport_type
|
|
12
15
|
String :start_date
|
|
13
16
|
String :start_date_local
|
|
@@ -23,6 +26,14 @@ Sequel.migration do
|
|
|
23
26
|
Integer :calories
|
|
24
27
|
Float :average_speed
|
|
25
28
|
Float :elevation_gain
|
|
29
|
+
Float :elevation_loss
|
|
30
|
+
Float :elevation_min
|
|
31
|
+
Float :elevation_max
|
|
32
|
+
Float :elevation_gain_terrain
|
|
33
|
+
Float :elevation_loss_terrain
|
|
34
|
+
Float :elevation_min_terrain
|
|
35
|
+
Float :elevation_max_terrain
|
|
36
|
+
Integer :steps
|
|
26
37
|
String :source
|
|
27
38
|
String :duplicate_info, text: true
|
|
28
39
|
String :divisions, text: true
|
|
@@ -62,3 +73,4 @@ Sequel.migration do
|
|
|
62
73
|
drop_table?(:activities)
|
|
63
74
|
end
|
|
64
75
|
end
|
|
76
|
+
# rubocop:enable Metrics/BlockLength
|
data/lib/git_fit/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: git-fit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.21.
|
|
4
|
+
version: 0.21.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lax
|
|
@@ -257,9 +257,6 @@ extensions: []
|
|
|
257
257
|
extra_rdoc_files: []
|
|
258
258
|
files:
|
|
259
259
|
- db/migrations/001_full_schema.rb
|
|
260
|
-
- db/migrations/002_iso8601_time_format.rb
|
|
261
|
-
- db/migrations/003_add_elevation_fields.rb
|
|
262
|
-
- db/migrations/004_add_elevation_terrain_fields.rb
|
|
263
260
|
- exe/git-fit
|
|
264
261
|
- lib/git-fit.rb
|
|
265
262
|
- lib/git_fit/auth/garmin.rb
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
Sequel.migration do
|
|
2
|
-
up do
|
|
3
|
-
rows = self[:activities].all
|
|
4
|
-
|
|
5
|
-
rows.each do |row|
|
|
6
|
-
updates = {}
|
|
7
|
-
|
|
8
|
-
# Detect format: ISO 8601 contains "T", naive format does not
|
|
9
|
-
sd = row[:start_date]
|
|
10
|
-
if sd && sd.is_a?(String) && !sd.include?("T")
|
|
11
|
-
t = Time.parse(sd) rescue nil
|
|
12
|
-
if t
|
|
13
|
-
case row[:source]
|
|
14
|
-
when "apple_health"
|
|
15
|
-
# Apple Health stored +0800 local time as naive "2026-06-25 19:49:17"
|
|
16
|
-
# Parse as local (+0800) then convert to UTC ISO 8601
|
|
17
|
-
local_t = Time.parse(sd + " +0800") rescue nil
|
|
18
|
-
updates[:start_date] = local_t.utc.iso8601 if local_t
|
|
19
|
-
else
|
|
20
|
-
# All other sources stored UTC naive "2026-06-25 11:49:17"
|
|
21
|
-
# Parse as UTC then output ISO 8601
|
|
22
|
-
utc_t = Time.parse(sd + " UTC") rescue nil
|
|
23
|
-
updates[:start_date] = utc_t.iso8601 if utc_t
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
sdl = row[:start_date_local]
|
|
29
|
-
if sdl && sdl.is_a?(String) && !sdl.include?("T")
|
|
30
|
-
t = Time.parse(sdl) rescue nil
|
|
31
|
-
if t
|
|
32
|
-
case row[:source]
|
|
33
|
-
when "strava", "igpsport"
|
|
34
|
-
# These stores proper local time, preserve as ISO 8601 with offset
|
|
35
|
-
local_t = Time.parse(sdl + " +0800") rescue nil
|
|
36
|
-
updates[:start_date_local] = local_t.iso8601 if local_t
|
|
37
|
-
else
|
|
38
|
-
# Same as start_date (UTC)
|
|
39
|
-
utc_t = Time.parse(sdl + " UTC") rescue nil
|
|
40
|
-
updates[:start_date_local] = utc_t.iso8601 if utc_t
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
self[:activities].where(run_id: row[:run_id]).update(updates) unless updates.empty?
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
down do
|
|
50
|
-
# One-way migration: cannot automatically revert ISO 8601 → naive
|
|
51
|
-
# because timezone info would be silently lost.
|
|
52
|
-
# To rollback: restore from DB backup or re-import.
|
|
53
|
-
end
|
|
54
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Sequel.migration do
|
|
2
|
-
up do
|
|
3
|
-
alter_table(:activities) do
|
|
4
|
-
add_column :elevation_loss, Float
|
|
5
|
-
add_column :elevation_min, Float
|
|
6
|
-
add_column :elevation_max, Float
|
|
7
|
-
add_column :steps, Integer
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
down do
|
|
12
|
-
alter_table(:activities) do
|
|
13
|
-
drop_column :steps
|
|
14
|
-
drop_column :elevation_max
|
|
15
|
-
drop_column :elevation_min
|
|
16
|
-
drop_column :elevation_loss
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Sequel.migration do
|
|
2
|
-
up do
|
|
3
|
-
alter_table(:activities) do
|
|
4
|
-
add_column :elevation_gain_terrain, Float
|
|
5
|
-
add_column :elevation_loss_terrain, Float
|
|
6
|
-
add_column :elevation_min_terrain, Float
|
|
7
|
-
add_column :elevation_max_terrain, Float
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
down do
|
|
12
|
-
alter_table(:activities) do
|
|
13
|
-
drop_column :elevation_max_terrain
|
|
14
|
-
drop_column :elevation_min_terrain
|
|
15
|
-
drop_column :elevation_loss_terrain
|
|
16
|
-
drop_column :elevation_gain_terrain
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|