File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,8 @@ def run_task(name, *args)
122122
123123 def load_tasks ( file )
124124 context = TaskContext . new ( File . dirname ( file ) , self )
125- InstanceBinding . for ( context ) . eval ( File . read ( file ) , file )
125+ proxy = TaskContextProxy . new ( context )
126+ InstanceBinding . for ( proxy ) . eval ( File . read ( file ) , file )
126127 context . tasks
127128 end
128129end
@@ -138,6 +139,28 @@ def self.create
138139 end
139140end
140141
142+ class TaskContextProxy
143+ def initialize ( real )
144+ @_ = real
145+ end
146+
147+ def auto
148+ @_ . auto
149+ end
150+
151+ def dir ( base , relative = '.' )
152+ @_ . dir ( base , relative )
153+ end
154+
155+ def doc ( doc )
156+ @_ . doc ( doc )
157+ end
158+
159+ def run ( *args , &block )
160+ @_ . run ( *args , &block )
161+ end
162+ end
163+
141164class TaskContext
142165 def initialize ( root_dir , manager )
143166 @tasks = { }
You can’t perform that action at this time.
0 commit comments