Skip to content

Instantly share code, notes, and snippets.

@emiaj
Created December 6, 2012 23:55
Show Gist options
  • Select an option

  • Save emiaj/4229535 to your computer and use it in GitHub Desktop.

Select an option

Save emiaj/4229535 to your computer and use it in GitHub Desktop.
public class SparkPolicyRunner : IActivator
{
private readonly ISparkViewEngine _engine;
private readonly IEnumerable<ISparkPolicy> _policies;
public SparkPolicyRunner(ISparkViewEngine engine, IEnumerable<ISparkPolicy> policies)
{
_engine = engine;
_policies = policies;
}
public void Activate(IEnumerable<IPackageInfo> packages, IPackageLog log)
{
_policies.Each(policy => policy.Run(_engine, log));
}
}
public interface ISparkPolicy
{
void Run(ISparkViewEngine engine, IPackageLog log);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment