eagletree-log 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eagletree/log/file.rb +7 -0
- data/lib/eagletree/log/version.rb +1 -1
- data/spec/file_spec.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a036c3511a4b3e414d436650b82f76f05a852b7
|
4
|
+
data.tar.gz: 3a201b1e5e70fedc2cd7ce5f1ffb355e81bf95de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cee67b7f0b9c2b0d6793b5a0e9e2ae455d69bf8a24c53a16676c0755e27d84ef5a952f5135a4ca6b941aeef283ff9e9faf047a85068bcdfd3c74ec4959bee30f
|
7
|
+
data.tar.gz: de845f34f3d0f0c9844eb77b0a2aaa5fd7adb7e6ad2b23e402912096934bfc2b80c20e0f4f6a8670678f9b321cec4b2fdd0e17acf56c8747d96159dd6ea1f9c1
|
data/lib/eagletree/log/file.rb
CHANGED
@@ -83,6 +83,13 @@ module EagleTree
|
|
83
83
|
raise ArgumentError, 'File does not appear to be an Eagle Tree log'
|
84
84
|
end
|
85
85
|
|
86
|
+
# Gets the total duration of all sessions contained within.
|
87
|
+
#
|
88
|
+
# @return [Float] total duration of all sessions, in seconds
|
89
|
+
def duration
|
90
|
+
@sessions.map(&:duration).reduce(&:+)
|
91
|
+
end
|
92
|
+
|
86
93
|
# Determines if KML methods can be called for this file.
|
87
94
|
#
|
88
95
|
# @return [Boolean] true if KML can be generated for this file, false otherwise
|
data/spec/file_spec.rb
CHANGED
@@ -24,6 +24,8 @@ describe EagleTree::Log::File do
|
|
24
24
|
|
25
25
|
it { should have(1).sessions }
|
26
26
|
|
27
|
+
its(:duration) { should be_within(0.1).of(732.3) }
|
28
|
+
|
27
29
|
its(:name) { should eql('FunJet') }
|
28
30
|
|
29
31
|
its(:hardware) { should eql('73') }
|
@@ -38,6 +40,8 @@ describe EagleTree::Log::File do
|
|
38
40
|
|
39
41
|
it { should have(3).sessions }
|
40
42
|
|
43
|
+
its(:duration) { should be_within(0.1).of(1149.3) }
|
44
|
+
|
41
45
|
its(:name) { should eql('Helis') }
|
42
46
|
|
43
47
|
its(:hardware) { should eql('73') }
|