measurement 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.2.5 Fix - accepts units when uppercased
2
+
1
3
  v0.2.4 Suggested units for parsing
2
4
 
3
5
  v0.2.3.1 Fix for missing file
data/README.rdoc CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  (The MIT License)
22
22
 
23
- Copyright (c) 2009 Jeremy Wells
23
+ Copyright (c) 2010 Jeremy Wells
24
24
 
25
25
  Permission is hereby granted, free of charge, to any person obtaining
26
26
  a copy of this software and associated documentation files (the
data/lib/measurement.rb CHANGED
@@ -183,7 +183,7 @@ module Measurement
183
183
 
184
184
  while string =~ /(\d+(\.\d+)?)([^\d]*)/
185
185
  amount = $1.to_f
186
- unit = $3 && $3.strip
186
+ unit = $3 && $3.strip.downcase
187
187
 
188
188
  if unit && unit.length > 0
189
189
  unit = find_scale(unit)
data/measurement.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{measurement}
5
- s.version = "0.2.4"
5
+ s.version = "0.2.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jeremy Wells"]
9
- s.date = %q{2010-03-01}
9
+ s.date = %q{2010-08-24}
10
10
  s.description = %q{A library for holding, converting and formatting measurements}
11
11
  s.email = %q{jemmyw@gmail.com}
12
12
  s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "lib/measurement.rb", "lib/measurement/length.rb", "lib/measurement/unit.rb", "lib/measurement/unit_group.rb", "lib/measurement/weight.rb"]
@@ -15,14 +15,14 @@ Gem::Specification.new do |s|
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Measurement", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{measurement}
18
- s.rubygems_version = %q{1.3.5}
18
+ s.rubygems_version = %q{1.3.7}
19
19
  s.summary = %q{A library for holding, converting and formatting measurements}
20
20
 
21
21
  if s.respond_to? :specification_version then
22
22
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
23
  s.specification_version = 3
24
24
 
25
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
25
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
26
  else
27
27
  end
28
28
  else
@@ -68,6 +68,10 @@ describe Measurement::Base do
68
68
  Length.parse(%Q{5' 11"}).to_f.should == 1.8034
69
69
  end
70
70
 
71
+ it 'should be able to parse units in upper case' do
72
+ Length.parse('32CM').to_f.should == 0.32
73
+ end
74
+
71
75
  it 'should raise a NoScaleFoundException if there is no scale matching the one passed' do
72
76
  lambda do
73
77
  Length.parse('10giglygoops')
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: measurement
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 5
10
+ version: 0.2.5
5
11
  platform: ruby
6
12
  authors:
7
13
  - Jeremy Wells
@@ -9,7 +15,7 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-03-01 00:00:00 +13:00
18
+ date: 2010-08-24 00:00:00 +12:00
13
19
  default_executable:
14
20
  dependencies: []
15
21
 
@@ -61,21 +67,28 @@ rdoc_options:
61
67
  require_paths:
62
68
  - lib
63
69
  required_ruby_version: !ruby/object:Gem::Requirement
70
+ none: false
64
71
  requirements:
65
72
  - - ">="
66
73
  - !ruby/object:Gem::Version
74
+ hash: 3
75
+ segments:
76
+ - 0
67
77
  version: "0"
68
- version:
69
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
+ none: false
70
80
  requirements:
71
81
  - - ">="
72
82
  - !ruby/object:Gem::Version
83
+ hash: 11
84
+ segments:
85
+ - 1
86
+ - 2
73
87
  version: "1.2"
74
- version:
75
88
  requirements: []
76
89
 
77
90
  rubyforge_project: measurement
78
- rubygems_version: 1.3.5
91
+ rubygems_version: 1.3.7
79
92
  signing_key:
80
93
  specification_version: 3
81
94
  summary: A library for holding, converting and formatting measurements