scriptcs-nancy icon indicating copy to clipboard operation
scriptcs-nancy copied to clipboard

Find module files by convention

Open adamralph opened this issue 11 years ago • 8 comments

modules
  foo.csx
  Bar.dll
views
  ...
nancy.csx

Require<NancyPack>().Host(); picks up and registers the modules.

Conventions, including host prefix etc., can be overridden/extended with nancy.yml.

Think > rails server/> scriptcs nancy :wink:.

Goodbye IIS and windows services, hello write code and xcopy.

adamralph avatar May 12 '13 13:05 adamralph

Depends on https://github.com/scriptcs/scriptcs/issues/243

adamralph avatar May 12 '13 13:05 adamralph

We need to think if we really want to do this. This is going to take a lot of rework.

glennblock avatar May 12 '13 18:05 glennblock

What we could do, which we do not today is allow you to dynamically inject script / files from a script pack. Then you could implement in the script pack your own convention based scanning logic, find the files you want by reading your yml file and matching on conventions. Then you can pass in those filenames similar to the way you pass references or using statements.

Would that work for you?

glennblock avatar May 12 '13 18:05 glennblock

I prefer to do it this way and not bake any convention based mechanism in.

glennblock avatar May 12 '13 18:05 glennblock

I never thought this would be something for scriptcs... This would be something purely existing within the nancy script pack. All I need is for https://github.com/scriptcs/scriptcs/issues/243 to implemented

adamralph avatar May 12 '13 18:05 adamralph

I.e. exactly what you said two comments back

adamralph avatar May 12 '13 18:05 adamralph

OK, I guess the snippets were throwing me off.

so I think what we could do is expose a collection of scripts on the script pack context. The collection could either be filenames or loose script.

Then during initialization when we import the usings and add references we also merge in the scripts.

It would just be a flat merge in that case as you can add references and usings programatically.

Does that work?

glennblock avatar May 12 '13 18:05 glennblock

Moved the thread to https://github.com/scriptcs/scriptcs/issues/243#issuecomment-17783108

adamralph avatar May 12 '13 18:05 adamralph