health_graph 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +50 -0
- data/Rakefile +4 -40
- data/health_graph.gemspec +23 -130
- data/test/helper.rb +3 -3
- data/test/test_health_graph.rb +37 -36
- metadata +63 -163
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NzQwNmIyMmVmZjAwMGQ0ZTgzM2JjYzU3ZjgwYmI2YjYzNTlhZjU0MQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NWI1ZjdjNDc3NTQ5NDJlNWIyNTJiNDE2YzExNGE0YzE2ZGMwNTg5ZA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MTAwNzJkOGM0YmFmZmFjNzY2ZDk5YWVhMmZkZTkwMzgxYjcwNDlhZTYzNzU0
|
10
|
+
YmFhZWZiNWVkOGUwZDI5MTdjOTIzY2IyY2EwMTc3ZDc0Y2EzNDZlOGUzMTZh
|
11
|
+
Y2YxYTJkY2Q0NjdjOGZmMTBiODBlOWU4Y2JiNGU2YzdiZjMzMWM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YmY0NWZjZjI3YjZhMDJlMjU4OTMwZjA5MTZiZWQwYmJjNzk5NjdlZWJmMmZh
|
14
|
+
ODU3YTc2MDU5N2UwMGNiMWM3Y2MzMGRhMDdlNzQ3ZjZiMDhjMDhhNGM1OWY0
|
15
|
+
MzU5NTk3ZmNmMTBmMWE0MmIzMzg0MDE1ZDQ5MzY5YmNjMjU0YzY=
|
data/.gitignore
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
Gemfile.lock
|
2
|
+
health-graph-*.gem
|
3
|
+
# rcov generated
|
4
|
+
coverage
|
5
|
+
|
6
|
+
# rdoc generated
|
7
|
+
rdoc
|
8
|
+
|
9
|
+
# yard generated
|
10
|
+
doc
|
11
|
+
.yardoc
|
12
|
+
|
13
|
+
# bundler
|
14
|
+
.bundle
|
15
|
+
|
16
|
+
# jeweler generated
|
17
|
+
pkg
|
18
|
+
|
19
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
20
|
+
#
|
21
|
+
# * Create a file at ~/.gitignore
|
22
|
+
# * Include files you want ignored
|
23
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
24
|
+
#
|
25
|
+
# After doing this, these files will be ignored in all your git projects,
|
26
|
+
# saving you from having to 'pollute' every project you touch with them
|
27
|
+
#
|
28
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
29
|
+
#
|
30
|
+
# For MacOS:
|
31
|
+
#
|
32
|
+
#.DS_Store
|
33
|
+
|
34
|
+
# For TextMate
|
35
|
+
#*.tmproj
|
36
|
+
#tmtags
|
37
|
+
|
38
|
+
# For emacs:
|
39
|
+
#*~
|
40
|
+
#\#*
|
41
|
+
#.\#*
|
42
|
+
|
43
|
+
# For vim:
|
44
|
+
#*.swp
|
45
|
+
|
46
|
+
# For redcar:
|
47
|
+
#.redcar
|
48
|
+
|
49
|
+
# For rubinius:
|
50
|
+
#*.rbc
|
data/Rakefile
CHANGED
@@ -1,42 +1,6 @@
|
|
1
|
-
|
1
|
+
require "bundler/gem_tasks"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "health_graph"
|
8
|
-
gem.homepage = "http://github.com/kennyma/health_graph"
|
9
|
-
gem.license = "MIT"
|
10
|
-
gem.summary = "Ruby gem for RunKeeper Health Graph API"
|
11
|
-
gem.description = "This is a wrapper for RunKeeper Health Graph RESTful API."
|
12
|
-
gem.email = "kenny@kennyma.me"
|
13
|
-
gem.authors = ["Kenny Ma"]
|
14
|
-
|
15
|
-
gem.add_dependency "oauth2", ">= 0.5.2"
|
16
|
-
gem.add_dependency "faraday", ">= 0.7.4"
|
17
|
-
gem.add_dependency "faraday_middleware", ">= 0.7.8"
|
18
|
-
gem.add_dependency "hashie", ">= 1.2"
|
19
|
-
gem.add_dependency "webmock", ">= 1.7.6"
|
20
|
-
|
21
|
-
gem.add_development_dependency "shoulda"
|
22
|
-
gem.add_development_dependency "simplecov"
|
23
|
-
gem.add_development_dependency "jeweler"
|
24
|
-
end
|
25
|
-
Jeweler::RubygemsDotOrgTasks.new
|
26
|
-
|
27
|
-
require 'rake/testtask'
|
28
|
-
Rake::TestTask.new(:test) do |test|
|
29
|
-
test.libs << 'lib' << 'test'
|
30
|
-
test.pattern = 'test/**/test_*.rb'
|
31
|
-
test.verbose = true
|
32
|
-
end
|
33
|
-
|
34
|
-
require 'rdoc/task'
|
35
|
-
Rake::RDocTask.new do |rdoc|
|
36
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
37
|
-
|
38
|
-
rdoc.rdoc_dir = 'rdoc'
|
39
|
-
rdoc.title = "health_graph #{version}"
|
40
|
-
rdoc.rdoc_files.include('README*')
|
41
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
3
|
+
desc "Run all tests"
|
4
|
+
task :test do
|
5
|
+
ruby("test/test_health_graph.rb")
|
42
6
|
end
|
data/health_graph.gemspec
CHANGED
@@ -3,140 +3,33 @@
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "health_graph"
|
8
|
+
spec.version = "0.7.0"
|
9
|
+
spec.authors = ["Kenny Ma"]
|
10
|
+
spec.email = "kenny@kennyma.me"
|
11
|
+
spec.date = "2012-07-17"
|
12
|
+
spec.description = "This is a wrapper for RunKeeper Health Graph RESTful API."
|
13
|
+
spec.summary = "Ruby gem for RunKeeper Health Graph API"
|
14
|
+
spec.homepage = "http://github.com/kennyma/health_graph"
|
15
|
+
spec.licenses = ["MIT"]
|
9
16
|
|
10
|
-
|
11
|
-
s.authors = ["Kenny Ma"]
|
12
|
-
s.date = "2012-07-17"
|
13
|
-
s.description = "This is a wrapper for RunKeeper Health Graph RESTful API."
|
14
|
-
s.email = "kenny@kennyma.me"
|
15
|
-
s.extra_rdoc_files = [
|
17
|
+
spec.extra_rdoc_files = [
|
16
18
|
"LICENSE.txt",
|
17
19
|
"README.rdoc"
|
18
20
|
]
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
"README.rdoc",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"health_graph.gemspec",
|
27
|
-
"lib/health_graph.rb",
|
28
|
-
"lib/health_graph/api.rb",
|
29
|
-
"lib/health_graph/authentication.rb",
|
30
|
-
"lib/health_graph/configuration.rb",
|
31
|
-
"lib/health_graph/model.rb",
|
32
|
-
"lib/health_graph/models/fitness_activities_feed.rb",
|
33
|
-
"lib/health_graph/models/fitness_activity_delete.rb",
|
34
|
-
"lib/health_graph/models/fitness_activity_update.rb",
|
35
|
-
"lib/health_graph/models/new_fitness_activity.rb",
|
36
|
-
"lib/health_graph/models/profile.rb",
|
37
|
-
"lib/health_graph/models/settings.rb",
|
38
|
-
"lib/health_graph/models/sleep_feed.rb",
|
39
|
-
"lib/health_graph/models/strength_training_activities_feed.rb",
|
40
|
-
"lib/health_graph/models/strength_training_activity.rb",
|
41
|
-
"lib/health_graph/models/user.rb",
|
42
|
-
"lib/health_graph/models/weight_feed.rb",
|
43
|
-
"test/fixtures/background_activities_feed.json",
|
44
|
-
"test/fixtures/background_activity.json",
|
45
|
-
"test/fixtures/fitness_activities_feed.json",
|
46
|
-
"test/fixtures/fitness_activity.json",
|
47
|
-
"test/fixtures/new_fitness_activity_params.json",
|
48
|
-
"test/fixtures/profile_get.json",
|
49
|
-
"test/fixtures/records.json",
|
50
|
-
"test/fixtures/sleep_feed_get.json",
|
51
|
-
"test/fixtures/team_get_empty.json",
|
52
|
-
"test/fixtures/user_get.json",
|
53
|
-
"test/fixtures/weight_feed_get.json",
|
54
|
-
"test/fixtures/weight_get_empty.json",
|
55
|
-
"test/health_graph/test_fitness_activities_feed.rb",
|
56
|
-
"test/health_graph/test_new_fitness_activity.rb",
|
57
|
-
"test/health_graph/test_profile.rb",
|
58
|
-
"test/health_graph/test_sleep_feed.rb",
|
59
|
-
"test/health_graph/test_user.rb",
|
60
|
-
"test/health_graph/test_weight_feed.rb",
|
61
|
-
"test/helper.rb",
|
62
|
-
"test/test_health_graph.rb"
|
63
|
-
]
|
64
|
-
s.homepage = "http://github.com/kennyma/health_graph"
|
65
|
-
s.licenses = ["MIT"]
|
66
|
-
s.require_paths = ["lib"]
|
67
|
-
s.rubygems_version = "1.8.13"
|
68
|
-
s.summary = "Ruby gem for RunKeeper Health Graph API"
|
21
|
+
spec.files = `git ls-files`.split($/)
|
22
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
23
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
24
|
+
spec.require_paths = ["lib"]
|
69
25
|
|
70
|
-
|
71
|
-
|
26
|
+
spec.add_dependency "oauth2", ">= 0.5.2"
|
27
|
+
spec.add_dependency "faraday", ">= 0.7.4"
|
28
|
+
spec.add_dependency "faraday_middleware", ">= 0.7.8"
|
29
|
+
spec.add_dependency "hashie", ">= 1.2"
|
30
|
+
spec.add_dependency "webmock", ">= 1.7.6"
|
72
31
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
77
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
78
|
-
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
79
|
-
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
80
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
81
|
-
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
82
|
-
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
83
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
84
|
-
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
85
|
-
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
86
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
87
|
-
s.add_runtime_dependency(%q<oauth2>, [">= 0.5.2"])
|
88
|
-
s.add_runtime_dependency(%q<faraday>, [">= 0.7.4"])
|
89
|
-
s.add_runtime_dependency(%q<faraday_middleware>, [">= 0.7.8"])
|
90
|
-
s.add_runtime_dependency(%q<hashie>, [">= 1.2"])
|
91
|
-
s.add_runtime_dependency(%q<webmock>, [">= 1.7.6"])
|
92
|
-
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
93
|
-
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
94
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
95
|
-
else
|
96
|
-
s.add_dependency(%q<health_graph>, [">= 0"])
|
97
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
98
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
99
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
100
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
101
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
102
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
103
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
104
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
105
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
106
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
107
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
108
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
109
|
-
s.add_dependency(%q<oauth2>, [">= 0.5.2"])
|
110
|
-
s.add_dependency(%q<faraday>, [">= 0.7.4"])
|
111
|
-
s.add_dependency(%q<faraday_middleware>, [">= 0.7.8"])
|
112
|
-
s.add_dependency(%q<hashie>, [">= 1.2"])
|
113
|
-
s.add_dependency(%q<webmock>, [">= 1.7.6"])
|
114
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
115
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
116
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
117
|
-
end
|
118
|
-
else
|
119
|
-
s.add_dependency(%q<health_graph>, [">= 0"])
|
120
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
121
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
122
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
123
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
124
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
125
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
126
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
127
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
128
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
129
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
130
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
131
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
132
|
-
s.add_dependency(%q<oauth2>, [">= 0.5.2"])
|
133
|
-
s.add_dependency(%q<faraday>, [">= 0.7.4"])
|
134
|
-
s.add_dependency(%q<faraday_middleware>, [">= 0.7.8"])
|
135
|
-
s.add_dependency(%q<hashie>, [">= 1.2"])
|
136
|
-
s.add_dependency(%q<webmock>, [">= 1.7.6"])
|
137
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
138
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
139
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
140
|
-
end
|
32
|
+
spec.add_development_dependency "shoulda"
|
33
|
+
spec.add_development_dependency "simplecov"
|
34
|
+
spec.add_development_dependency "pry"
|
141
35
|
end
|
142
|
-
|
data/test/helper.rb
CHANGED
@@ -11,14 +11,14 @@ require 'health_graph'
|
|
11
11
|
|
12
12
|
class Test::Unit::TestCase
|
13
13
|
TEST_USER_TOKEN = "b9aaf2581480432a939a72f894bf".freeze
|
14
|
-
|
14
|
+
|
15
15
|
def fixture(file)
|
16
16
|
path = File.expand_path("../fixtures", __FILE__)
|
17
17
|
File.new(path + '/' + file)
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def json_fixture(file)
|
21
21
|
file = fixture(file)
|
22
|
-
JSON.load(file)
|
22
|
+
JSON.load(file)
|
23
23
|
end
|
24
24
|
end
|
data/test/test_health_graph.rb
CHANGED
@@ -1,102 +1,102 @@
|
|
1
|
-
|
1
|
+
require_relative 'helper'
|
2
2
|
|
3
3
|
class TestHealthGraph < Test::Unit::TestCase
|
4
|
-
context "Health Graph" do
|
5
|
-
setup do
|
4
|
+
context "Health Graph" do
|
5
|
+
setup do
|
6
6
|
HealthGraph.reset
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
should "get default client id" do
|
10
10
|
assert_equal nil, HealthGraph.client_id
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
should "set client id" do
|
14
14
|
client_id = "123456asdb"
|
15
15
|
HealthGraph.client_id = client_id
|
16
16
|
assert_equal client_id, HealthGraph.client_id
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
should "get default client secret" do
|
20
20
|
assert_equal nil, HealthGraph.client_secret
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
should "set client secret" do
|
24
24
|
secret = "supersecret"
|
25
25
|
HealthGraph.client_secret = secret
|
26
26
|
assert_equal secret, HealthGraph.client_secret
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
should "get default authorization url" do
|
30
30
|
assert_equal "https://runkeeper.com/apps/authorize", HealthGraph.authorization_url
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
should "set authorization url" do
|
34
34
|
url = "http://somesite.com/apps/authorize"
|
35
35
|
HealthGraph.authorization_url = url
|
36
36
|
assert_equal url, HealthGraph.authorization_url
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
should "get default access token url" do
|
40
40
|
assert_equal "https://runkeeper.com/apps/token", HealthGraph.access_token_url
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
should "set access token url" do
|
44
44
|
url = "http://somesite.com/apps/token"
|
45
45
|
HealthGraph.access_token_url = url
|
46
46
|
assert_equal url, HealthGraph.access_token_url
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
should "get default authorization redirect url" do
|
50
50
|
assert_equal nil, HealthGraph.authorization_redirect_url
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
should "set authorization redirect url" do
|
54
54
|
url = "http://somesite.com/runkeeper"
|
55
55
|
HealthGraph.authorization_redirect_url = url
|
56
56
|
assert_equal url, HealthGraph.authorization_redirect_url
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
should "get default api endpoint" do
|
60
60
|
assert_equal "https://api.runkeeper.com", HealthGraph.endpoint
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
63
|
should "set api endpoont" do
|
64
64
|
new_endpoint = "https://api.somesite.com"
|
65
65
|
HealthGraph.endpoint = new_endpoint
|
66
|
-
assert_equal new_endpoint, HealthGraph.endpoint
|
67
|
-
end
|
68
|
-
|
66
|
+
assert_equal new_endpoint, HealthGraph.endpoint
|
67
|
+
end
|
68
|
+
|
69
69
|
should "get default adapter" do
|
70
70
|
assert_equal :net_http, HealthGraph.adapter
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
should "set adapter" do
|
74
74
|
adapter = :typhoeus
|
75
75
|
HealthGraph.adapter = adapter
|
76
76
|
assert_equal adapter, HealthGraph.adapter
|
77
77
|
end
|
78
|
-
|
78
|
+
|
79
79
|
should "get default faraday options" do
|
80
80
|
assert HealthGraph.faraday_options.empty?, "Expected empty hash but got #{HealthGraph.faraday_options.inspect}"
|
81
81
|
end
|
82
|
-
|
82
|
+
|
83
83
|
should "set faraday options" do
|
84
84
|
options = {:new_option => "testing option", :another => "another option"}
|
85
85
|
HealthGraph.faraday_options = options
|
86
86
|
assert_equal options, HealthGraph.faraday_options
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
should "get default accept headers" do
|
90
90
|
options = {
|
91
91
|
:user => "application/vnd.com.runkeeper.User+json",
|
92
92
|
:fitness_activity_feed => "application/vnd.com.runkeeper.FitnessActivityFeed+json",
|
93
93
|
:fitness_activity => "application/vnd.com.runkeeper.FitnessActivity+json",
|
94
|
-
:new_fitness_activity => "application/vnd.com.runkeeper.NewFitnessActivity+json",
|
94
|
+
:new_fitness_activity => "application/vnd.com.runkeeper.NewFitnessActivity+json",
|
95
95
|
:strength_training_activity_feed => "application/vnd.com.runkeeper.StrengthTrainingActivityFeed+json",
|
96
|
-
:strength_training_activity => "application/vnd.com.runkeeper.StrengthTrainingActivity+json",
|
96
|
+
:strength_training_activity => "application/vnd.com.runkeeper.StrengthTrainingActivity+json",
|
97
97
|
:background_activity_feed => "application/vnd.com.runkeeper.BackgroundActivityFeed+json",
|
98
98
|
:background_activity => "application/vnd.com.runkeeper.BackgroundActivity+json",
|
99
|
-
:sleep_feed => "application/vnd.com.runkeeper.SleepFeed+json",
|
99
|
+
:sleep_feed => "application/vnd.com.runkeeper.SleepFeed+json",
|
100
100
|
:sleep => "application/vnd.com.runkeeper.Sleep+json",
|
101
101
|
:nutrition_feed => "application/vnd.com.runkeeper.NutritionFeed+json",
|
102
102
|
:nutrition => "application/vnd.com.runkeeper.Nutrition+json",
|
@@ -105,33 +105,34 @@ class TestHealthGraph < Test::Unit::TestCase
|
|
105
105
|
:general_measurement_feed => "application/vnd.com.runkeeper.GeneralMeasurementFeed+json",
|
106
106
|
:general_measurement => "application/vnd.com.runkeeper.GeneralMeasurement+json",
|
107
107
|
:diabetes_feed => "application/vnd.com.runkeeper.DiabetesFeed+json",
|
108
|
-
:diatetes_measurement => "application/vnd.com.runkeeper.DiabetesMeasurement+json",
|
108
|
+
:diatetes_measurement => "application/vnd.com.runkeeper.DiabetesMeasurement+json",
|
109
109
|
:records => "application/vnd.com.runkeeper.Records+json",
|
110
|
-
:profile => "application/vnd.com.runkeeper.Profile+json"
|
110
|
+
:profile => "application/vnd.com.runkeeper.Profile+json",
|
111
|
+
:settings=>"application/vnd.com.runkeeper.Settings+json"
|
111
112
|
}
|
112
|
-
|
113
|
+
|
113
114
|
assert_equal options, HealthGraph.accept_headers
|
114
|
-
end
|
115
|
-
|
115
|
+
end
|
116
|
+
|
116
117
|
should "set accept headers" do
|
117
118
|
options = {
|
118
119
|
:user => "application/vnd.com.runkeeper.User+json",
|
119
|
-
:fitness_activity_feed => "application/vnd.com.runkeeper.FitnessActivityFeed+json",
|
120
|
+
:fitness_activity_feed => "application/vnd.com.runkeeper.FitnessActivityFeed+json",
|
120
121
|
}
|
121
|
-
|
122
|
+
|
122
123
|
HealthGraph.accept_headers = options
|
123
124
|
assert_equal options, HealthGraph.accept_headers
|
124
125
|
end
|
125
|
-
|
126
|
-
context "configure" do
|
126
|
+
|
127
|
+
context "configure" do
|
127
128
|
HealthGraph::Configuration::VALID_OPTIONS_KEYS.each do |k|
|
128
129
|
should "set #{k}" do
|
129
130
|
HealthGraph.configure do |config|
|
130
|
-
config.send("#{k}=", k)
|
131
|
+
config.send("#{k}=", k)
|
131
132
|
end
|
132
133
|
assert_equal k, HealthGraph.send(k)
|
133
134
|
end
|
134
|
-
end
|
135
|
+
end
|
135
136
|
end
|
136
137
|
end
|
137
138
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: health_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.7.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kenny Ma
|
@@ -12,236 +11,117 @@ cert_chain: []
|
|
12
11
|
date: 2012-07-17 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement:
|
17
|
-
none: false
|
14
|
+
name: oauth2
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 0.5.2
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: shoulda
|
27
|
-
requirement: &70188456321220 !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
29
23
|
requirements:
|
30
24
|
- - ! '>='
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
33
|
-
type: :development
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: *70188456321220
|
26
|
+
version: 0.5.2
|
36
27
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement:
|
39
|
-
none: false
|
28
|
+
name: faraday
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
40
30
|
requirements:
|
41
31
|
- - ! '>='
|
42
32
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
44
|
-
type: :
|
33
|
+
version: 0.7.4
|
34
|
+
type: :runtime
|
45
35
|
prerelease: false
|
46
|
-
version_requirements:
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: jeweler
|
49
|
-
requirement: &70188456320200 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - ! '>='
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: *70188456320200
|
40
|
+
version: 0.7.4
|
58
41
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
60
|
-
requirement:
|
61
|
-
none: false
|
42
|
+
name: faraday_middleware
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
62
44
|
requirements:
|
63
45
|
- - ! '>='
|
64
46
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
66
|
-
type: :
|
47
|
+
version: 0.7.8
|
48
|
+
type: :runtime
|
67
49
|
prerelease: false
|
68
|
-
version_requirements:
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: simplecov
|
71
|
-
requirement: &70188456319180 !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
51
|
requirements:
|
74
52
|
- - ! '>='
|
75
53
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: *70188456319180
|
54
|
+
version: 0.7.8
|
80
55
|
- !ruby/object:Gem::Dependency
|
81
|
-
name:
|
82
|
-
requirement:
|
83
|
-
none: false
|
56
|
+
name: hashie
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
84
58
|
requirements:
|
85
59
|
- - ! '>='
|
86
60
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
88
|
-
type: :
|
61
|
+
version: '1.2'
|
62
|
+
type: :runtime
|
89
63
|
prerelease: false
|
90
|
-
version_requirements:
|
91
|
-
- !ruby/object:Gem::Dependency
|
92
|
-
name: shoulda
|
93
|
-
requirement: &70188456317920 !ruby/object:Gem::Requirement
|
94
|
-
none: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
65
|
requirements:
|
96
66
|
- - ! '>='
|
97
67
|
- !ruby/object:Gem::Version
|
98
|
-
version: '
|
99
|
-
type: :development
|
100
|
-
prerelease: false
|
101
|
-
version_requirements: *70188456317920
|
68
|
+
version: '1.2'
|
102
69
|
- !ruby/object:Gem::Dependency
|
103
|
-
name:
|
104
|
-
requirement:
|
105
|
-
none: false
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
106
72
|
requirements:
|
107
73
|
- - ! '>='
|
108
74
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
110
|
-
type: :
|
75
|
+
version: 1.7.6
|
76
|
+
type: :runtime
|
111
77
|
prerelease: false
|
112
|
-
version_requirements:
|
113
|
-
- !ruby/object:Gem::Dependency
|
114
|
-
name: jeweler
|
115
|
-
requirement: &70188456309880 !ruby/object:Gem::Requirement
|
116
|
-
none: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
117
79
|
requirements:
|
118
80
|
- - ! '>='
|
119
81
|
- !ruby/object:Gem::Version
|
120
|
-
version:
|
121
|
-
type: :development
|
122
|
-
prerelease: false
|
123
|
-
version_requirements: *70188456309880
|
82
|
+
version: 1.7.6
|
124
83
|
- !ruby/object:Gem::Dependency
|
125
84
|
name: shoulda
|
126
|
-
requirement:
|
127
|
-
none: false
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
128
86
|
requirements:
|
129
87
|
- - ! '>='
|
130
88
|
- !ruby/object:Gem::Version
|
131
89
|
version: '0'
|
132
90
|
type: :development
|
133
91
|
prerelease: false
|
134
|
-
version_requirements:
|
135
|
-
- !ruby/object:Gem::Dependency
|
136
|
-
name: simplecov
|
137
|
-
requirement: &70188456308440 !ruby/object:Gem::Requirement
|
138
|
-
none: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
93
|
requirements:
|
140
94
|
- - ! '>='
|
141
95
|
- !ruby/object:Gem::Version
|
142
96
|
version: '0'
|
143
|
-
type: :development
|
144
|
-
prerelease: false
|
145
|
-
version_requirements: *70188456308440
|
146
97
|
- !ruby/object:Gem::Dependency
|
147
|
-
name:
|
148
|
-
requirement:
|
149
|
-
none: false
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
150
100
|
requirements:
|
151
101
|
- - ! '>='
|
152
102
|
- !ruby/object:Gem::Version
|
153
103
|
version: '0'
|
154
104
|
type: :development
|
155
105
|
prerelease: false
|
156
|
-
version_requirements:
|
157
|
-
- !ruby/object:Gem::Dependency
|
158
|
-
name: oauth2
|
159
|
-
requirement: &70188456306260 !ruby/object:Gem::Requirement
|
160
|
-
none: false
|
161
|
-
requirements:
|
162
|
-
- - ! '>='
|
163
|
-
- !ruby/object:Gem::Version
|
164
|
-
version: 0.5.2
|
165
|
-
type: :runtime
|
166
|
-
prerelease: false
|
167
|
-
version_requirements: *70188456306260
|
168
|
-
- !ruby/object:Gem::Dependency
|
169
|
-
name: faraday
|
170
|
-
requirement: &70188456304780 !ruby/object:Gem::Requirement
|
171
|
-
none: false
|
172
|
-
requirements:
|
173
|
-
- - ! '>='
|
174
|
-
- !ruby/object:Gem::Version
|
175
|
-
version: 0.7.4
|
176
|
-
type: :runtime
|
177
|
-
prerelease: false
|
178
|
-
version_requirements: *70188456304780
|
179
|
-
- !ruby/object:Gem::Dependency
|
180
|
-
name: faraday_middleware
|
181
|
-
requirement: &70188456303740 !ruby/object:Gem::Requirement
|
182
|
-
none: false
|
183
|
-
requirements:
|
184
|
-
- - ! '>='
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: 0.7.8
|
187
|
-
type: :runtime
|
188
|
-
prerelease: false
|
189
|
-
version_requirements: *70188456303740
|
190
|
-
- !ruby/object:Gem::Dependency
|
191
|
-
name: hashie
|
192
|
-
requirement: &70188456302680 !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
|
-
requirements:
|
195
|
-
- - ! '>='
|
196
|
-
- !ruby/object:Gem::Version
|
197
|
-
version: '1.2'
|
198
|
-
type: :runtime
|
199
|
-
prerelease: false
|
200
|
-
version_requirements: *70188456302680
|
201
|
-
- !ruby/object:Gem::Dependency
|
202
|
-
name: webmock
|
203
|
-
requirement: &70188456301980 !ruby/object:Gem::Requirement
|
204
|
-
none: false
|
205
|
-
requirements:
|
206
|
-
- - ! '>='
|
207
|
-
- !ruby/object:Gem::Version
|
208
|
-
version: 1.7.6
|
209
|
-
type: :runtime
|
210
|
-
prerelease: false
|
211
|
-
version_requirements: *70188456301980
|
212
|
-
- !ruby/object:Gem::Dependency
|
213
|
-
name: shoulda
|
214
|
-
requirement: &70188456301360 !ruby/object:Gem::Requirement
|
215
|
-
none: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
216
107
|
requirements:
|
217
108
|
- - ! '>='
|
218
109
|
- !ruby/object:Gem::Version
|
219
110
|
version: '0'
|
220
|
-
type: :development
|
221
|
-
prerelease: false
|
222
|
-
version_requirements: *70188456301360
|
223
111
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
225
|
-
requirement:
|
226
|
-
none: false
|
112
|
+
name: pry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
227
114
|
requirements:
|
228
115
|
- - ! '>='
|
229
116
|
- !ruby/object:Gem::Version
|
230
117
|
version: '0'
|
231
118
|
type: :development
|
232
119
|
prerelease: false
|
233
|
-
version_requirements:
|
234
|
-
- !ruby/object:Gem::Dependency
|
235
|
-
name: jeweler
|
236
|
-
requirement: &70188456299740 !ruby/object:Gem::Requirement
|
237
|
-
none: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
238
121
|
requirements:
|
239
122
|
- - ! '>='
|
240
123
|
- !ruby/object:Gem::Version
|
241
124
|
version: '0'
|
242
|
-
type: :development
|
243
|
-
prerelease: false
|
244
|
-
version_requirements: *70188456299740
|
245
125
|
description: This is a wrapper for RunKeeper Health Graph RESTful API.
|
246
126
|
email: kenny@kennyma.me
|
247
127
|
executables: []
|
@@ -251,6 +131,7 @@ extra_rdoc_files:
|
|
251
131
|
- README.rdoc
|
252
132
|
files:
|
253
133
|
- .document
|
134
|
+
- .gitignore
|
254
135
|
- Gemfile
|
255
136
|
- LICENSE.txt
|
256
137
|
- README.rdoc
|
@@ -296,26 +177,45 @@ files:
|
|
296
177
|
homepage: http://github.com/kennyma/health_graph
|
297
178
|
licenses:
|
298
179
|
- MIT
|
180
|
+
metadata: {}
|
299
181
|
post_install_message:
|
300
182
|
rdoc_options: []
|
301
183
|
require_paths:
|
302
184
|
- lib
|
303
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
304
|
-
none: false
|
305
186
|
requirements:
|
306
187
|
- - ! '>='
|
307
188
|
- !ruby/object:Gem::Version
|
308
189
|
version: '0'
|
309
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
310
|
-
none: false
|
311
191
|
requirements:
|
312
192
|
- - ! '>='
|
313
193
|
- !ruby/object:Gem::Version
|
314
194
|
version: '0'
|
315
195
|
requirements: []
|
316
196
|
rubyforge_project:
|
317
|
-
rubygems_version:
|
197
|
+
rubygems_version: 2.4.8
|
318
198
|
signing_key:
|
319
|
-
specification_version:
|
199
|
+
specification_version: 4
|
320
200
|
summary: Ruby gem for RunKeeper Health Graph API
|
321
|
-
test_files:
|
201
|
+
test_files:
|
202
|
+
- test/fixtures/background_activities_feed.json
|
203
|
+
- test/fixtures/background_activity.json
|
204
|
+
- test/fixtures/fitness_activities_feed.json
|
205
|
+
- test/fixtures/fitness_activity.json
|
206
|
+
- test/fixtures/new_fitness_activity_params.json
|
207
|
+
- test/fixtures/profile_get.json
|
208
|
+
- test/fixtures/records.json
|
209
|
+
- test/fixtures/sleep_feed_get.json
|
210
|
+
- test/fixtures/team_get_empty.json
|
211
|
+
- test/fixtures/user_get.json
|
212
|
+
- test/fixtures/weight_feed_get.json
|
213
|
+
- test/fixtures/weight_get_empty.json
|
214
|
+
- test/health_graph/test_fitness_activities_feed.rb
|
215
|
+
- test/health_graph/test_new_fitness_activity.rb
|
216
|
+
- test/health_graph/test_profile.rb
|
217
|
+
- test/health_graph/test_sleep_feed.rb
|
218
|
+
- test/health_graph/test_user.rb
|
219
|
+
- test/health_graph/test_weight_feed.rb
|
220
|
+
- test/helper.rb
|
221
|
+
- test/test_health_graph.rb
|