exist 0.1.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +3 -0
- data/.gitignore +5 -0
- data/.rspec +1 -0
- data/.ruby-version +1 -0
- data/.yardopts +1 -0
- data/ChangeLog.md +4 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +20 -0
- data/README.md +84 -0
- data/Rakefile +34 -0
- data/exist.gemspec +33 -0
- data/lib/exist.rb +16 -0
- data/lib/exist/api.rb +122 -0
- data/lib/exist/attribute_list.rb +12 -0
- data/lib/exist/attributes.rb +4 -0
- data/lib/exist/authentication.rb +25 -0
- data/lib/exist/average.rb +4 -0
- data/lib/exist/average_list.rb +11 -0
- data/lib/exist/correlation.rb +4 -0
- data/lib/exist/correlation_list.rb +7 -0
- data/lib/exist/insight.rb +8 -0
- data/lib/exist/insight_list.rb +11 -0
- data/lib/exist/user.rb +8 -0
- data/lib/exist/version.rb +3 -0
- data/spec/exist/api_spec.rb +238 -0
- data/spec/exist_spec.rb +7 -0
- data/spec/fixtures/attributes.json +47 -0
- data/spec/fixtures/average_for_specific_attribute.json +31 -0
- data/spec/fixtures/averages.json +26 -0
- data/spec/fixtures/correlations.json +27 -0
- data/spec/fixtures/insights.json +51 -0
- data/spec/fixtures/insights_for_specific_attribute.json +29 -0
- data/spec/fixtures/overview.json +41 -0
- data/spec/fixtures/specific_attribute.json +29 -0
- data/spec/fixtures/user_stripped.json +13 -0
- data/spec/spec_helper.rb +42 -0
- data/spec/support/api_helpers.rb +20 -0
- metadata +275 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"count": 220,
|
3
|
+
"next": "https://exist.io/api/1/users/josh/insights/attribute/sleep/?page=2",
|
4
|
+
"previous": null,
|
5
|
+
"results": [
|
6
|
+
{
|
7
|
+
"created": "2015-05-09T01:00:02Z",
|
8
|
+
"target_date": "2015-05-08",
|
9
|
+
"html": "<div class=\"secondary\">Friday night: Shortest sleep for 3 days</div>...",
|
10
|
+
"value": "303",
|
11
|
+
"value2": "3 days",
|
12
|
+
"comment": null,
|
13
|
+
"type": {
|
14
|
+
"name": "sleep_worst_since_x",
|
15
|
+
"period": 1,
|
16
|
+
"priority": 2,
|
17
|
+
"attribute": {
|
18
|
+
"name": "sleep",
|
19
|
+
"label": "Time asleep",
|
20
|
+
"group": {
|
21
|
+
"name": "sleep",
|
22
|
+
"priority": 3
|
23
|
+
},
|
24
|
+
"priority": 2
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"id": 1,
|
3
|
+
"username": "josh",
|
4
|
+
"first_name": "Josh",
|
5
|
+
"last_name": "Sharp",
|
6
|
+
"bio": "I made this thing you're using.",
|
7
|
+
"url": "http://hellocode.co/",
|
8
|
+
"avatar": "https://exist.io/static/media/avatars/josh_2.png",
|
9
|
+
"timezone": "Australia/Melbourne",
|
10
|
+
"local_time": "2020-07-31T22:33:49.359+10:00",
|
11
|
+
"private": false,
|
12
|
+
"imperial_units": false,
|
13
|
+
"attributes": [
|
14
|
+
{
|
15
|
+
"group": "steps",
|
16
|
+
"priority": 1,
|
17
|
+
"items": [
|
18
|
+
{
|
19
|
+
"attribute": "steps",
|
20
|
+
"label": "Steps",
|
21
|
+
"value": 258,
|
22
|
+
"service": "Fitbit",
|
23
|
+
"priority": 1,
|
24
|
+
"private": false,
|
25
|
+
"value_type": 0,
|
26
|
+
"value_type_description": "Integer"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"attribute": "floors",
|
30
|
+
"label": "Floors",
|
31
|
+
"value": 2,
|
32
|
+
"service": "Fitbit",
|
33
|
+
"priority": 2,
|
34
|
+
"private": false,
|
35
|
+
"value_type": 0,
|
36
|
+
"value_type_description": "Integer"
|
37
|
+
}
|
38
|
+
]
|
39
|
+
}
|
40
|
+
]
|
41
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"count": 655,
|
3
|
+
"next": "https://exist.io/api/1/users/josh/attributes/steps/?page=2",
|
4
|
+
"previous": null,
|
5
|
+
"results": [
|
6
|
+
{
|
7
|
+
"value": 3783,
|
8
|
+
"date": "2015-05-08"
|
9
|
+
}, {
|
10
|
+
"value": 6177,
|
11
|
+
"date": "2015-05-07"
|
12
|
+
}, {
|
13
|
+
"value": 7811,
|
14
|
+
"date": "2015-05-06"
|
15
|
+
}, {
|
16
|
+
"value": 6632,
|
17
|
+
"date": "2015-05-05"
|
18
|
+
}, {
|
19
|
+
"value": 6014,
|
20
|
+
"date": "2015-05-04"
|
21
|
+
}, {
|
22
|
+
"value": 4376,
|
23
|
+
"date": "2015-05-03"
|
24
|
+
}, {
|
25
|
+
"value": 8671,
|
26
|
+
"date": "2015-05-02"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"id": 1,
|
3
|
+
"username": "josh",
|
4
|
+
"first_name": "Josh",
|
5
|
+
"last_name": "Sharp",
|
6
|
+
"bio": "I made this thing you're using.",
|
7
|
+
"url": "http://hellocode.co/",
|
8
|
+
"avatar": "https://exist.io/static/media/avatars/josh_2.png",
|
9
|
+
"timezone": "Australia/Melbourne",
|
10
|
+
"local_time": "2020-05-08T20:56:20.417+10:00",
|
11
|
+
"private": false,
|
12
|
+
"imperial_units": false
|
13
|
+
}
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
require 'coveralls'
|
3
|
+
|
4
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
5
|
+
SimpleCov::Formatter::HTMLFormatter,
|
6
|
+
Coveralls::SimpleCov::Formatter
|
7
|
+
]
|
8
|
+
|
9
|
+
SimpleCov.start do
|
10
|
+
add_filter 'spec'
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'rspec'
|
14
|
+
require 'webmock/rspec'
|
15
|
+
|
16
|
+
Dir[File.expand_path('../support/**/*.rb', __FILE__)].each { |f| puts f; require f }
|
17
|
+
|
18
|
+
RSpec.configure do |config|
|
19
|
+
config.filter_run :focus
|
20
|
+
config.run_all_when_everything_filtered = true
|
21
|
+
|
22
|
+
if config.files_to_run.one?
|
23
|
+
config.default_formatter = 'doc'
|
24
|
+
end
|
25
|
+
|
26
|
+
config.profile_examples = 10
|
27
|
+
|
28
|
+
config.order = :random
|
29
|
+
|
30
|
+
Kernel.srand config.seed
|
31
|
+
|
32
|
+
config.expect_with :rspec do |expectations|
|
33
|
+
expectations.syntax = :expect
|
34
|
+
end
|
35
|
+
|
36
|
+
config.mock_with :rspec do |mocks|
|
37
|
+
mocks.syntax = :expect
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
require 'exist'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module ApiHelpers
|
2
|
+
def api_root
|
3
|
+
@api_root ||= 'https://exist.io/api/1'
|
4
|
+
end
|
5
|
+
|
6
|
+
def stub_request_with_fixture(method, partial_url, fixture)
|
7
|
+
stub_request(method, api_root + partial_url).to_return(
|
8
|
+
body: File.read(fixture_path_for(fixture)),
|
9
|
+
headers: { 'Content-Type' => 'application/json' }
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
def fixture_path_for(name)
|
14
|
+
File.expand_path("../../fixtures/#{name}.json", __FILE__)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
RSpec.configure do |config|
|
19
|
+
config.include(ApiHelpers)
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,275 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: exist
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.beta.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adrian Perez
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.9'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday_middleware
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.9'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.9'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: hashie
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.4'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.8'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.8'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.4'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.4'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webmock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.21.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.21.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.10.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.10.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: coveralls
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.8.2
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.8.2
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.32.1
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.32.1
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubygems-tasks
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.2'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.2'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: yard
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0.8'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0.8'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: pry
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: 0.10.1
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 0.10.1
|
195
|
+
description: Ruby client for the Exist.IO life-tracking/correlation platform API
|
196
|
+
email: adrianperez.deb@gmail.com
|
197
|
+
executables: []
|
198
|
+
extensions: []
|
199
|
+
extra_rdoc_files: []
|
200
|
+
files:
|
201
|
+
- ".document"
|
202
|
+
- ".gitignore"
|
203
|
+
- ".rspec"
|
204
|
+
- ".ruby-version"
|
205
|
+
- ".yardopts"
|
206
|
+
- ChangeLog.md
|
207
|
+
- Gemfile
|
208
|
+
- LICENSE.txt
|
209
|
+
- README.md
|
210
|
+
- Rakefile
|
211
|
+
- exist.gemspec
|
212
|
+
- lib/exist.rb
|
213
|
+
- lib/exist/api.rb
|
214
|
+
- lib/exist/attribute_list.rb
|
215
|
+
- lib/exist/attributes.rb
|
216
|
+
- lib/exist/authentication.rb
|
217
|
+
- lib/exist/average.rb
|
218
|
+
- lib/exist/average_list.rb
|
219
|
+
- lib/exist/correlation.rb
|
220
|
+
- lib/exist/correlation_list.rb
|
221
|
+
- lib/exist/insight.rb
|
222
|
+
- lib/exist/insight_list.rb
|
223
|
+
- lib/exist/user.rb
|
224
|
+
- lib/exist/version.rb
|
225
|
+
- spec/exist/api_spec.rb
|
226
|
+
- spec/exist_spec.rb
|
227
|
+
- spec/fixtures/attributes.json
|
228
|
+
- spec/fixtures/average_for_specific_attribute.json
|
229
|
+
- spec/fixtures/averages.json
|
230
|
+
- spec/fixtures/correlations.json
|
231
|
+
- spec/fixtures/insights.json
|
232
|
+
- spec/fixtures/insights_for_specific_attribute.json
|
233
|
+
- spec/fixtures/overview.json
|
234
|
+
- spec/fixtures/specific_attribute.json
|
235
|
+
- spec/fixtures/user_stripped.json
|
236
|
+
- spec/spec_helper.rb
|
237
|
+
- spec/support/api_helpers.rb
|
238
|
+
homepage: https://github.com/blackxored/exist
|
239
|
+
licenses:
|
240
|
+
- MIT
|
241
|
+
metadata: {}
|
242
|
+
post_install_message:
|
243
|
+
rdoc_options: []
|
244
|
+
require_paths:
|
245
|
+
- lib
|
246
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
251
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
252
|
+
requirements:
|
253
|
+
- - ">"
|
254
|
+
- !ruby/object:Gem::Version
|
255
|
+
version: 1.3.1
|
256
|
+
requirements: []
|
257
|
+
rubyforge_project:
|
258
|
+
rubygems_version: 2.4.5
|
259
|
+
signing_key:
|
260
|
+
specification_version: 4
|
261
|
+
summary: Ruby client for the Exist.IO API
|
262
|
+
test_files:
|
263
|
+
- spec/exist/api_spec.rb
|
264
|
+
- spec/exist_spec.rb
|
265
|
+
- spec/fixtures/attributes.json
|
266
|
+
- spec/fixtures/average_for_specific_attribute.json
|
267
|
+
- spec/fixtures/averages.json
|
268
|
+
- spec/fixtures/correlations.json
|
269
|
+
- spec/fixtures/insights.json
|
270
|
+
- spec/fixtures/insights_for_specific_attribute.json
|
271
|
+
- spec/fixtures/overview.json
|
272
|
+
- spec/fixtures/specific_attribute.json
|
273
|
+
- spec/fixtures/user_stripped.json
|
274
|
+
- spec/spec_helper.rb
|
275
|
+
- spec/support/api_helpers.rb
|