Skip to content

Instantly share code, notes, and snippets.

@karledurante
Created August 31, 2012 19:24
Show Gist options
  • Save karledurante/3557828 to your computer and use it in GitHub Desktop.
Save karledurante/3557828 to your computer and use it in GitHub Desktop.
gem management of rails version specific code
####
## 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