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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22e3432c218c7f596453a33a5633964fcc145204592ea6e5044d90aa09b9abae
4
- data.tar.gz: 9739770e8d343aa11ae76f0df4dab774a7c9c7de8d7c6e219f31f7a2769a3048
3
+ metadata.gz: a5aea0b4faaf732d541de77f168b12b53ff611c678d0439067e0cb71107a908f
4
+ data.tar.gz: 4fa9e0a2d736c941cda627e95b6c2dd083224486ff491756aea9438c1e8a19ca
5
5
  SHA512:
6
- metadata.gz: 411fae0a57e0bcc938cb6f5721e7dace1d6e688a0544d08772b611891a7f287fe747a99cee6a1173b5be69632214c1c7398ffdbf34be56615f8188dbb4201b86
7
- data.tar.gz: 1d4107d19edeb76b799b8327a084d27b2e6ae21f294f34461ba1f1810f9fca6c2d9ee41c02f49adf204b95b64c7e6cf179fc8a547cf247c303aaf2f62e799ffd
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("testingAnis2", "O571xuiDDS9aGXlqro9youav9YOwD3r57YqC7bj0")
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
- #begin
25
- # puts terra.generate_widget_session(
26
- # "",
27
- # ["GARMIN", "FITBIT", "OURA"],
28
- # "EN",
29
- # "https://tryterra.co",
30
- # "https://google.com"
31
- # )
32
- #rescue TerraError => e
33
- # puts e
34
- #end
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
@@ -47,7 +47,7 @@ module GWS
47
47
  }
48
48
 
49
49
  res = HTTParty.post(
50
- "#{api_path}/auth/generate_widget_session",
50
+ "#{api_path}/auth/generateWidgetSession",
51
51
  :headers=>options["headers"],
52
52
  :body=>data
53
53
  )
@@ -15,7 +15,7 @@
15
15
  require "API/Helpers"
16
16
  require 'API/TerraResponse'
17
17
 
18
- module Data
18
+ module TerraData
19
19
  def self.get_data(
20
20
  type,
21
21
  dev_id,
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/Data"
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 Data::get_data(type, @dev_id, @api_key, @api_path, user_id, start_date, end_date, to_webhook)
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.0
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-10-07 00:00:00.000000000 Z
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