cashrb 1.0.1 → 1.0.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ cashrb v1.0.2
2
+ =============
3
+ - fix error with scope for ruby 1.8.7
4
+ - require 'rubygems' in tests
5
+
1
6
  cashrb v1.0.1
2
7
  =============
3
8
  - revert to hashrocket syntax for compatibility with rubies prior to 1.9.2
data/cashrb.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cashrb"
3
- s.version = "1.0.1"
3
+ s.version = "1.0.2"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ["Shane Emmons"]
6
6
  s.email = ["semmons99@gmail.com"]
data/lib/cash/cash.rb CHANGED
@@ -105,6 +105,17 @@ class Cash
105
105
  self.to_s.to_f
106
106
  end
107
107
 
108
+ CURRENCY_AWARE_METHODS.each do |mth|
109
+ old_mth = :"old_#{mth}"
110
+ alias_method old_mth, mth
111
+ private(old_mth)
112
+
113
+ define_method(mth) do |value|
114
+ reject_incompatible_currency(value)
115
+ send(old_mth, value)
116
+ end
117
+ end
118
+
108
119
  private
109
120
 
110
121
  def bd(val)
@@ -145,15 +156,4 @@ class Cash
145
156
  rescue NoMethodError
146
157
  end
147
158
 
148
- CURRENCY_AWARE_METHODS.each do |mth|
149
- old_mth = :"old_#{mth}"
150
- alias_method old_mth, mth
151
- private(old_mth)
152
-
153
- define_method(mth) do |value|
154
- reject_incompatible_currency(value)
155
- send(old_mth, value)
156
- end
157
- end
158
-
159
159
  end