git-fit 0.14.3 → 0.15.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: 5922b46e00a21d66f591fb8d0e43b9a5e35dbb2fef4f5118aa7c689e62fa0118
4
- data.tar.gz: 103cb559cef56006024fb838982410a47c49485c9a104ee6bd29a33cc05179f2
3
+ metadata.gz: 79cc74453027121864f89091916030e85740e51843fc01fec0653e1d81d56b73
4
+ data.tar.gz: e4ac69b5d96ca061484445242435bb2f3b36ca112c1cf7ef0ca0031862914b0a
5
5
  SHA512:
6
- metadata.gz: d7de2f67f3c9d549cfa1f1117acb3d0843b15cf3543508a9e588e4d8a9e1b3e3ca06f1e6feb403204df9f17bc480b758b95586ef5ab55085e59795773890a545
7
- data.tar.gz: 5e252339935260098d9d8811ba9a4229dabf58c86c861afad78e6a2d17096aaed24dc2500f2144a5982e2157a2d343cf35b1269e0098f32675153afda2583640
6
+ metadata.gz: bf5d3a7c4341b75039170cbae3f5ccd6f423ea7ac1e297a1c4a4ba72b9e22eb66ca3c6a4d3f293f3079e5d38fe1d9c03985871cf859194bd7ddfe1e9b860b9f1
7
+ data.tar.gz: 15009f7d14e7625cde88cffab15a126f732a756ba29d41b75a610e0498a8d33df371a3cd07c79285a2ede47edcc9942398c28b48194453de48b8226ef5ea0ed8
@@ -655,7 +655,19 @@ module GitFit
655
655
  FIT_EPOCH = 631_065_600
656
656
 
657
657
  def raw_path(platform_id)
658
- File.join(raw_dir, "#{platform_id}.fit")
658
+ File.join(raw_dir, platform_id, 'activity.fit')
659
+ end
660
+
661
+ def write_source_archive(data, platform_id, ext = 'json')
662
+ dir = File.join(raw_dir, platform_id)
663
+ FileUtils.mkdir_p(dir)
664
+ tmp = File.join(dir, ".activity.#{ext}.tmp")
665
+ dest = File.join(dir, "activity.#{ext}")
666
+ case data
667
+ when String then File.write(tmp, data)
668
+ when Hash, Array then File.write(tmp, JSON.generate(data))
669
+ end
670
+ File.rename(tmp, dest)
659
671
  end
660
672
 
661
673
  def fetch_summary_polyline(activity_id)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitFit
4
- VERSION = '0.14.3'
4
+ VERSION = '0.15.0'
5
5
  end
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.14.3
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lax