joule 1.0.2 → 1.0.3
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/Rakefile +2 -2
- data/lib/joule.rb +3 -3
- data/lib/joule/csv.rb +5 -1
- data/lib/joule/srm.rb +6 -1
- data/lib/joule/tcx.rb +5 -1
- metadata +4 -4
data/Rakefile
CHANGED
@@ -20,8 +20,8 @@ spec = Gem::Specification.new do |s|
|
|
20
20
|
s.description = "Joule parses and does some basic analyzing of powermeter data. Supported formats include SRM(.srm), Saris PowerTap(.csv), iBike(.csv), and Garmin(.tcx)"
|
21
21
|
s.homepage = "http://github.com/anolson/joule"
|
22
22
|
|
23
|
-
s.version = "1.0.
|
24
|
-
s.date = "2010-9-
|
23
|
+
s.version = "1.0.3"
|
24
|
+
s.date = "2010-9-21"
|
25
25
|
|
26
26
|
s.authors = ["Andrew Olson"]
|
27
27
|
s.email = "anolson@gmail.com"
|
data/lib/joule.rb
CHANGED
@@ -19,11 +19,11 @@ require 'joule/tcx'
|
|
19
19
|
module Joule
|
20
20
|
|
21
21
|
def Joule.parser(extension, data)
|
22
|
-
if(
|
22
|
+
if(Joule::SRM::is_srm_file(extension))
|
23
23
|
Joule::SRM::Parser.new(data)
|
24
|
-
elsif(
|
24
|
+
elsif(Joule::TCX::is_tcx_file(extension))
|
25
25
|
Joule::TCX::Parser.new(data)
|
26
|
-
elsif(
|
26
|
+
elsif(Joule::CSV::is_csv_file(extension))
|
27
27
|
Joule::CSV.parser(extension, data)
|
28
28
|
else
|
29
29
|
raise UnsupportedFileTypeException
|
data/lib/joule/csv.rb
CHANGED
@@ -3,7 +3,11 @@ require 'joule/csv/parser'
|
|
3
3
|
|
4
4
|
module Joule
|
5
5
|
module CSV
|
6
|
-
FILE_EXTENSION = "csv"
|
6
|
+
FILE_EXTENSION = ".csv"
|
7
|
+
|
8
|
+
def CSV.is_csv_file(extension)
|
9
|
+
extension.eql?(FILE_EXTENSION)
|
10
|
+
end
|
7
11
|
|
8
12
|
def CSV.parser(extension, data)
|
9
13
|
header = FasterCSV.parse(data).shift
|
data/lib/joule/srm.rb
CHANGED
data/lib/joule/tcx.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: joule
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Olson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-21 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|