lib/xcake/plugin.rb in xcake-0.6.19 vs lib/xcake/plugin.rb in xcake-0.6.20
- old
+ new
@@ -1,25 +1,17 @@
-# TODO: Figure out a more robust Plugin system
-# - Needs to handle subclass of subclass.....
-# - Needs to have better mixin hiearchy
-
module Xcake
module Plugin
+ def self.included(base)
+ base.extend ClassMethods
+ end
+
module ClassMethods
- def repository
- @repository ||= []
+ def load_plugins
+ Dir[plugins_location].each { |file| require file }
+ descendants
end
- def inherited(klass)
- repository << klass
+ def plugins_location
end
-
- def register_plugin(klass)
- repository << klass
- end
- end
-
- def self.included(klass)
- klass.extend ClassMethods # Somewhat controversial
end
end
end