fit4ruby 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -10
- data/fit4ruby.gemspec +4 -4
- data/lib/fit4ruby/Activity.rb +5 -0
- data/lib/fit4ruby/Converters.rb +1 -1
- data/lib/fit4ruby/Session.rb +1 -1
- data/lib/fit4ruby/version.rb +1 -1
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e5c32929d16d07a0fe95c04cd7699e56a8067a4
|
4
|
+
data.tar.gz: 2315ae4059cf64dc4cd7d0eeb02c6c42ec5cde26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66f5efa6875e7a10f79d304730a767c6bf0d330c3c4e0ce6adf297ff3ea8e440281c548f1064f0c42bf27891a001d70caf3a06980b8dfd7a15bc1536f36a78e6
|
7
|
+
data.tar.gz: 4cb6346d5f3bfee72c1f23f3d7c567612731824842896cf64302549f39e1b7285aca67a3e8298826befb3a7c54af66dd1309f3298cea2c184cbc3af1d9afe9e4
|
data/README.md
CHANGED
@@ -1,15 +1,27 @@
|
|
1
|
-
Fit4Ruby
|
2
|
-
========
|
1
|
+
# Fit4Ruby
|
3
2
|
|
4
|
-
Fit4Ruby is a Ruby libary to read and
|
5
|
-
|
3
|
+
Fit4Ruby is a [http://www.ruby-lang.org](Ruby) libary to read and
|
4
|
+
write FIT files.
|
6
5
|
|
7
6
|
This libary is still work in progress and probably not yet ready to be
|
8
7
|
used in your application. However, you are welcome to try it and send
|
9
|
-
me comments and patches.
|
8
|
+
me comments and patches. It was developed to form the back-end of
|
9
|
+
[https://github.com/scrapper/postrunner](PostRunner).
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
## Supported Devices
|
12
|
+
|
13
|
+
Tested devices: Garmin FR620
|
14
|
+
|
15
|
+
Other Garmin devices that generate FIT files may work as well. Since I
|
16
|
+
don't have any other devices, I can't add support for them.
|
17
|
+
|
18
|
+
##Supported Operating Systems
|
19
|
+
|
20
|
+
This library was developed and tested on Linux using Ruby 2.0 (MRI).
|
21
|
+
Other operating systems that are Supported by Ruby 2.0 may probably
|
22
|
+
work as well.
|
23
|
+
|
24
|
+
##Usage
|
13
25
|
|
14
26
|
You can create an Activity.
|
15
27
|
|
@@ -33,7 +45,7 @@ ts = Time.now
|
|
33
45
|
:position_lat => 51.5512 - mins * 0.0008,
|
34
46
|
:position_long => 11.647 + mins * 0.002,
|
35
47
|
:distance => 200.0 * mins,
|
36
|
-
:altitude => 100 + mins *
|
48
|
+
:altitude => 100 + mins * 2,
|
37
49
|
:speed => 3.1,
|
38
50
|
:vertical_oscillation => 9 + mins * 0.02,
|
39
51
|
:stance_time => 235.0 * mins * 0.01,
|
@@ -95,8 +107,7 @@ end
|
|
95
107
|
Please see lib/fit4ruby/GlobalFitMessages.rb for the data fields that
|
96
108
|
are supported for the various FIT record types.
|
97
109
|
|
98
|
-
License
|
99
|
-
-------
|
110
|
+
## License
|
100
111
|
|
101
112
|
See [COPYING](COPYING) file.
|
102
113
|
|
data/fit4ruby.gemspec
CHANGED
@@ -23,8 +23,8 @@ EOT
|
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
spec.required_ruby_version = '>=2.0'
|
25
25
|
|
26
|
-
spec.add_dependency('bindata', '
|
27
|
-
spec.add_development_dependency('yard')
|
28
|
-
spec.add_development_dependency('rake')
|
29
|
-
spec.add_development_dependency('bundler',
|
26
|
+
spec.add_dependency('bindata', '~>2.1.0')
|
27
|
+
spec.add_development_dependency('yard', '~>0.8.7')
|
28
|
+
spec.add_development_dependency('rake', '~>0.9.6')
|
29
|
+
spec.add_development_dependency('bundler', '~>1.6.4')
|
30
30
|
end
|
data/lib/fit4ruby/Activity.rb
CHANGED
@@ -115,6 +115,11 @@ module Fit4Ruby
|
|
115
115
|
nil
|
116
116
|
end
|
117
117
|
|
118
|
+
# Returns the sport type of this activity.
|
119
|
+
def sport
|
120
|
+
@sessions[0].sport
|
121
|
+
end
|
122
|
+
|
118
123
|
# Write the Activity data to a file.
|
119
124
|
# @param io [IO] File reference
|
120
125
|
# @param id_mapper [FitMessageIdMapper] Maps global FIT record types to
|
data/lib/fit4ruby/Converters.rb
CHANGED
@@ -19,7 +19,7 @@ module Fit4Ruby
|
|
19
19
|
'm' => { 'km' => 0.001, 'in' => 39.3701, 'ft' => 3.28084,
|
20
20
|
'mi' => 0.000621371 },
|
21
21
|
'mm' => { 'cm' => 0.1, 'in' => 0.0393701 },
|
22
|
-
'm/s' => { 'km/h' =>
|
22
|
+
'm/s' => { 'km/h' => 3.6, 'mph' => 2.23694 },
|
23
23
|
'min/km' => { 'min/mi' => 1.60934 },
|
24
24
|
'kg' => { 'lbs' => 0.453592 }
|
25
25
|
}
|
data/lib/fit4ruby/Session.rb
CHANGED
data/lib/fit4ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fit4ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Schlaeger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: yard
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.8.7
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.8.7
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.9.6
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.9.6
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.6.4
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.6.4
|
69
69
|
description: |
|