tryterra-client 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/examples/example.rb +24 -24
- data/lib/API/GenerateWidgetSession.rb +1 -1
- data/lib/API/{Data.rb → TerraData.rb} +1 -1
- data/lib/Terra.rb +2 -2
- data/tryterra-client.gemspec +12 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5aea0b4faaf732d541de77f168b12b53ff611c678d0439067e0cb71107a908f
|
4
|
+
data.tar.gz: 4fa9e0a2d736c941cda627e95b6c2dd083224486ff491756aea9438c1e8a19ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05ca51b8dafeb84c85cdde2a79392d207a164de6c358ef585eba94e37b28af38ff64195882abb384ccaf7b44632afacedcd341b8296d80a685b414346d191ba2
|
7
|
+
data.tar.gz: 166b98fda65619bbd07ea13c7666ad900fb72524fbe05d963a5088fc31caa25ee0923ad3ff0038f27e19d161eff99ab13ef6fe035e4e5a9af9b7fdd63e242033
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/examples/example.rb
CHANGED
@@ -2,7 +2,7 @@ require 'Terra'
|
|
2
2
|
|
3
3
|
#initialize the api here
|
4
4
|
begin
|
5
|
-
terra = TerraAPI::Terra.new("
|
5
|
+
terra = TerraAPI::Terra.new("jaafar", "KSEXQZv3Hx4iJghSEomLVa1osghrKs2n5wTE2MJj")
|
6
6
|
rescue TerraError => e
|
7
7
|
puts e
|
8
8
|
end
|
@@ -21,38 +21,38 @@ rescue TerraError => e
|
|
21
21
|
puts e
|
22
22
|
end
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
24
|
+
begin
|
25
|
+
puts terra.generate_widget_session(
|
26
|
+
"reference",
|
27
|
+
["GARMIN", "FITBIT", "OURA"],
|
28
|
+
"EN",
|
29
|
+
"https://tryterra.co",
|
30
|
+
"https://google.com"
|
31
|
+
)
|
32
|
+
rescue TerraError => e
|
33
|
+
puts e
|
34
|
+
end
|
35
35
|
|
36
|
-
#begin
|
36
|
+
# begin
|
37
37
|
# puts terra.get_user(YOUR_USER_ID)
|
38
|
-
#rescue TerraError => e
|
38
|
+
# rescue TerraError => e
|
39
39
|
# puts e
|
40
|
-
#end
|
40
|
+
# end
|
41
41
|
|
42
|
-
#begin
|
42
|
+
# begin
|
43
43
|
# puts terra.deauth_user(YOUR_USER_ID)
|
44
|
-
#rescue TerraError => e
|
44
|
+
# rescue TerraError => e
|
45
45
|
# puts e
|
46
|
-
#end
|
46
|
+
# end
|
47
47
|
|
48
|
-
#begin
|
48
|
+
# begin
|
49
49
|
# puts terra.get_athelete(YOUR_USER_ID)
|
50
|
-
#rescue TerraError => e
|
50
|
+
# rescue TerraError => e
|
51
51
|
# puts e
|
52
|
-
#end
|
52
|
+
# end
|
53
53
|
|
54
|
-
#begin
|
54
|
+
# begin
|
55
55
|
# puts terra.get_activity(YOUR_USER_ID, Time.new)
|
56
|
-
#rescue TerraError => e
|
56
|
+
# rescue TerraError => e
|
57
57
|
# puts e
|
58
|
-
#end
|
58
|
+
# end
|
data/lib/Terra.rb
CHANGED
@@ -18,7 +18,7 @@ require "API/GenerateWidgetSession"
|
|
18
18
|
require "API/Providers"
|
19
19
|
require "API/Subscribers"
|
20
20
|
require "API/Users"
|
21
|
-
require "API/
|
21
|
+
require "API/TerraData"
|
22
22
|
require "API/Helpers"
|
23
23
|
require "API/TerraWebhook"
|
24
24
|
|
@@ -88,7 +88,7 @@ module TerraAPI
|
|
88
88
|
end
|
89
89
|
|
90
90
|
private def get_data(type, user_id, start_date, end_date, to_webhook=false)
|
91
|
-
return
|
91
|
+
return TerraData::get_data(type, @dev_id, @api_key, @api_path, user_id, start_date, end_date, to_webhook)
|
92
92
|
end
|
93
93
|
|
94
94
|
def get_activity(user_id, start_date, end_date=nil, to_webhook=false)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'tryterra-client'
|
3
|
+
s.version = '0.2.1'
|
4
|
+
s.licenses = ['MIT']
|
5
|
+
s.summary = "Ruby client for tryterra api"
|
6
|
+
s.description = "Ruby client for tryterra api"
|
7
|
+
s.authors = ["Anis", "Jaafar"]
|
8
|
+
s.email = 'dev@tryterra.co'
|
9
|
+
s.files = `git ls-files`.split("\n")
|
10
|
+
s.homepage = 'https://docs.tryterra.co/docs/ruby-project'
|
11
|
+
s.metadata = { "source_code_uri" => "https://github.com/tryterra/terra-client-ruby" }
|
12
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tryterra-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anis
|
8
|
+
- Jaafar
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2022-
|
12
|
+
date: 2022-11-08 00:00:00.000000000 Z
|
12
13
|
dependencies: []
|
13
14
|
description: Ruby client for tryterra api
|
14
15
|
email: dev@tryterra.co
|
@@ -16,21 +17,23 @@ executables: []
|
|
16
17
|
extensions: []
|
17
18
|
extra_rdoc_files: []
|
18
19
|
files:
|
20
|
+
- ".gitignore"
|
19
21
|
- LICENSE
|
20
22
|
- README.md
|
21
23
|
- examples/example.rb
|
22
24
|
- lib/API/Athelete.rb
|
23
|
-
- lib/API/Data.rb
|
24
25
|
- lib/API/GenerateWidgetSession.rb
|
25
26
|
- lib/API/Helpers.rb
|
26
27
|
- lib/API/Providers.rb
|
27
28
|
- lib/API/Subscribers.rb
|
29
|
+
- lib/API/TerraData.rb
|
28
30
|
- lib/API/TerraError.rb
|
29
31
|
- lib/API/TerraResponse.rb
|
30
32
|
- lib/API/TerraWebhook.rb
|
31
33
|
- lib/API/Users.rb
|
32
34
|
- lib/Terra.rb
|
33
35
|
- spec/tests.rb
|
36
|
+
- tryterra-client.gemspec
|
34
37
|
homepage: https://docs.tryterra.co/docs/ruby-project
|
35
38
|
licenses:
|
36
39
|
- MIT
|