Thanks to visit codestin.com
Credit goes to github.com

Skip to content

expose #load and #r as services for script packs #243

@adamralph

Description

@adamralph

As an enhancement to adamralph/scriptcs-nancy#12 instead of having to do:

> nancy.Start();
> #load "somemodules.csx"
> nancy.Refresh();
> #r "SomeMoreModules.dll"
> nancy.Add(typeof(CoolModule).Assembly);

I'd like to do:

> nancy.Start();
> nancy.Add("somemodules.csx");
> nancy.Add("SomeMoreModules.dll");

The script pack would take the script or assembly path and pass it back to the script engine which would effectively do either a #load or #r, passing back an Assembly reference which the pack would use to find new modules.

Update 2013-06-13

The above use case isn't really so important now since automatic module finding is in place, so all I'd need to do is:-

> nancy.Go();
> #load "somemodules.csx"
> nancy.Go();
> #r "SomeMoreModules.dll"
> nancy.Go();

However, another feature I really want to build in is automatic loading of modules from the file system based on convention (adamralph/scriptcs-nancy#13) and I believe I need #load and #r as services for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions