Permalink
Browse files

VersionFaker is too much of a hack :P

  • Loading branch information...
1 parent b3ef03d commit ba3ba5ae34ddc07d3532d41cbebb9b9dd35bf3f7 @wycats committed Aug 4, 2010
Showing with 0 additions and 46 deletions.
  1. +0 −46 rails_upgrade.rb
View
@@ -63,49 +63,3 @@ def self.config
Rails.application.config
end
-module Rails
- module VERSION
- class VersionFaker < ActiveSupport::BasicObject
- def initialize(real_value, pretend_value)
- @real_value, @pretend_value = real_value, pretend_value
- end
-
- def >=(other)
- @pretend_value >= other
- end
-
- def >(other)
- @pretend_value > other
- end
-
- def <=(other)
- @pretend_value <= other
- end
-
- def <(other)
- @pretend_value < other
- end
-
- def method_missing(meth, *args, &block)
- @real_value.send(meth, *args, &block)
- end
- end
-
- def self.with_version(full_version)
- new = full_version.split(".")
- old = [MAJOR, MINOR, TINY]
- class_eval "MAJOR, MINOR, TINY = #{new.inspect}"
- yield
- ensure
- class_eval "MAJOR, MINOR, TINY = #{old.inspect}"
- end
- end
-
- module Initializer
- def self.run(&block)
- klass = Class.new(Rails::Application)
- klass.instance_exec(klass.config, &block)
- klass.initialize!
- end
- end
-end

0 comments on commit ba3ba5a

Please sign in to comment.