git-fit 0.7.8 → 0.7.9

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: d5ada2a3a81ed7a1d3cc093fbe814c3f2c38ad4b230a1deacd2d43af3545eba2
4
- data.tar.gz: ad7dd436a633a101a70995b1923748c6afd96773a6c60ac8786324f4eb4006c1
3
+ metadata.gz: b609e3146c751c1d1f0275272c827ad4c3eb42987459637bce681e04d310d217
4
+ data.tar.gz: ce2f6508b97b28048a4c1927526a1f696b52b8c3e41cee1460f0ab2878fcf404
5
5
  SHA512:
6
- metadata.gz: 3e53f9ab0c76e72265e780adbe59dd348b6d6f459d9c0856351f934eb1c3740e4c86dce982408ee3c0afa15ee7b49e022bdb70ce16c6e9e5abb25bfd4ccee73b
7
- data.tar.gz: 55d30b36c1244e8cabb2892eb8d1869d5fbe853c0194bd1e9c62ab8298ed2caef6bfb34a9b38d55b9a5ae3efa08bdfaafece761e4104864e66e764d1e906745f
6
+ metadata.gz: d9686284cf445f18846ff8615fc1ba1bba8a0367bd817cf11af250956591bd2b063c37e2c7682f12b968b4e2345353db2e6d70a99cb6c3efd3247310e836cad5
7
+ data.tar.gz: a230f480415c37954d46958241dc9901de4c1b36cdc3a038a0bac959d0c988c9b5a0fec5e25d854c2f8affd389c7b949654db2c222890c675a492e9323344ced
@@ -103,21 +103,23 @@ module GitFit
103
103
  if source
104
104
  @config_key = source
105
105
  else
106
- @config_key ||= name.split("::").last.downcase
106
+ @config_key ||= camelcase_to_snakecase(name.split("::").last)
107
107
  end
108
108
  end
109
+
110
+ def camelcase_to_snakecase(str)
111
+ str.gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase
112
+ end
109
113
  end
110
114
 
111
115
  protected
112
116
 
113
117
  def raw_dir
114
- src = self.class.name.split("::").last.downcase
115
- File.join("data", "raw", src)
118
+ File.join("data", "raw", self.class.config_key)
116
119
  end
117
120
 
118
121
  def std_dir
119
- src = self.class.name.split("::").last.downcase
120
- File.join("data", "std", src)
122
+ File.join("data", "std", self.class.config_key)
121
123
  end
122
124
 
123
125
  def std_path(platform_id, ext = "json")
@@ -4,7 +4,6 @@ module GitFit
4
4
  module Sync
5
5
  class GarminCN < GarminBase
6
6
  register_adapter
7
- config_key "garmin_cn"
8
7
  register_config :email, :password, :secret, :token_path
9
8
 
10
9
  def initialize(config:, db:, activity_filter: nil, privacy: nil, time_budget: nil)
@@ -68,7 +68,7 @@ module GitFit
68
68
 
69
69
  def adapter_class(source, _cfg)
70
70
  (GitFit::Sync::Base.adapters + GitFit::Sync::Base.test_adapters)
71
- .find { |a| a.name.split("::").last.downcase == source }
71
+ .find { |a| a.config_key == source }
72
72
  end
73
73
 
74
74
  def init_source(source)
@@ -21,6 +21,7 @@ module GitFit
21
21
  RAW_EXT = "json"
22
22
 
23
23
  register_adapter
24
+ config_key "xingzhe"
24
25
  register_config :email, :password
25
26
 
26
27
  def initialize(...)
@@ -1,3 +1,3 @@
1
1
  module GitFit
2
- VERSION = "0.7.8"
2
+ VERSION = "0.7.9"
3
3
  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.7.8
4
+ version: 0.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lax