# File lib/rake/inetmgrtask.rb, line 33 def create_task(taskname, task_object_proc, &execute_body) taskclass = :"Inetmgr_TaskFor_#{taskname}" taskmethod = taskname.to_s.downcase.to_sym Object.class_eval( def #{taskmethod}(name=:#{taskname}, *args, &block) Inetmgr.const_get("#{taskclass}").new(name, *args, &block) end, __FILE__, __LINE__) Inetmgr.class_eval do const_set(taskclass, Class.new(Inetmgr::InetmgrTask) do define_method :execute do |name| task_object = task_object_proc.call call_task_block(task_object) execute_body.call(task_object) unless execute_body.nil? end end) end end
Generated with the Darkfish Rdoc Generator 2.