nike_plus 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/nike_plus/activity.rb +2 -2
- data/lib/nike_plus/activity_summary.rb +0 -1
- data/lib/nike_plus/client.rb +2 -2
- data/lib/nike_plus/version.rb +1 -1
- metadata +3 -3
data/lib/nike_plus/activity.rb
CHANGED
@@ -83,7 +83,7 @@ module NikePlus
|
|
83
83
|
|
84
84
|
## Activity speed in kilometers per hour.
|
85
85
|
def kmh
|
86
|
-
values =
|
86
|
+
values = speed_values
|
87
87
|
return nil unless values and values.any?
|
88
88
|
|
89
89
|
avg = sum = 0.0
|
@@ -116,7 +116,7 @@ module NikePlus
|
|
116
116
|
sec = ( ( div - min ) * 60.0 )
|
117
117
|
"#{ sprintf("%.2d", min ) }:#{ sprintf("%.2d", sec ) }"
|
118
118
|
end
|
119
|
-
|
119
|
+
|
120
120
|
private
|
121
121
|
|
122
122
|
def speed_values
|
@@ -46,7 +46,6 @@ module NikePlus
|
|
46
46
|
# # Full details
|
47
47
|
# activity = nike.activity( summary.activityId ) # => NikePlus::Activity
|
48
48
|
# activity.geo.waypoints
|
49
|
-
# activity.geo.mph
|
50
49
|
#
|
51
50
|
# The fields above not gauranteed. For example, activities logged prior to the Nike+GPS app do not
|
52
51
|
# return GPS or tag data. It's a good idea to inspect the ActivitySummary object to determine exactly what data
|
data/lib/nike_plus/client.rb
CHANGED
@@ -34,11 +34,11 @@ module NikePlus
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
# Return an array of NikePlus::ActivitySummary objects. To
|
37
|
+
# Return an array of NikePlus::ActivitySummary objects. To retrieve full details on the activity use the #activity method.
|
38
38
|
#
|
39
39
|
# Example:
|
40
40
|
# activities = nike.activities # => [NikePlus::ActivitySummary, NikePlus::ActivitySummary]
|
41
|
-
# activity = nike.activity( activities[0]activityId ) # => NikePlus::Activity
|
41
|
+
# activity = nike.activity( activities[0].activityId ) # => NikePlus::Activity
|
42
42
|
def activities
|
43
43
|
url = "http://nikeplus.nike.com/plus/activity/running/#{ @screenname }/lifetime/activities?indexStart=0&indexEnd=9999"
|
44
44
|
data = get(url)
|
data/lib/nike_plus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nike_plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mechanize
|
@@ -155,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
segments:
|
157
157
|
- 0
|
158
|
-
hash:
|
158
|
+
hash: 4385234431983388357
|
159
159
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
160
|
none: false
|
161
161
|
requirements:
|