eagletree-log 0.0.9 → 0.0.10

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b30c205ba0f3c817a8e6b39848bed09f8304806
4
- data.tar.gz: 36eaa9a4eaeaf635230e5877c4196506e1914822
3
+ metadata.gz: 4a036c3511a4b3e414d436650b82f76f05a852b7
4
+ data.tar.gz: 3a201b1e5e70fedc2cd7ce5f1ffb355e81bf95de
5
5
  SHA512:
6
- metadata.gz: c4b2637717d2d8fbc383f675a8e3410ece6f7a6324eebbfa5b60687efa0057885f6055b19fe690722834276ac2619e883fda8c4be1cf6df488e170b9ea4bc6eb
7
- data.tar.gz: 6f36ccffc2d8d86e5f5318ecdfa0074d58207014377ff10536e1c13fe2508478cdd10d42e6491f3b795f667752c1bb368d78884c5ac4945a1ba8726022dddef6
6
+ metadata.gz: cee67b7f0b9c2b0d6793b5a0e9e2ae455d69bf8a24c53a16676c0755e27d84ef5a952f5135a4ca6b941aeef283ff9e9faf047a85068bcdfd3c74ec4959bee30f
7
+ data.tar.gz: de845f34f3d0f0c9844eb77b0a2aaa5fd7adb7e6ad2b23e402912096934bfc2b80c20e0f4f6a8670678f9b321cec4b2fdd0e17acf56c8747d96159dd6ea1f9c1
@@ -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
@@ -1,5 +1,5 @@
1
1
  module EagleTree
2
2
  module Log
3
- VERSION = '0.0.9'
3
+ VERSION = '0.0.10'
4
4
  end
5
5
  end
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') }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eagletree-log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Veys