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 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.2"
24
- s.date = "2010-9-16"
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"
@@ -19,11 +19,11 @@ require 'joule/tcx'
19
19
  module Joule
20
20
 
21
21
  def Joule.parser(extension, data)
22
- if(extension.eql?(Joule::SRM::FILE_EXTENSION))
22
+ if(Joule::SRM::is_srm_file(extension))
23
23
  Joule::SRM::Parser.new(data)
24
- elsif(extension.eql?(Joule::TCX::FILE_EXTENSION))
24
+ elsif(Joule::TCX::is_tcx_file(extension))
25
25
  Joule::TCX::Parser.new(data)
26
- elsif(extension.eql?(Joule::CSV::FILE_EXTENSION))
26
+ elsif(Joule::CSV::is_csv_file(extension))
27
27
  Joule::CSV.parser(extension, data)
28
28
  else
29
29
  raise UnsupportedFileTypeException
@@ -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
@@ -3,6 +3,11 @@ require 'joule/srm/properties'
3
3
 
4
4
  module Joule
5
5
  module SRM
6
- FILE_EXTENSION = "srm"
6
+ FILE_EXTENSION = ".srm"
7
+
8
+ def SRM.is_srm_file(extension)
9
+ extension.eql?(FILE_EXTENSION)
10
+ end
11
+
7
12
  end
8
13
  end
@@ -3,6 +3,10 @@ require 'joule/tcx/properties'
3
3
 
4
4
  module Joule
5
5
  module TCX
6
- FILE_EXTENSION = "tcx"
6
+ FILE_EXTENSION = ".tcx"
7
+
8
+ def TCX.is_tcx_file(extension)
9
+ extension.eql?(FILE_EXTENSION)
10
+ end
7
11
  end
8
12
  end
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: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
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-16 00:00:00 -04:00
18
+ date: 2010-09-21 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency