lib/tap/support/framework.rb in bahuvrihi-tap-0.10.0 vs lib/tap/support/framework.rb in bahuvrihi-tap-0.10.1

- old
+ new

@@ -15,28 +15,40 @@ def self.included(mod) mod.extend Support::BatchableClass mod.extend Support::ConfigurableClass mod.extend Support::FrameworkClass + mod.lazy_attr :manifest + mod.lazy_attr :args end # The application used to load config_file templates # (and hence, to initialize batched objects). attr_reader :app # The name of self. + #-- + # Currently names may be any object. Audit makes use of name + # via to_s, as does app when figuring configuration filepaths. attr_accessor :name # Initializes a new instance and associated batch objects. Batch # objects will be initialized for each configuration template # specified by app.each_config_template(config_file) where # config_file = app.config_filepath(name). def initialize(config={}, name=nil, app=App.instance) super() @app = app @name = name || self.class.default_name - initialize_config(config) + + case config + when InstanceConfiguration + @config = config + config.bind(self) + else + initialize_config(config) + end end # Creates a new batched object and adds the object to batch. The batched object # will be a duplicate of the current object but with a new name and/or # configurations. @@ -61,10 +73,10 @@ end end # Returns self.name def to_s - name + name.to_s end end end end \ No newline at end of file