Created
August 31, 2012 19:24
-
-
Save karledurante/3557828 to your computer and use it in GitHub Desktop.
gem management of rails version specific code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### | |
## super_gem.rb | |
module SuperGem | |
require 'super_gem/rails/patches' | |
# super stuff you couldn't even imagine ... | |
end | |
#### | |
## super_gem/rails/patches.rb | |
case Rails.version.to_f | |
when 3.0 | |
if Rails.env.test? | |
require 'super_gem/test_stuff_3_0' | |
end | |
require 'super_gem/active_record_patch_3_0' | |
when 3.1 | |
if Rails.env.test? | |
require 'super_gem/test_stuff_3_1' | |
end | |
require 'super_gem/active_record_patch_3_1' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment