lib/maintain/backend.rb in maintain-0.2.23 vs lib/maintain/backend.rb in maintain-0.3.0
- old
+ new
@@ -11,20 +11,10 @@
while modules.length > 0
owner = owner.const_get(modules.shift)
end
# If it exists, extend it with Maintain methods automatically
owner.extend Maintain
- # TODO: Try and remember why I did this
- # if owner.is_a? Module
- # owner.class_eval do
- # class << self
- # include Maintain
- # end
- # end
- # else
- # owner.extend Maintain
- # end
end
end
def build(back_end)
back_end = back_end.to_s.split('_').map(&:capitalize).join('')
@@ -56,11 +46,11 @@
rescue
super
end
end
- # Detect if we've loaded a backend for this class - that means if its ancestors or
- # parent classes include any of our back-end classes.
+ # Detect if we've loaded a backend for this class - that means if its
+ # ancestors or parent classes include any of our back-end classes.
def detect(owner)
ancestors = owner.ancestors.map(&:to_s)
# While owner does not refer to "Object"
while owner.superclass
ancestors.push(owner.to_s)