private static void IntializeMvc(IPathProvider pathProvider, IRubyEngine engine) { var factory = new RubyControllerFactory(pathProvider, ControllerBuilder.Current.GetControllerFactory(), engine); ControllerBuilder.Current.SetControllerFactory(factory); ViewEngines.Engines.Add(new RubyViewEngine(engine)); }
protected void Application_Start(object sender, EventArgs e) { var pathProvider = new VirtualPathProvider(); RubyEngine = Core.RubyEngine.InitializeIronRubyMvc(pathProvider, "~/routes.rb"); OnStart(); }
internal void InternalInitialize(ControllerConfiguration config) { Initialize(config.Context); _engine = config.Engine; ControllerName = config.RubyClass.Name.Replace("Controller", string.Empty); RubyType = config.RubyClass; Binders = RubyModelBinders.Binders; }
protected override void EstablishContext() { _rubyEngine = Dependency <IRubyEngine>(); _controllerFactory = Dependency <IControllerFactory>(); _pathProvider = Dependency <IPathProvider>(); _controller = Dependency <RubyController>(); }
protected override void EstablishContext() { base.EstablishContext(); _pathProvider = Dependency <IPathProvider>(); _pathProvider.WhenToldTo(pp => pp.ApplicationPhysicalPath).Return(Environment.CurrentDirectory); _rubyEngine = new RubyEngine(_scriptRuntime, _pathProvider); }
private static void ProcessRubyRoutes(IRubyEngine engine, IPathProvider vpp, string routesPath) { if (!vpp.FileExists(routesPath)) { return; } var routeCollection = new RubyRoutes(RouteTable.Routes); engine.DefineReadOnlyGlobalVariable("routes", routeCollection); engine.RequireRubyFile(routesPath, ReaderType.File); }
public RubyViewEngine(IRubyEngine rubyEngine) { _rubyEngine = rubyEngine; PartialViewLocationFormats = new[] { "~/Views/{1}/_{0}.html.erb", "~/Views/Shared/_{0}.html.erb" }; ViewLocationFormats = new[] { "~/Views/{1}/{0}.html.erb", "~/Views/Shared/{0}.html.erb", }; MasterLocationFormats = new[] { "~/Views/{1}/{0}.html.erb", "~/Views/Shared/{0}.html.erb" }; }
public RubyViewEngine(IRubyEngine rubyEngine) { _rubyEngine = rubyEngine; PartialViewLocationFormats = new[] { "~/Views/{1}/_{0}.html.erb", "~/Views/Shared/_{0}.html.erb" }; ViewLocationFormats = new[] { "~/Views/{1}/{0}.html.erb", "~/Views/Shared/{0}.html.erb", }; MasterLocationFormats = new[] { "~/Views/{1}/{0}.html.erb", "~/Views/Shared/{0}.html.erb" }; }
private bool InitializeRubyEngine(HttpApplication context) { var rubyMvcApp = context as RubyMvcApplication; if (rubyMvcApp.IsNull()) { return(false); } if (rubyMvcApp.RubyEngine.IsNull()) { rubyMvcApp.RubyEngine = RubyEngine.InitializeIronRubyMvc(new VirtualPathProvider(), "~/routes.rb"); } if (_rubyEngine.IsNull()) { _rubyEngine = rubyMvcApp.RubyEngine; } return(true); }
public RubyActionDescriptor(string actionName, ControllerDescriptor controllerDescriptor, IRubyEngine engine) { RubyEngine = engine; _actionName = actionName; _controllerDescriptor = controllerDescriptor; }
public RubyActionDescriptor(string actionName, ControllerDescriptor controllerDescriptor, IRubyEngine engine) { RubyEngine = engine; _actionName = actionName; _controllerDescriptor = controllerDescriptor; }
public RubyControllerFactory(IPathProvider pathProvider, IControllerFactory innerFactory, IRubyEngine engine) : base(pathProvider, innerFactory, engine) { _engine = engine; }
/// <summary> /// Initializes a new instance of the <see cref="RubyControllerActionInvoker"/> class. /// </summary> /// <param name="controllerName">Name of the controller.</param> /// <param name="engine">The engine.</param> public RubyControllerActionInvoker(string controllerName, IRubyEngine engine) { ControllerName = controllerName; RubyEngine = engine; }
/// <summary> /// Initializes a new instance of the <see cref="RubyControllerActionInvoker"/> class. /// </summary> /// <param name="controllerName">Name of the controller.</param> /// <param name="engine">The engine.</param> public RubyControllerActionInvoker(string controllerName, IRubyEngine engine) { ControllerName = controllerName; RubyEngine = engine; }
protected void Application_Start(object sender, EventArgs e) { var pathProvider = new VirtualPathProvider(); RubyEngine = Core.RubyEngine.InitializeIronRubyMvc(pathProvider, "~/routes.rb"); OnStart(); }
/// <summary> /// Initializes a new instance of the <see cref="RubyControllerDescriptor"/> class. /// </summary> /// <param name="rubyClass">The ruby class.</param> /// <param name="engine">The engine.</param> public RubyControllerDescriptor(RubyClass rubyClass, IRubyEngine engine) { _engine = engine; RubyControllerClass = rubyClass; _selector = new RubyActionMethodSelector(engine, rubyClass); }
internal void InternalInitialize(ControllerConfiguration config) { Initialize(config.Context); _engine = config.Engine; ControllerName = config.RubyClass.Name.Replace("Controller", string.Empty); RubyType = config.RubyClass; Binders = RubyModelBinders.Binders; }
public RubyModuleLoaderPlugin(IKernel kernel, IRubyEngine engine) { _engine = engine; Kernel = kernel; }
public RubyView(IRubyEngine rubyEngine, string viewContents, RubyView master) { _rubyEngine = rubyEngine; _master = master; _contents = viewContents; }
/// <summary> /// Initializes a new instance of the <see cref="RubyControllerDescriptor"/> class. /// </summary> /// <param name="rubyClass">The ruby class.</param> /// <param name="engine">The engine.</param> public RubyControllerDescriptor(RubyClass rubyClass, IRubyEngine engine) { _engine = engine; RubyControllerClass = rubyClass; _selector = new RubyActionMethodSelector(engine, rubyClass); }
internal RubyControllerFactory(IPathProvider pathProvider, IControllerFactory innerFactory, IRubyEngine engine) { _pathProvider = pathProvider; _innerFactory = innerFactory; _engine = engine; }
public RubyModule(IRubyEngine engine, string scriptPath) { _engine = engine; _scriptPath = scriptPath; }
/// <summary> /// Initializes a new instance of the <see cref="RubyControllerDescriptor"/> class. /// </summary> /// <param name="rubyClass">The ruby class.</param> /// <param name="engine">The engine.</param> public RubyControllerDescriptor(RubyClass rubyClass, IRubyEngine engine) : base(engine, new RubyActionMethodSelector(engine, rubyClass)) { RubyControllerClass = rubyClass; }
public RubyView(IRubyEngine rubyEngine, string viewContents, RubyView master) { _rubyEngine = rubyEngine; _master = master; _contents = viewContents; }
internal RubyControllerFactory(IPathProvider pathProvider, IControllerFactory innerFactory, IRubyEngine engine) { _pathProvider = pathProvider; _innerFactory = innerFactory; _engine = engine; }
/// <summary> /// Initializes a new instance of the <see cref="RubyActionMethodSelector"/> class. /// </summary> /// <param name="rubyEngine">The ruby engine.</param> /// <param name="rubyClass">The ruby class.</param> public RubyActionMethodSelector(IRubyEngine rubyEngine, RubyClass rubyClass) { ControllerClass = rubyClass; _rubyEngine = rubyEngine; }
public RubyModule(IRubyEngine engine, string scriptPath) { _engine = engine; _scriptPath = scriptPath; }
private bool InitializeRubyEngine(HttpApplication context) { var rubyMvcApp = context as RubyMvcApplication; if(rubyMvcApp.IsNull()) return false; if(rubyMvcApp.RubyEngine.IsNull()) rubyMvcApp.RubyEngine = RubyEngine.InitializeIronRubyMvc(new VirtualPathProvider(), "~/routes.rb"); if (_rubyEngine.IsNull()) _rubyEngine = rubyMvcApp.RubyEngine; return true; }
public RubyModuleLoaderPlugin(IKernel kernel, IRubyEngine engine) { _engine = engine; Kernel = kernel; }