lib/hash_mapper.rb in ismasan-hash_mapper-0.0.7 vs lib/hash_mapper.rb in ismasan-hash_mapper-0.0.8
- old
+ new
@@ -1,13 +1,23 @@
$:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
+def require_active_support
+ require 'active_support/core_ext/array/extract_options'
+ require 'active_support/core_ext/hash/indifferent_access'
+ require 'active_support/core_ext/duplicable'
+ Array.send(:include, ActiveSupport::CoreExtensions::Array::ExtractOptions)
+ Hash.send(:include, ActiveSupport::CoreExtensions::Hash::IndifferentAccess)
+ require 'active_support/core_ext/class/inheritable_attributes'
+
+end
+
begin
- require 'active_support'
+ require_active_support
rescue LoadError
require 'rubygems'
- require 'active_support'
+ require_active_support
end
# This allows us to call blah(&:some_method) instead of blah{|i| i.some_method }
@@ -28,10 +38,10 @@
end
end
end
module HashMapper
- VERSION = '0.0.7'
+ VERSION = '0.0.8'
# we need this for inheritable mappers, which is annoying because it needs ActiveSupport, kinda overkill.
#
def self.extended(base)
base.class_eval do