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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b1343b7cebb0656f6a7f59aa5b1eb067e684504
4
- data.tar.gz: c547627b2a01e6ed635cec1da6618f49e8bc5385
3
+ metadata.gz: 6e5c32929d16d07a0fe95c04cd7699e56a8067a4
4
+ data.tar.gz: 2315ae4059cf64dc4cd7d0eeb02c6c42ec5cde26
5
5
  SHA512:
6
- metadata.gz: cd337bb5e3d842f4720679ae934cd7c490f92c549569af97a14755e78f8275541faeec5bd44e3b2a858e3a4c647d7c747a54c2d4b2624afbd0e81fe6753cd1c4
7
- data.tar.gz: bc9a7c8f43d5f239a768df8f18ebbe1989c835ac5c460f68ca71ef7f35b2390b2756ffd8f954b3de805880ea3c58a17a4d7612c0399d3ac4d6bcdf3c38410ada
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 write FIT files. It is currently
5
- only tested with FIT files generated by the Garmin Forerunner 620.
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
- Usage
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 * 0.5,
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', '>=2.0.0')
27
- spec.add_development_dependency('yard')
28
- spec.add_development_dependency('rake')
29
- spec.add_development_dependency('bundler', ">=1.6.4")
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
@@ -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
@@ -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' => 0.277778 },
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
  }
@@ -22,7 +22,7 @@ module Fit4Ruby
22
22
 
23
23
  include RecordAggregator
24
24
 
25
- attr_reader :laps
25
+ attr_reader :laps, :records
26
26
 
27
27
  # Create a new Session object.
28
28
  # @param laps [Array of Laps] Laps to associate with the Session.
@@ -1,4 +1,4 @@
1
1
  module Fit4Ruby
2
2
  # The version number of the library.
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
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.3
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-08-29 00:00:00.000000000 Z
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.0.0
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.0.0
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: '0'
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: '0'
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: '0'
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: '0'
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: |