tryterra_api 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +32 -0
- data/.gitignore +9 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +74 -0
- data/LICENSE.txt +21 -0
- data/README.md +108 -0
- data/Rakefile +10 -0
- data/bin/console +13 -0
- data/bin/setup +8 -0
- data/lib/try_terra/client.rb +62 -0
- data/lib/try_terra/error.rb +3 -0
- data/lib/try_terra/object.rb +20 -0
- data/lib/try_terra/objects/activity.rb +4 -0
- data/lib/try_terra/objects/athlete.rb +4 -0
- data/lib/try_terra/objects/auth.rb +4 -0
- data/lib/try_terra/objects/body.rb +4 -0
- data/lib/try_terra/objects/daily.rb +4 -0
- data/lib/try_terra/objects/menstruation.rb +4 -0
- data/lib/try_terra/objects/sleep.rb +4 -0
- data/lib/try_terra/objects/subscriptions.rb +4 -0
- data/lib/try_terra/objects/user_info.rb +4 -0
- data/lib/try_terra/resource.rb +25 -0
- data/lib/try_terra/resources/activity.rb +7 -0
- data/lib/try_terra/resources/athlete.rb +7 -0
- data/lib/try_terra/resources/auth.rb +11 -0
- data/lib/try_terra/resources/body.rb +7 -0
- data/lib/try_terra/resources/daily.rb +7 -0
- data/lib/try_terra/resources/menstruation.rb +7 -0
- data/lib/try_terra/resources/sleep.rb +7 -0
- data/lib/try_terra/resources/subscriptions.rb +7 -0
- data/lib/try_terra/resources/user_info.rb +7 -0
- data/lib/try_terra/version.rb +3 -0
- data/lib/try_terra.rb +33 -0
- data/tryterra_api.gemspec +33 -0
- metadata +150 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1bf8a25291d9fe8a19e5dacb65124541a4198d02959c7f75cdc05975de1b18ef
|
4
|
+
data.tar.gz: ff6e81835b7ca261a472698fefdfeff5f6d829e4a04ecfb79c8f07b97a5dfb15
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 57c61b8e8dbb20b032fa64d0ee536e3c24df26bf725e305115888e2693a3f56fe913af6ca0e839f7dadc4434e868e069def486475edc9001e744ecb28475abd5
|
7
|
+
data.tar.gz: dfadb9b9c4da0c47926d0ed77f224054116688ad5dff617a530cec77d5abe296379f2f3845951acea932397b8bd4b43db1cb4e9b5e63d8d2aa8417ed7fb2cd58
|
@@ -0,0 +1,32 @@
|
|
1
|
+
name: Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches:
|
6
|
+
- "*"
|
7
|
+
push:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
jobs:
|
11
|
+
tests:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby: ["2.5", "2.6", "2.7", "3.0"]
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@master
|
19
|
+
|
20
|
+
- name: Set up Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
bundler: default
|
25
|
+
bundler-cache: true
|
26
|
+
|
27
|
+
- name: StandardRb check
|
28
|
+
run: bundle exec standardrb
|
29
|
+
|
30
|
+
- name: Run tests
|
31
|
+
run: |
|
32
|
+
bundle exec rake test
|
data/.gitignore
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.0.1
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at williamkennedyjnr@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tryterra_api (0.1.1)
|
5
|
+
faraday (~> 1.7)
|
6
|
+
faraday_middleware (~> 1.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ast (2.4.2)
|
12
|
+
faraday (1.8.0)
|
13
|
+
faraday-em_http (~> 1.0)
|
14
|
+
faraday-em_synchrony (~> 1.0)
|
15
|
+
faraday-excon (~> 1.1)
|
16
|
+
faraday-httpclient (~> 1.0.1)
|
17
|
+
faraday-net_http (~> 1.0)
|
18
|
+
faraday-net_http_persistent (~> 1.1)
|
19
|
+
faraday-patron (~> 1.0)
|
20
|
+
faraday-rack (~> 1.0)
|
21
|
+
multipart-post (>= 1.2, < 3)
|
22
|
+
ruby2_keywords (>= 0.0.4)
|
23
|
+
faraday-em_http (1.0.0)
|
24
|
+
faraday-em_synchrony (1.0.0)
|
25
|
+
faraday-excon (1.1.0)
|
26
|
+
faraday-httpclient (1.0.1)
|
27
|
+
faraday-net_http (1.0.1)
|
28
|
+
faraday-net_http_persistent (1.2.0)
|
29
|
+
faraday-patron (1.0.0)
|
30
|
+
faraday-rack (1.0.0)
|
31
|
+
faraday_middleware (1.2.0)
|
32
|
+
faraday (~> 1.0)
|
33
|
+
minitest (5.14.4)
|
34
|
+
multipart-post (2.1.1)
|
35
|
+
parallel (1.21.0)
|
36
|
+
parser (3.0.3.0)
|
37
|
+
ast (~> 2.4.1)
|
38
|
+
rainbow (3.0.0)
|
39
|
+
rake (10.5.0)
|
40
|
+
regexp_parser (2.1.1)
|
41
|
+
rexml (3.2.5)
|
42
|
+
rubocop (1.22.3)
|
43
|
+
parallel (~> 1.10)
|
44
|
+
parser (>= 3.0.0.0)
|
45
|
+
rainbow (>= 2.2.2, < 4.0)
|
46
|
+
regexp_parser (>= 1.8, < 3.0)
|
47
|
+
rexml
|
48
|
+
rubocop-ast (>= 1.12.0, < 2.0)
|
49
|
+
ruby-progressbar (~> 1.7)
|
50
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
51
|
+
rubocop-ast (1.13.0)
|
52
|
+
parser (>= 3.0.1.1)
|
53
|
+
rubocop-performance (1.11.5)
|
54
|
+
rubocop (>= 1.7.0, < 2.0)
|
55
|
+
rubocop-ast (>= 0.4.0)
|
56
|
+
ruby-progressbar (1.11.0)
|
57
|
+
ruby2_keywords (0.0.5)
|
58
|
+
standard (1.4.0)
|
59
|
+
rubocop (= 1.22.3)
|
60
|
+
rubocop-performance (= 1.11.5)
|
61
|
+
unicode-display_width (2.1.0)
|
62
|
+
|
63
|
+
PLATFORMS
|
64
|
+
ruby
|
65
|
+
|
66
|
+
DEPENDENCIES
|
67
|
+
bundler (~> 2.2.20)
|
68
|
+
minitest (~> 5.0)
|
69
|
+
rake (~> 10.0)
|
70
|
+
standard
|
71
|
+
tryterra_api!
|
72
|
+
|
73
|
+
BUNDLED WITH
|
74
|
+
2.2.20
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 William Kennedy
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
# TryterraApi
|
2
|
+
|
3
|
+
|
4
|
+
This an unoffical Ruby api wrapper for tryterra.co
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'tryterra_api'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install tryterra_api
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
client = TryTerra::Client.new(dev_id: ENV['DEV_ID'], x_api_key: ENV['API_KEY'])
|
26
|
+
auth_response = client.auth.authenicate_user(resource: 'fitbit', reference_id: '1234-5678' )
|
27
|
+
```
|
28
|
+
|
29
|
+
|
30
|
+
## Resources
|
31
|
+
|
32
|
+
This gem aims to map as close to the TryTerra Api as posible. Responses return ruby objects built on OpenStruct to make it easier to work with.
|
33
|
+
|
34
|
+
#### Auth
|
35
|
+
|
36
|
+
```
|
37
|
+
auth_response = client.auth.authenicate_user(resource: 'fitbit', reference_id: '1234-5678' ) => TryTerra::Auth
|
38
|
+
|
39
|
+
client.auth.deauthenticate_user(user_id: '123')
|
40
|
+
```
|
41
|
+
|
42
|
+
#### Subscriptions
|
43
|
+
|
44
|
+
```
|
45
|
+
client.subscriptions
|
46
|
+
```
|
47
|
+
|
48
|
+
#### User Info
|
49
|
+
|
50
|
+
```
|
51
|
+
client.user_info(user_id: 'abs')
|
52
|
+
```
|
53
|
+
|
54
|
+
#### Athlete
|
55
|
+
|
56
|
+
```
|
57
|
+
client.athlete(user_id: 'abs')
|
58
|
+
```
|
59
|
+
|
60
|
+
#### Activity
|
61
|
+
|
62
|
+
```
|
63
|
+
client.activity(user_id: 'abs', start_date: '2021-01-01')
|
64
|
+
```
|
65
|
+
|
66
|
+
#### Body
|
67
|
+
|
68
|
+
```
|
69
|
+
client.body(user_id: 'abs', start_date: '2021-01-01')
|
70
|
+
```
|
71
|
+
|
72
|
+
#### Daily
|
73
|
+
|
74
|
+
```
|
75
|
+
client.daily(user_id: 'abs', start_date: '2021-01-01')
|
76
|
+
```
|
77
|
+
|
78
|
+
#### Sleep
|
79
|
+
|
80
|
+
```
|
81
|
+
client.sleep(user_id: 'abs', start_date: '2021-01-01')
|
82
|
+
```
|
83
|
+
|
84
|
+
### Menstruation
|
85
|
+
|
86
|
+
```
|
87
|
+
client.menstruation(user_id: 'abs', start_date: '2021-01-01')
|
88
|
+
```
|
89
|
+
|
90
|
+
## Development
|
91
|
+
|
92
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
93
|
+
|
94
|
+
You will need a TryTerra dev_id and api_key
|
95
|
+
|
96
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
97
|
+
|
98
|
+
## Contributing
|
99
|
+
|
100
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tryterra_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
101
|
+
|
102
|
+
## License
|
103
|
+
|
104
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
105
|
+
|
106
|
+
## Code of Conduct
|
107
|
+
|
108
|
+
Everyone interacting in the TryterraApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/tryterra_api/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "try_terra"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
require "irb"
|
13
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
module TryTerra
|
2
|
+
class Client
|
3
|
+
BASE_URL = "https://api.tryterra.co/v2/"
|
4
|
+
|
5
|
+
attr_reader :dev_id, :x_api_key, :stubs
|
6
|
+
|
7
|
+
def initialize(dev_id:, x_api_key:, stubs: nil)
|
8
|
+
@dev_id = dev_id
|
9
|
+
@x_api_key = x_api_key
|
10
|
+
@stubs = stubs
|
11
|
+
end
|
12
|
+
|
13
|
+
def auth
|
14
|
+
AuthResource.new(self)
|
15
|
+
end
|
16
|
+
|
17
|
+
def subscriptions(**params)
|
18
|
+
SubscriptionsResource.new(self).get(params)
|
19
|
+
end
|
20
|
+
|
21
|
+
def user_info(**params)
|
22
|
+
UserInfoResource.new(self).get(params)
|
23
|
+
end
|
24
|
+
|
25
|
+
def athlete(**params)
|
26
|
+
AthleteResource.new(self).get(params)
|
27
|
+
end
|
28
|
+
|
29
|
+
def activity(**params)
|
30
|
+
ActivityResource.new(self).get(params)
|
31
|
+
end
|
32
|
+
|
33
|
+
def body(**params)
|
34
|
+
BodyResource.new(self).get(params)
|
35
|
+
end
|
36
|
+
|
37
|
+
def daily(**params)
|
38
|
+
DailyResource.new(self).get(params)
|
39
|
+
end
|
40
|
+
|
41
|
+
def sleep(**params)
|
42
|
+
SleepResource.new(self).get(params)
|
43
|
+
end
|
44
|
+
|
45
|
+
def menstruation(**params)
|
46
|
+
MenstruationResource.new(self).get(params)
|
47
|
+
end
|
48
|
+
|
49
|
+
def connection
|
50
|
+
@connection ||= Faraday.new(BASE_URL) do |conn|
|
51
|
+
conn.headers["dev-id"] = dev_id
|
52
|
+
conn.headers["x-api-key"] = x_api_key
|
53
|
+
|
54
|
+
conn.response :json, content_type: "application/json"
|
55
|
+
# for testing
|
56
|
+
if @stubs
|
57
|
+
conn.adapter :test, @stubs
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "ostruct"
|
2
|
+
# I stand on the shoulder of giants https://github.com/tolbkni/vultr.rb/blob/master/lib/vultr/object.rb
|
3
|
+
|
4
|
+
module TryTerra
|
5
|
+
class Object < OpenStruct
|
6
|
+
def initialize(attributes)
|
7
|
+
super to_ostruct(attributes)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_ostruct(obj)
|
11
|
+
if obj.is_a?(Hash)
|
12
|
+
OpenStruct.new(obj.map { |key, val| [key, to_ostruct(val)] }.to_h)
|
13
|
+
elsif obj.is_a?(Array)
|
14
|
+
obj.map { |o| to_ostruct(o) }
|
15
|
+
else # Assumed to be a primitive value
|
16
|
+
obj
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module TryTerra
|
2
|
+
class Resource
|
3
|
+
attr_reader :client
|
4
|
+
|
5
|
+
def initialize(client)
|
6
|
+
@client = client
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def get_request(url, params)
|
12
|
+
client.connection.get(url, params)
|
13
|
+
end
|
14
|
+
|
15
|
+
def post_request(url, params)
|
16
|
+
client.connection.post(url) do |req|
|
17
|
+
req.params = params
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def delete_request(url, params)
|
22
|
+
client.connection.delete(url, params)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module TryTerra
|
2
|
+
class AuthResource < Resource
|
3
|
+
def authenticate_user(**params)
|
4
|
+
Auth.new(post_request("auth/authenticateUser", params).body)
|
5
|
+
end
|
6
|
+
|
7
|
+
def deauthenticate_user(**params)
|
8
|
+
Auth.new(delete_request("auth/deauthenticateUser", params).body)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/try_terra.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require "faraday"
|
2
|
+
require "faraday_middleware"
|
3
|
+
|
4
|
+
require "try_terra/version"
|
5
|
+
|
6
|
+
module TryTerra
|
7
|
+
autoload :Error, "try_terra/error"
|
8
|
+
autoload :Client, "try_terra/client"
|
9
|
+
autoload :Resource, "try_terra/resource"
|
10
|
+
autoload :Object, "try_terra/object"
|
11
|
+
|
12
|
+
# Endpoints
|
13
|
+
autoload :AuthResource, "try_terra/resources/auth"
|
14
|
+
autoload :SubscriptionsResource, "try_terra/resources/subscriptions"
|
15
|
+
autoload :UserInfoResource, "try_terra/resources/user_info"
|
16
|
+
autoload :AthleteResource, "try_terra/resources/athlete"
|
17
|
+
autoload :ActivityResource, "try_terra/resources/activity"
|
18
|
+
autoload :BodyResource, "try_terra/resources/body"
|
19
|
+
autoload :DailyResource, "try_terra/resources/daily"
|
20
|
+
autoload :SleepResource, "try_terra/resources/sleep"
|
21
|
+
autoload :MenstruationResource, "try_terra/resources/menstruation"
|
22
|
+
|
23
|
+
# Objects
|
24
|
+
autoload :Auth, "try_terra/objects/auth"
|
25
|
+
autoload :Subscriptions, "try_terra/objects/subscriptions"
|
26
|
+
autoload :UserInfo, "try_terra/objects/user_info"
|
27
|
+
autoload :Athlete, "try_terra/objects/athlete"
|
28
|
+
autoload :Activity, "try_terra/objects/activity"
|
29
|
+
autoload :Body, "try_terra/objects/body"
|
30
|
+
autoload :Daily, "try_terra/objects/daily"
|
31
|
+
autoload :Sleep, "try_terra/objects/sleep"
|
32
|
+
autoload :Menstruation, "try_terra/objects/menstruation"
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "try_terra/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "tryterra_api"
|
7
|
+
spec.version = TryTerra::VERSION
|
8
|
+
spec.authors = ["William Kennedy"]
|
9
|
+
spec.email = ["william.kennedy@hey.com"]
|
10
|
+
|
11
|
+
spec.summary = "A simple Ruby wrapper for https://tryterra.co"
|
12
|
+
spec.description = ""
|
13
|
+
spec.homepage = "https://github.com/williamkennedy/tryterra_api"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.required_ruby_version = ">= 2.5"
|
17
|
+
|
18
|
+
# Specify which files should be added to the gem when it is released.
|
19
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
|
+
spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
end
|
23
|
+
spec.bindir = "exe"
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
+
spec.require_paths = ["lib"]
|
26
|
+
|
27
|
+
spec.add_development_dependency "bundler", "~> 2.2.20"
|
28
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
30
|
+
|
31
|
+
spec.add_dependency "faraday", "~> 1.7"
|
32
|
+
spec.add_dependency "faraday_middleware", "~> 1.1"
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tryterra_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- William Kennedy
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-11-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.2.20
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.2.20
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.7'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.7'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: faraday_middleware
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.1'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.1'
|
83
|
+
description: ''
|
84
|
+
email:
|
85
|
+
- william.kennedy@hey.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".github/workflows/ci.yml"
|
91
|
+
- ".gitignore"
|
92
|
+
- ".ruby-version"
|
93
|
+
- ".travis.yml"
|
94
|
+
- CODE_OF_CONDUCT.md
|
95
|
+
- Gemfile
|
96
|
+
- Gemfile.lock
|
97
|
+
- LICENSE.txt
|
98
|
+
- README.md
|
99
|
+
- Rakefile
|
100
|
+
- bin/console
|
101
|
+
- bin/setup
|
102
|
+
- lib/try_terra.rb
|
103
|
+
- lib/try_terra/client.rb
|
104
|
+
- lib/try_terra/error.rb
|
105
|
+
- lib/try_terra/object.rb
|
106
|
+
- lib/try_terra/objects/activity.rb
|
107
|
+
- lib/try_terra/objects/athlete.rb
|
108
|
+
- lib/try_terra/objects/auth.rb
|
109
|
+
- lib/try_terra/objects/body.rb
|
110
|
+
- lib/try_terra/objects/daily.rb
|
111
|
+
- lib/try_terra/objects/menstruation.rb
|
112
|
+
- lib/try_terra/objects/sleep.rb
|
113
|
+
- lib/try_terra/objects/subscriptions.rb
|
114
|
+
- lib/try_terra/objects/user_info.rb
|
115
|
+
- lib/try_terra/resource.rb
|
116
|
+
- lib/try_terra/resources/activity.rb
|
117
|
+
- lib/try_terra/resources/athlete.rb
|
118
|
+
- lib/try_terra/resources/auth.rb
|
119
|
+
- lib/try_terra/resources/body.rb
|
120
|
+
- lib/try_terra/resources/daily.rb
|
121
|
+
- lib/try_terra/resources/menstruation.rb
|
122
|
+
- lib/try_terra/resources/sleep.rb
|
123
|
+
- lib/try_terra/resources/subscriptions.rb
|
124
|
+
- lib/try_terra/resources/user_info.rb
|
125
|
+
- lib/try_terra/version.rb
|
126
|
+
- tryterra_api.gemspec
|
127
|
+
homepage: https://github.com/williamkennedy/tryterra_api
|
128
|
+
licenses:
|
129
|
+
- MIT
|
130
|
+
metadata: {}
|
131
|
+
post_install_message:
|
132
|
+
rdoc_options: []
|
133
|
+
require_paths:
|
134
|
+
- lib
|
135
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '2.5'
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
requirements: []
|
146
|
+
rubygems_version: 3.2.15
|
147
|
+
signing_key:
|
148
|
+
specification_version: 4
|
149
|
+
summary: A simple Ruby wrapper for https://tryterra.co
|
150
|
+
test_files: []
|