ruby-units 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -1
- data/lib/ruby-units.rb +9 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
data/lib/ruby-units.rb
CHANGED
@@ -1069,10 +1069,18 @@ class String
|
|
1069
1069
|
unit_format(*args)
|
1070
1070
|
end
|
1071
1071
|
end
|
1072
|
-
|
1072
|
+
|
1073
|
+
#needed for compatibility with Rails, which defines a String.from method
|
1074
|
+
if self.public_instance_methods.include? 'from'
|
1075
|
+
puts 'rails'
|
1076
|
+
alias :old_from :from
|
1077
|
+
end
|
1078
|
+
|
1073
1079
|
def from(time_point = ::Time.now)
|
1080
|
+
return old_from(time_point) if Integer === time_point
|
1074
1081
|
self.unit.from(time_point)
|
1075
1082
|
end
|
1083
|
+
|
1076
1084
|
alias :after :from
|
1077
1085
|
alias :from_now :from
|
1078
1086
|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ruby-units
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.
|
7
|
-
date: 2006-10-
|
6
|
+
version: 0.3.2
|
7
|
+
date: 2006-10-03 00:00:00 -04:00
|
8
8
|
summary: A model that performs unit conversions and unit math
|
9
9
|
require_paths:
|
10
10
|
- lib
|