Permalink
Browse files

Started writing bacon specs before going any further

  • Loading branch information...
1 parent c2ab2f4 commit 39143f05182d7eebdeeb5c8c22532c5663ad3ece @casualjim casualjim committed May 1, 2009
Showing with 1,149 additions and 242 deletions.
  1. +1 −1 .gitignore
  2. +87 −0 IronMvcSpecs/IronMvcSpecs.stproj
  3. +46 −0 IronMvcSpecs/Rakefile.rb
  4. +8 −0 IronMvcSpecs/bacon_helper.rb
  5. +4 −0 IronMvcSpecs/extensions/extensions.rb
  6. +70 −0 IronMvcSpecs/extensions/ienumerable_extensions_spec.rb
  7. +26 −0 IronMvcSpecs/extensions/object_extensions_spec.rb
  8. +55 −0 IronMvcSpecs/extensions/string_extensions_spec.rb
  9. +152 −0 IronMvcSpecs/lib/amok.rb
  10. +23 −0 IronMvcSpecs/workarounds/Workarounds.cs
  11. +1 −1 IronRubyMvc.Tests/Core/RubyEngineSpec.cs
  12. +10 −0 IronRubyMvc.sln
  13. +5 −2 IronRubyMvc/Controllers/RubyActionMethodSelector.cs
  14. +2 −1 IronRubyMvc/Controllers/RubyControllerDescriptor.cs
  15. +79 −3 IronRubyMvc/Controllers/controller.rb
  16. +8 −0 IronRubyMvc/Core/IPathProvider.cs
  17. +62 −26 IronRubyMvc/Core/IRubyEngine.cs
  18. +131 −0 IronRubyMvc/Core/MvcApplication.cs
  19. +17 −0 IronRubyMvc/Core/MvcScriptHost.cs
  20. +85 −0 IronRubyMvc/Core/PathProviderPAL.cs
  21. +53 −30 IronRubyMvc/Core/RubyEngine.cs
  22. +13 −1 IronRubyMvc/Core/RubyMvcApplication.cs
  23. +92 −10 IronRubyMvc/Core/RubyMvcModule.cs
  24. +36 −0 IronRubyMvc/Core/TypeConverter.cs
  25. +36 −0 IronRubyMvc/Core/VirtualPathProvider.cs
  26. +8 −3 IronRubyMvc/Extensions/IDictionaryExtensions.cs
  27. +3 −140 IronRubyMvc/Extensions/IEnumerableExtensions.cs
  28. +9 −2 IronRubyMvc/Extensions/ObjectExtensions.cs
  29. +3 −3 IronRubyMvc/Extensions/StringExtensions.cs
  30. +6 −4 IronRubyMvc/Helpers/RubyAjaxHelper.cs
  31. +14 −1 IronRubyMvc/System.Web.Mvc.IronRuby.csproj
  32. +1 −1 IronRubyMvcWeb/Default.aspx
  33. +2 −0 IronRubyMvcWeb/Web.config
  34. BIN dependencies/IronRuby.Libraries.Yaml.dll
  35. BIN dependencies/IronRuby.Libraries.Yaml.pdb
  36. BIN dependencies/IronRuby.Libraries.dll
  37. BIN dependencies/IronRuby.Libraries.pdb
  38. BIN dependencies/IronRuby.dll
  39. BIN dependencies/IronRuby.pdb
  40. BIN dependencies/Microsoft.Scripting.Core.dll
  41. BIN dependencies/Microsoft.Scripting.Core.pdb
  42. BIN dependencies/Microsoft.Scripting.ExtensionAttribute.dll
  43. BIN dependencies/Microsoft.Scripting.ExtensionAttribute.pdb
  44. BIN dependencies/Microsoft.Scripting.dll
  45. BIN dependencies/Microsoft.Scripting.pdb
  46. BIN dependencies/xUnit.BDDExtensions.dll
  47. BIN dependencies/xUnit.BDDExtensions.pdb
  48. BIN dependencies/xunit.dll
  49. +1 −13 dependencies/xunit.xml
View
2 .gitignore
@@ -20,4 +20,4 @@ IronRubyMvc/Controllers/._controller.rb
IronRubyMvc/Core/._RubyEngine.cs
dependencies/IronRuby.Tests.exe
dependencies/IronRuby.Tests.pdb
-IronRubyMvcLibrarySpecs/bin/*.*
+IronMvcSpecs/bin/*.*
View
87 IronMvcSpecs/IronMvcSpecs.stproj
@@ -0,0 +1,87 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <Name>Debug</Name>
+ <OutputPath>Debug\</OutputPath>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+ <Name>Release</Name>
+ <OutputPath>Release\</OutputPath>
+ </PropertyGroup>
+ <UsingTask TaskName="Sapphire.Steel.SteelRubyBuild" AssemblyName="SteelBuild, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8a42f26dbbcba2be, processorArchitecture=x86" />
+ <UsingTask TaskName="Sapphire.Steel.SteelRailsBuild" AssemblyName="SteelBuild, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8a42f26dbbcba2be, processorArchitecture=x86" />
+ <Target Name="BuildRails" Inputs="@(EmbeddedRuby)" Outputs="$(MSBuildProjectDirectory)\SyntaxCheck\%(Identity)">
+ <MakeDir Directories="SyntaxCheck" />
+ <SteelRailsBuild ERBFile="@(EmbeddedRuby)" ProjectDirectory="$(MSBuildProjectDirectory)" ERBProcessor="$(ERBProcessor)" ERBFlags="$(ERBFlags)" ERBLibraryFiles="$(ERBLibraryFiles)" ERBTimeout="$(ERBTimeout)" />
+ </Target>
+ <Target Name="BuildRuby" Inputs="@(Ruby)" Outputs="$(MSBuildProjectDirectory)\SyntaxCheck\%(Identity)">
+ <MakeDir Directories="SyntaxCheck" />
+ <SteelRubyBuild RubyFile="@(Ruby)" ProjectDirectory="$(MSBuildProjectDirectory)" RubyInterpreter="$(RubyInterpreter)" RubyInterpreterFlags="$(RubyInterpreterFlags)" RubyLibraryFiles="$(RubyLibraryFiles)" RubyLibraryPaths="$(LibraryPath)" RubyTimeout="$(RubyTimeout)" />
+ </Target>
+ <Target Name="Clean">
+ <RemoveDir Directories="$(MSBuildProjectDirectory)\SyntaxCheck" />
+ </Target>
+ <Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Inputs="@(Ruby); @(EmbeddedRuby)" Outputs="$(MSBuildProjectDirectory)\SyntaxCheck\%(Identity)">
+ </Target>
+ <Target Name="Clean">
+ <RemoveDir Directories="$(MSBuildProjectDirectory)\SyntaxCheck" />
+ </Target>
+ <PropertyGroup>
+ <RebuildDependsOn>
+ Clean;
+ Build;
+ </RebuildDependsOn>
+ <BuildDependsOn>
+ BeforeBuild;
+ BuildRuby;
+ BuildRails;
+ AfterBuild;
+ </BuildDependsOn>
+ <SteelVersion>1.2</SteelVersion>
+ <ProjectGuid>{4b1e7b70-f827-46a0-9d8d-68498b5ef73d}</ProjectGuid>
+ <AssemblyName>IronMvcSpecs</AssemblyName>
+ <RootNamespace>IronMvcSpecs</RootNamespace>
+ </PropertyGroup>
+ <ItemGroup>
+ <Ruby Include="bacon_helper.rb" />
+ <Ruby Include="extensions\extensions.rb" />
+ <Ruby Include="extensions\ienumerable_extensions_spec.rb" />
+ <Ruby Include="extensions\object_extensions_spec.rb" />
+ <Ruby Include="extensions\string_extensions_spec.rb" />
+ <Ruby Include="lib\amok.rb" />
+ <Ruby Include="Rakefile.rb" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Debug" />
+ <Folder Include="lib" />
+ <Folder Include="extensions" />
+ <Folder Include="bin" />
+ <Folder Include="workarounds" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="bin\BugWorkarounds.dll" />
+ <Content Include="bin\BugWorkarounds.pdb" />
+ <Content Include="bin\IronRuby.dll" />
+ <Content Include="bin\IronRuby.Libraries.dll" />
+ <Content Include="bin\IronRuby.Libraries.pdb" />
+ <Content Include="bin\IronRuby.pdb" />
+ <Content Include="bin\Microsoft.Scripting.Core.dll" />
+ <Content Include="bin\Microsoft.Scripting.Core.pdb" />
+ <Content Include="bin\Microsoft.Scripting.dll" />
+ <Content Include="bin\Microsoft.Scripting.ExtensionAttribute.dll" />
+ <Content Include="bin\Microsoft.Scripting.ExtensionAttribute.pdb" />
+ <Content Include="bin\Microsoft.Scripting.pdb" />
+ <Content Include="bin\System.Web.Mvc.IronRuby.dll" />
+ <Content Include="bin\System.Web.Mvc.IronRuby.pdb" />
+ <Content Include="workarounds\Workarounds.cs" />
+ </ItemGroup>
+ <Target Name="Rebuild" DependsOnTargets="$(RebuildDependsOn)" Inputs="@(Ruby)" Outputs="$(MSBuildProjectDirectory)\SyntaxCheck\%(Identity)">
+ </Target>
+ <Target Name="BeforeBuild" Condition="'$(PreBuildEvent)'!='' ">
+ <Exec Command="$(PreBuildEvent)" />
+ </Target>
+ <Target Name="AfterBuild" Condition="'$(PostBuildEvent)'!='' ">
+ <Exec Command="$(PostBuildEvent)" />
+ </Target>
+ <!--<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />-->
+ <Target Name="ResolveAssemblyReferences" />
+</Project>
View
46 IronMvcSpecs/Rakefile.rb
@@ -0,0 +1,46 @@
+require 'ftools'
+
+def tgt_dir
+ File.dirname(__FILE__) + "/bin"
+end
+
+def mono?
+ !ENV['mono'].nil? && ENV['mono'] > 0
+end
+
+desc "The default task is to run all the specs"
+task :default => :spec
+
+desc "Runs all the specs"
+task :spec => [:copy_binaries, :workarounds, 'spec:extensions']
+
+namespace :spec do
+ desc "runs the specs for the extensions"
+ task :extensions do
+ puts "starting extension specs"
+ system "ibacon #{Dir.glob('extensions/**/*_spec.rb').join(' ')}"
+# specs = Dir.glob('extensions/**/*_spec.rb')
+# require 'rubygems'
+# require 'bacon'
+# Bacon.extend Bacon.const_get('SpecDoxOutput')
+# Bacon.summary_on_exit
+#
+# specs.each { |spec|
+# load File.dirname(__FILE__) + "/#{spec}"
+# }
+ end
+end
+
+desc "Copies the binaries from System.Web.Mvc.IronRuby to the specs folder"
+task :copy_binaries do
+ src_dir = File.expand_path(File.dirname(__FILE__) + "/../IronRubyMvc/bin/Debug")
+ files = Dir.glob("#{src_dir}/*")
+ files.each { |f| File.copy("#{f}", "#{tgt_dir}/#{File.basename(f)}") }
+end
+
+desc "Compiles the workarounds"
+task :workarounds do
+ Dir.chdir(File.dirname(__FILE__))
+ files = Dir.glob("workarounds/*.cs").collect { |f| f.gsub(/\//, "\\") }.join(" ")
+ system "csc /noconfig /target:library /debug+ /debug:full /out:bin\\BugWorkarounds.dll /reference:bin\\IronRuby.dll /reference:bin\\Microsoft.Scripting.dll /reference:bin\\Microsoft.Scripting.Core.dll /reference:bin\\System.Web.Mvc.IronRuby.dll #{files}"
+end
View
8 IronMvcSpecs/bacon_helper.rb
@@ -0,0 +1,8 @@
+$: << File.dirname(__FILE__) + '/bin'
+require 'bacon'
+require 'mscorlib'
+require File.dirname(__FILE__) + "/lib/amok.rb"
+
+#load_assembly 'System.Web.Mvc.IronRuby, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
+load_assembly 'System.Web.Mvc.IronRuby'
+load_assembly 'BugWorkarounds'
View
4 IronMvcSpecs/extensions/extensions.rb
@@ -0,0 +1,4 @@
+require File.dirname(__FILE__) + "/../bacon_helper.rb"
+
+include System::Web::Mvc::IronRuby::Extensions
+include BugWorkarounds
View
70 IronMvcSpecs/extensions/ienumerable_extensions_spec.rb
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + "/extensions.rb"
+
+describe "IEnumerableExtensions" do
+
+ before do
+ @collection = [1, 2, 3, 4, 5, 6, 7, 8]
+ @generic_collection = System::Collections::Generic::List.of(Fixnum).new
+ @generic_collection.add 1
+ @generic_collection.add 2
+ @generic_collection.add 3
+ @generic_collection.add 4
+ @generic_collection.add 5
+ @generic_collection.add 6
+ @generic_collection.add 7
+ @generic_collection.add 8
+ @generic_collection.add 9
+ end
+
+ describe "iteration" do
+ it "should iterate over an untyped collection" do
+ counter, result = 0, 0
+ p = Proc.new {|item| counter += 1; result += item }
+ iterator = Workarounds.wrap_proc(p)
+ IEnumerableExtensions.for_each(@collection, iterator)
+ counter.should == 8
+ result.should == 36
+ end
+
+ it "should iterate over a generic collection" do
+ counter, result = 0, 0
+ p = Proc.new {|item| counter += 1; result += item }
+ iterator = Workarounds.method(:wrap_proc).of(Fixnum).call(p)
+ IEnumerableExtensions.method(:for_each).of(Fixnum).call(@generic_collection, iterator)
+ counter.should == 9
+ result.should == 45
+ end
+ end
+
+ describe "empty checking" do
+
+ it "should raise an ArgumentException for a non-generic method call with null" do
+ should.raise(System::NullReferenceException){ Workarounds.is_empty(nil) }
+ end
+
+ it "should raise an ArgumentException for a non-generic method call with null" do
+ should.raise(System::NullReferenceException){ Workarounds.method(:is_empty).of(System::String).call(nil) }
+ end
+
+ it "should be true for an empty non-generic collection" do
+ IEnumerableExtensions.is_empty([]).should.be.true?
+ end
+
+ it "should be true for an empty generic collection" do
+ coll = System::Collections::Generic::List.of(String).new
+ IEnumerableExtensions.method(:is_empty).of(String).call(coll).should.be.true?
+ end
+
+ it "should be false for an non-empty non-generic collection" do
+ IEnumerableExtensions.is_empty([3]).should.be.false?
+ end
+
+ it "should be false for a non-empty generic collection" do
+ coll = System::Collections::Generic::List.of(String).new
+ coll.add "a string"
+ IEnumerableExtensions.method(:is_empty).of(String).call(coll).should.be.false?
+ end
+
+ end
+
+end
View
26 IronMvcSpecs/extensions/object_extensions_spec.rb
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/extensions.rb'
+
+describe "ObjectExtensions" do
+
+ describe "when asking for null" do
+ it "should return true for a null value" do
+ Workarounds.is_null(nil).should.be.true?
+ end
+
+ it "should return false for an object instance" do
+ ObjectExtensions.is_null(System::Object.new).should.be.false?
+ end
+ end
+
+ describe "when asking for not null" do
+ it "should return false for a null value" do
+ Workarounds.is_not_null(nil).should.be.false?
+ end
+
+ it "should return true for an object instance" do
+ ObjectExtensions.is_not_null(Object.new).should.be.true?
+ end
+ end
+
+
+end
View
55 IronMvcSpecs/extensions/string_extensions_spec.rb
@@ -0,0 +1,55 @@
+require File.dirname(__FILE__) + '/extensions.rb'
+
+describe "StringExtensions" do
+
+ describe "when asking for null or blank" do
+ it "should return true for a null value" do
+ Workarounds.is_null_or_blank(nil).should.be.true?
+ end
+
+ it "should return true for an empty value" do
+ StringExtensions.is_null_or_blank("").should.be.true?
+ end
+
+ it "should return true when the string contains only spaces" do
+ StringExtensions.is_null_or_blank(" ").should.be.true?
+ end
+
+ it "should return false when the string contains a value" do
+ StringExtensions.is_null_or_blank("a string value").should.be.false?
+ end
+
+ end
+
+ describe "when asking for not null or blank" do
+
+ it "should return false when value is null" do
+ Workarounds.is_not_null_or_blank(nil).should.be.false?
+ end
+
+ it "should return false for an empty value" do
+ StringExtensions.is_not_null_or_blank("").should.be.false?
+ end
+
+ it "should return false when the string contains only spaces" do
+ StringExtensions.is_not_null_or_blank(" ").should.be.false?
+ end
+
+ it "should return true when the string contains a value" do
+ StringExtensions.is_not_null_or_blank("a string value").should.be.true?
+ end
+
+ end
+
+ describe "when asking to format a string" do
+
+ it "should return a properly formatted string" do
+ expected = "This is the 1 and only Format test at #{System::DateTime.now.to_short_date_string}".to_clr_string
+ actual = StringExtensions.formatted_with("This is the {0} and only {1} test at {2}".to_clr_string, 1, "Format", System::DateTime.now.to_short_date_string)
+
+ expected.should == actual
+ end
+
+ end
+
+end
View
152 IronMvcSpecs/lib/amok.rb
@@ -0,0 +1,152 @@
+# Amok -- a compact mock library
+
+# Copyright (C) 2008 Christian Neukirchen <purl.org/net/chneukirchen>
+#
+# Amok is freely distributable under the terms of an MIT-style license.
+# See COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+class Amok
+ VERSION = '0.1'
+
+ attr_reader :obj
+
+ class Failed < RuntimeError
+ attr_accessor :errors
+ end
+
+ def self.with(obj)
+ mock = new(obj)
+ yield obj, mock
+ mock.validate
+ end
+
+ def self.make(hash, &block)
+ a = new(Object.new, &block)
+ hash.each { |key, value| a.on(key) { value } }
+ a.obj
+ end
+
+ @@uuid = 0
+ def uuid
+ @@uuid += 1
+ end
+
+ def initialize(obj, &block)
+ @obj = obj
+ @called = {}
+ @previous = {}
+ instance_eval(&block) if block
+ end
+
+ def on(method=nil, args=nil, n=nil, &block)
+ return NiceProxy.new(self, n) unless method || block
+
+ called = @called
+ id = [method, args]
+ called[id] = n
+ _previous = @previous
+
+ mock = self
+ (class << @obj; self; end).class_eval {
+ if block
+ current = "__current_#{method}_#{mock.uuid}__amok__"
+ define_method(current, &block)
+ end
+ begin
+ previous = "__previous_#{method}_#{mock.uuid}__amok__"
+ alias_method previous, method
+ rescue NameError
+ previous = nil
+ end
+ _previous[method] ||= previous
+ define_method(method) { |*actual_args|
+ if args.nil? || args == actual_args
+ case called[id]
+ when Numeric; called[id] -= 1
+ when false; called[id] = true
+ end
+ __send__(current || previous, *actual_args)
+ else
+ __send__(previous, *actual_args)
+ end
+ }
+ }
+ end
+
+ def previous(method, *args, &block)
+ @obj.__send__(@previous[method], *args, &block)
+ end
+
+ def need(method=nil, args=nil, n=false, &block)
+ unless block
+ case method
+ when nil; NiceProxy.new(self, n) # mock.need.foo
+ when Numeric; NiceProxy.new(self, method) # mock.need(3).foo
+ end
+ else
+ on(method, args, n, &block)
+ end
+ end
+
+ def never(method=nil, args=nil)
+ return NiceProxy.new(self, 0) if !method
+ on(method, args, 0) {
+ # should we raise here?
+ }
+ end
+
+ def errors
+ @called.reject { |k, v|
+ v == 0 || # run the right number of times
+ v == true || # run at all
+ v == nil # run? who cares?
+ }.map { |(m, a), v|
+ msg = m.to_s
+ msg << "(#{a.map { |x| x.inspect }.join(", ")})" if a
+ if v == false
+ msg << " was not called."
+ else
+ msg << " was called #{v.abs} times #{v < 0 ? "too often" : "too few"}."
+ end
+ }
+ end
+
+ def successful?
+ errors.empty?
+ end
+
+ def validate
+ unless successful?
+ ex = Failed.new(errors.join(" "))
+ ex.errors = errors.dup
+ raise ex
+ end
+ end
+
+ def cleanup!
+ _previous = @previous
+ (class << @obj; self; end).class_eval {
+ _previous.each { |old, new|
+ new ? alias_method(old, new) : undef_method(old)
+ }
+ methods.each { |m| undef_method if m =~ /__amok__\Z/ }
+ }
+ @obj
+ end
+
+ class NiceProxy
+ instance_methods.each { |name|
+ undef_method name unless name =~ /^__|^instance_eval$/
+ }
+
+ def initialize(obj, n=nil)
+ @obj, @n = obj, n
+ end
+
+ def method_missing(name, *args, &block)
+ args = nil if args.empty? # allow any arguments when none are mentioned
+ @obj.on(name, args, @n, &block)
+ self
+ end
+ end
+end
View
23 IronMvcSpecs/workarounds/Workarounds.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Web.Mvc.IronRuby.Extensions;
+using IronRuby.Builtins;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace BugWorkarounds
+{
+ public static class Workarounds
+ {
+ // IronRuby currently is a little bit confused about Actions and extension methods when called with nil/null
+ // These methods get around those confusions
+ public static bool IsNull(object value) { return value.IsNull(); }
+ public static bool IsNotNull(object value) { return value.IsNotNull(); }
+ public static bool IsNullOrBlank(string value) { return value.IsNullOrBlank(); }
+ public static bool IsNotNullOrBlank(string value) { return value.IsNotNullOrBlank(); }
+ public static bool IsEmpty(IEnumerable collection) { return collection.IsEmpty(); }
+ public static bool IsEmpty<T>(IEnumerable<T> collection) { return collection.IsEmpty(); }
+ public static Action<object> WrapProc(Proc proc) { return obj => proc.Call(obj); }
+ public static Action<T> WrapProc<T>(Proc proc) { return obj => proc.Call(obj); }
+ }
+
+}
View
2 IronRubyMvc.Tests/Core/RubyEngineSpec.cs
@@ -41,7 +41,7 @@ protected override void EstablishContext()
protected override void Because()
{
- _engine = RubyEngine.InitializeIronRubyMvc(_pathProvider, "~/routes.rb", path => new TestStreamContentProvider(path));
+ _engine = RubyEngine.InitializeIronRubyMvc(_pathProvider, "~/routes.rb");
}
View
10 IronRubyMvc.sln
@@ -13,6 +13,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.markdown = README.markdown
EndProjectSection
EndProject
+Project("{325B8569-0C7C-4A6A-8AF8-89C3B6BC9E74}") = "IronMvcSpecs", "IronMvcSpecs\IronMvcSpecs.stproj", "{4B1E7B70-F827-46A0-9D8D-68498B5EF73D}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Signed|Any CPU = Debug_Signed|Any CPU
@@ -45,6 +47,14 @@ Global
{13CD326E-5C1A-4404-A1AB-8D0BA6D9FDF9}.Release_Signed|Any CPU.Build.0 = Release_Signed|Any CPU
{13CD326E-5C1A-4404-A1AB-8D0BA6D9FDF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13CD326E-5C1A-4404-A1AB-8D0BA6D9FDF9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4B1E7B70-F827-46A0-9D8D-68498B5EF73D}.Debug_Signed|Any CPU.ActiveCfg = Debug|Any CPU
+ {4B1E7B70-F827-46A0-9D8D-68498B5EF73D}.Debug_Signed|Any CPU.Build.0 = Debug|Any CPU
+ {4B1E7B70-F827-46A0-9D8D-68498B5EF73D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4B1E7B70-F827-46A0-9D8D-68498B5EF73D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4B1E7B70-F827-46A0-9D8D-68498B5EF73D}.Release_Signed|Any CPU.ActiveCfg = Release|Any CPU
+ {4B1E7B70-F827-46A0-9D8D-68498B5EF73D}.Release_Signed|Any CPU.Build.0 = Release|Any CPU
+ {4B1E7B70-F827-46A0-9D8D-68498B5EF73D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4B1E7B70-F827-46A0-9D8D-68498B5EF73D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
7 IronRubyMvc/Controllers/RubyActionMethodSelector.cs
@@ -1,3 +1,4 @@
+extern alias clr3;
#region Usings
using System.Collections;
@@ -7,6 +8,8 @@
using System.Web.Mvc.IronRuby.Extensions;
using IronRuby.Builtins;
+using clr3::System.Linq;
+
#endregion
namespace System.Web.Mvc.IronRuby.Controllers
@@ -54,7 +57,7 @@ private void PopulateLookupTables(IEnumerable<string> methodNames)
var methodAliases = (Hash) _rubyEngine.CallMethod(ControllerClass, "name_selectors");
AliasedMethods = methodAliases.Map(pair => KeyValuePairFor(pair));
NonAliasedMethods =
- methodNames.Where(
+ clr3::System.Linq.Enumerable.Where(methodNames,
method =>
AliasedMethods.DoesNotContain(
pair => String.Equals(pair.Key, method.Underscore(), StringComparison.OrdinalIgnoreCase) || String.Equals(pair.Key, method.Pascalize(), StringComparison.OrdinalIgnoreCase)
@@ -77,7 +80,7 @@ public string FindActionMethod(ControllerContext controllerContext, string actio
PopulateLookupTables(controllerContext); // dynamic languages can add methods at runtime
var methodsMatchingName = GetMatchingAliasedMethods(controllerContext, actionName);
methodsMatchingName.AddRange(
- NonAliasedMethods.Where(
+ clr3::System.Linq.Enumerable.Where(NonAliasedMethods,
name => String.Equals(name, actionName.Underscore(), StringComparison.OrdinalIgnoreCase) || String.Equals(name, actionName.Pascalize(), StringComparison.OrdinalIgnoreCase)));
var finalMethods = RunSelectionFilters(controllerContext, methodsMatchingName);
View
3 IronRubyMvc/Controllers/RubyControllerDescriptor.cs
@@ -1,9 +1,10 @@
+extern alias clr3;
#region Usings
using System.Web.Mvc.IronRuby.Core;
using System.Web.Mvc.IronRuby.Extensions;
using IronRuby.Builtins;
-
+using clr3::System.Linq;
#endregion
namespace System.Web.Mvc.IronRuby.Controllers
View
82 IronRubyMvc/Controllers/controller.rb
@@ -2,6 +2,55 @@ def debugger
System::Diagnostics::Debugger.break if System::Diagnostics::Debugger.launch
end
+module System
+
+ module Web
+ class HttpRequestBase
+
+ def post?
+ self.http_method.to_s.downcase.to_sym == :post
+ end
+
+ def put?
+ self.http_method.to_s.downcase.to_sym == :put
+ end
+
+ def get?
+ self.http_method.to_s.downcase.to_sym == :get
+ end
+
+ def delete?
+ self.http_method.to_s.downcase.to_sym == :delete
+ end
+
+ def head?
+ self.http_method.to_s.downcase.to_sym == :head
+ end
+ end
+ end
+
+ class Object
+
+ class << self
+
+ def create_from_hash(options)
+ result = self.new
+ result.populate_from_hash options
+ result
+ end
+
+ end
+
+ def populate_from_hash(options)
+ options.each do |k, v|
+ mn = "#{k}=".to_sym
+ self.send(mn, v) if self.respond_to?(mn)
+ end
+ end
+ end
+
+end
+
module IronRubyMvc
module Controllers
@@ -222,6 +271,35 @@ def self.included(base)
end
+ class PropertyDescriptor
+
+ attr_accessor :name
+
+ end
+
+ class DefaultModelBinder
+ def initialize(target, values)
+ @target = target
+ @values = values
+ end
+
+ def bind
+ @target
+ end
+
+ def self.bind(target, values)
+ binder = DefaultModelBinder.new target, values
+
+ binder.bind
+ end
+
+ private
+
+ def has_property?
+ target.get_type
+ end
+ end
+
#module Controllers
class Controller < System::Web::Mvc::IronRuby::Controllers::RubyController
@@ -235,9 +313,7 @@ def fill_view_data
instance_variables.each { |varname| view_data.add(varname[1..-1], instance_variable_get(varname.to_sym)) }
end
- def post?
- controller_context.http_context.request.http_method.to_s.downcase.to_sym == :post
- end
+
end
View
8 IronRubyMvc/Core/IPathProvider.cs
@@ -10,7 +10,15 @@ public interface IPathProvider
{
string ApplicationPhysicalPath { get; }
bool FileExists(string filePath);
+ bool DirectoryExists(string dirPath);
+ string[] GetDirectories(string path, string searchPattern);
+ string[] GetFiles(string path, string searchPattern);
Stream Open(string filePath);
string MapPath(string filePath);
+ bool IsAbsolutePath(string path);
+ string GetFullPath(string path);
+
+ Stream Open(string path, FileMode mode, FileAccess access, FileShare share);
+ Stream Open(string path, FileMode mode, FileAccess access, FileShare share, int size);
}
}
View
88 IronRubyMvc/Core/IRubyEngine.cs
@@ -15,22 +15,6 @@ namespace System.Web.Mvc.IronRuby.Core
/// </summary>
public interface IRubyEngine
{
-// /// <summary>
-// /// Loads the controller.
-// /// </summary>
-// /// <param name="requestContext">The request context.</param>
-// /// <param name="controllerName">Name of the controller.</param>
-// /// <returns></returns>
-// RubyController LoadController(RequestContext requestContext, string controllerName);
-//
-// /// <summary>
-// /// Configures the controller.
-// /// </summary>
-// /// <param name="rubyClass">The ruby class.</param>
-// /// <param name="requestContext">The request context.</param>
-// /// <returns></returns>
-// RubyController ConfigureController(RubyClass rubyClass, RequestContext requestContext);
-
/// <summary>
/// Calls the method.
/// </summary>
@@ -40,16 +24,6 @@ public interface IRubyEngine
/// <returns></returns>
object CallMethod(object receiver, string message, params object[] args);
-// /// <summary>
-// /// Determines whether the specified controller as the action.
-// /// </summary>
-// /// <param name="controller">The controller.</param>
-// /// <param name="actionName">Name of the action.</param>
-// /// <returns>
-// /// <c>true</c> if the specified controller has the action; otherwise, <c>false</c>.
-// /// </returns>
-// bool HasControllerAction(RubyController controller, string actionName);
-
/// <summary>
/// Gets the method names for the controller class.
/// </summary>
@@ -86,6 +60,68 @@ public interface IRubyEngine
object ExecuteScript(string script, ScriptScope scope);
/// <summary>
+ /// Executes the file.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="scope">The scope.</param>
+ /// <param name="throwIfNotExist">if set to <c>true</c> [throw if not exist].</param>
+ /// <returns></returns>
+ object ExecuteFile(string path, ScriptScope scope, bool throwIfNotExist);
+
+ /// <summary>
+ /// Executes the file.
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="path">The path.</param>
+ /// <param name="throwIfNotExist">if set to <c>true</c> [throw if not exist].</param>
+ /// <returns></returns>
+ T ExecuteFile<T>(string path, bool throwIfNotExist);
+
+
+ /// <summary>
+ /// Executes the file.
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="path">The path.</param>
+ /// <returns></returns>
+ T ExecuteFile<T>(string path);
+
+ /// <summary>
+ /// Executes the script.
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="script">The script.</param>
+ /// <returns></returns>
+ T ExecuteScript<T>(string script);
+
+ /// <summary>
+ /// Executes the script.
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="script">The script.</param>
+ /// <param name="scope">The scope.</param>
+ /// <returns></returns>
+ T ExecuteScript<T>(string script, ScriptScope scope);
+
+ /// <summary>
+ /// Executes the file.
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="path">The path.</param>
+ /// <param name="scope">The scope.</param>
+ /// <param name="throwIfNotExist">if set to <c>true</c> [throw if not exist].</param>
+ /// <returns></returns>
+ T ExecuteFile<T>(string path, ScriptScope scope, bool throwIfNotExist);
+
+
+ /// <summary>
+ /// Executes the file.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <returns></returns>
+ object ExecuteFile(string path);
+
+ /// <summary>
/// Defines the read only global variable.
/// </summary>
/// <param name="variableName">Name of the variable.</param>
View
131 IronRubyMvc/Core/MvcApplication.cs
@@ -0,0 +1,131 @@
+namespace System.Web.Mvc.IronRuby.Core
+{
+ public abstract class MvcApplication
+ {
+ public virtual void Start(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void Error(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void AcquireRequestState(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void AuthenticateRequest(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void AuthorizeRequest(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void BeginRequest(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void Disposed(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void EndRequest(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void LogRequest(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PostAcquireRequestState(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void MapRequestHandler(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PostAuthenticateRequest(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PostAuthorizeRequest(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PostLogRequest(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PostMapRequestHandler(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PostReleaseRequestState(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PostRequestHandlerExecute(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PostResolveRequestCache(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PostUpdateRequestCache(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PreRequestHandlerExecute(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PreSendRequestContent(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void PreSendRequestHeaders(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void ReleaseRequestState(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void ResolveRequestCache(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ public virtual void UpdateRequestCache(object sender, EventArgs e)
+ {
+ //intentionally left blank for a better overriding experience
+ }
+
+ }
+}
View
17 IronRubyMvc/Core/MvcScriptHost.cs
@@ -0,0 +1,17 @@
+using Microsoft.Scripting.Hosting;
+
+namespace System.Web.Mvc.IronRuby.Core
+{
+ public class MvcScriptHost : ScriptHost
+ {
+ public MvcScriptHost(){}
+
+ public override Microsoft.Scripting.PlatformAdaptationLayer PlatformAdaptationLayer
+ {
+ get
+ {
+ return PathProviderPal.PAL;
+ }
+ }
+ }
+}
View
85 IronRubyMvc/Core/PathProviderPAL.cs
@@ -0,0 +1,85 @@
+#region Usings
+
+using System.IO;
+using System.Reflection;
+using System.Web.Mvc.IronRuby.Extensions;
+using Microsoft.Scripting;
+
+#endregion
+
+namespace System.Web.Mvc.IronRuby.Core
+{
+ public class PathProviderPal : PlatformAdaptationLayer
+ {
+ internal static PathProviderPal PAL = new PathProviderPal(new VirtualPathProvider());
+ private readonly IPathProvider _pathProvider;
+
+ protected PathProviderPal(IPathProvider pathProvider)
+ {
+ _pathProvider = pathProvider;
+ }
+
+ public override string CurrentDirectory
+ {
+ get { return _pathProvider.ApplicationPhysicalPath; }
+ }
+
+ internal static PathProviderPal Create(IPathProvider pathProvider)
+ {
+ pathProvider.EnsureArgumentNotNull("pathProvider");
+ PAL = new PathProviderPal(pathProvider);
+
+ return PAL;
+ }
+
+ public override bool DirectoryExists(string path)
+ {
+ return _pathProvider.DirectoryExists(path);
+ }
+
+ public override bool FileExists(string path)
+ {
+ return _pathProvider.FileExists(path);
+ }
+
+ public override string[] GetDirectories(string path, string searchPattern)
+ {
+ return _pathProvider.GetDirectories(path, searchPattern);
+ }
+
+ public override string[] GetFiles(string path, string searchPattern)
+ {
+ return _pathProvider.GetFiles(path, searchPattern);
+ }
+
+ public override string GetFullPath(string path)
+ {
+ return _pathProvider.GetFullPath(path);
+ }
+
+ public override bool IsAbsolutePath(string path)
+ {
+ return _pathProvider.IsAbsolutePath(path);
+ }
+
+ public override Stream OpenInputFileStream(string path)
+ {
+ return _pathProvider.Open(path);
+ }
+
+ public override Stream OpenInputFileStream(string path, FileMode mode, FileAccess access, FileShare share)
+ {
+ return _pathProvider.Open(path, mode, access, share);
+ }
+
+ public override Stream OpenInputFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize)
+ {
+ return _pathProvider.Open(path, mode, access, share, bufferSize);
+ }
+
+ public override Assembly LoadAssemblyFromPath(string path)
+ {
+ return base.LoadAssemblyFromPath(_pathProvider.MapPath(path));
+ }
+ }
+}
View
83 IronRubyMvc/Core/RubyEngine.cs
@@ -26,8 +26,6 @@ namespace System.Web.Mvc.IronRuby.Core
/// </summary>
public class RubyEngine : IRubyEngine
{
- private readonly Func<string, StreamContentProvider> _contentProviderFactory;
-
/// <summary>
/// Initializes a new instance of the <see cref="RubyEngine"/> class.
/// </summary>
@@ -37,15 +35,6 @@ public RubyEngine(ScriptRuntime runtime, IPathProvider pathProvider)
{
Runtime = runtime;
PathProvider = pathProvider;
- _contentProviderFactory = path => new VirtualPathStreamContentProvider(path);
- Initialize();
- }
-
- internal RubyEngine(ScriptRuntime runtime, IPathProvider pathProvider, Func<string, StreamContentProvider> contentProviderFactory)
- {
- Runtime = runtime;
- PathProvider = pathProvider;
- _contentProviderFactory = contentProviderFactory;
Initialize();
}
@@ -172,6 +161,51 @@ public object ExecuteScript(string script, ScriptScope scope)
return Engine.Execute(script, scope ?? CurrentScope);
}
+ public object ExecuteFile(string path, ScriptScope scope, bool throwIfNotExist)
+ {
+ path.EnsureArgumentNotNull("path");
+ scope.EnsureArgumentNotNull("scope");
+
+ if (throwIfNotExist && !PathProvider.FileExists(path)) throw new FileNotFoundException("Can't find the file", path);
+
+ if(!PathProvider.FileExists(path)) return null;
+
+ var source = Engine.CreateScriptSourceFromFile(path);
+
+ return source.Execute(scope);
+ }
+
+ public T ExecuteFile<T>(string path)
+ {
+ return (T) ExecuteFile(path);
+ }
+
+ public T ExecuteFile<T>(string path, bool throwIfNotExist)
+ {
+ return (T)ExecuteFile(path, CurrentScope, throwIfNotExist);
+ }
+
+
+ public T ExecuteScript<T>(string script)
+ {
+ return (T) ExecuteScript(script);
+ }
+
+ public T ExecuteScript<T>(string script, ScriptScope scope)
+ {
+ return (T) ExecuteScript(script, scope);
+ }
+
+ public T ExecuteFile<T>(string path, ScriptScope scope, bool throwIfNotExist)
+ {
+ return (T) ExecuteFile(path, scope, throwIfNotExist);
+ }
+
+ public object ExecuteFile(string path)
+ {
+ return Engine.ExecuteFile(path, CurrentScope);
+ }
+
/// <summary>
/// Defines the read only global variable.
/// </summary>
@@ -231,7 +265,7 @@ public void RequireRubyFile(string path)
public void RequireRubyFile(string path, ReaderType readerType)
{
Engine.CreateScriptSource(readerType == ReaderType.File
- ? _contentProviderFactory(path)
+ ? (StreamContentProvider)new VirtualPathStreamContentProvider(path)
: new AssemblyStreamContentProvider(path, typeof (IRubyEngine).Assembly), null, Encoding.ASCII).Execute();
}
@@ -262,7 +296,7 @@ private void Initialize()
private void RequireControllerFile()
{
// RequireRubyFile(PathProvider.MapPath("~/Controllers/controller.rb"));
- RequireRubyFile("System.Web.Mvc.IronRuby.Controllers.controller.rb", ReaderType.AssemblyResource);
+ Engine.CreateScriptSource(new AssemblyStreamContentProvider("System.Web.Mvc.IronRuby.Controllers.controller.rb", typeof(IRubyEngine).Assembly), null, Encoding.ASCII).Execute(CurrentScope);
}
/// <summary>
@@ -275,7 +309,7 @@ private void AddLoadPaths()
var filtersDir = Path.Combine(PathProvider.ApplicationPhysicalPath, Constants.Filters);
var helpersDir = Path.Combine(PathProvider.ApplicationPhysicalPath, Constants.Helpers);
- Context.Loader.SetLoadPaths(new[] {controllersDir, modelsDir, filtersDir, helpersDir});
+ Context.Loader.SetLoadPaths(new[] {PathProvider.ApplicationPhysicalPath, controllersDir, modelsDir, filtersDir, helpersDir});
}
@@ -286,40 +320,29 @@ private void AddLoadPaths()
/// <param name="routesPath">The routes path.</param>
public static RubyEngine InitializeIronRubyMvc(IPathProvider pathProvider, string routesPath)
{
- return InitializeIronRubyMvc(pathProvider, routesPath, path => new VirtualPathStreamContentProvider(path));
- }
-
- /// <summary>
- /// Initializes the ironruby MVC.
- /// </summary>
- /// <param name="pathProvider">The path provider.</param>
- /// <param name="routesPath">The routes path.</param>
- /// <param name="contentProviderFactory">The content provider factory.</param>
- /// <returns></returns>
- public static RubyEngine InitializeIronRubyMvc(IPathProvider pathProvider, string routesPath, Func<string, StreamContentProvider> contentProviderFactory)
- {
- var engine = InitializeIronRuby(pathProvider, contentProviderFactory);
+ var engine = InitializeIronRuby(pathProvider);
ProcessRubyRoutes(engine, pathProvider, routesPath);
IntializeMvc(pathProvider, engine);
return engine;
}
- private static void IntializeMvc(IPathProvider pathProvider, IRubyEngine engine)
+ 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));
}
- private static RubyEngine InitializeIronRuby(IPathProvider vpp, Func<string, StreamContentProvider> contentProviderFactory)
+ private static RubyEngine InitializeIronRuby(IPathProvider vpp)
{
var rubySetup = Ruby.CreateRubySetup();
var runtimeSetup = new ScriptRuntimeSetup();
runtimeSetup.LanguageSetups.Add(rubySetup);
runtimeSetup.DebugMode = true;
+// runtimeSetup.HostType = typeof (MvcScriptHost);
var runtime = Ruby.CreateRuntime(runtimeSetup);
- return new RubyEngine(runtime, vpp, contentProviderFactory);
+ return new RubyEngine(runtime, vpp);
}
private static void ProcessRubyRoutes(IRubyEngine engine, IPathProvider vpp, string routesPath)
View
14 IronRubyMvc/Core/RubyMvcApplication.cs
@@ -6,9 +6,21 @@ namespace System.Web.Mvc.IronRuby.Core
{
public class RubyMvcApplication : HttpApplication
{
+ public IRubyEngine RubyEngine
+ {
+ get
+ {
+ return Application["___RubyEngine"] as IRubyEngine;
+ }
+ set
+ {
+ Application["___RubyEngine"] = value;
+ }
+ }
protected void Application_Start(object sender, EventArgs e)
{
- RubyEngine.InitializeIronRubyMvc(new VirtualPathProvider(), "~/routes.rb");
+ var pathProvider = new VirtualPathProvider();
+ RubyEngine = Core.RubyEngine.InitializeIronRubyMvc(pathProvider, "~/routes.rb");
OnStart();
}
View
102 IronRubyMvc/Core/RubyMvcModule.cs
@@ -4,34 +4,116 @@ namespace System.Web.Mvc.IronRuby.Core
{
public class RubyMvcModule : IHttpModule
{
+
+ private IRubyEngine _rubyEngine;
+ private MvcApplication _mvcApplication;
+ private HttpApplication _application;
+
#region Implementation of IHttpModule
/// <summary>
- /// nitializes a module and prepares it to handle requests.
+ /// initializes a module and prepares it to handle requests.
/// </summary>
/// <param name="context">
/// An <see cref="T:System.Web.HttpApplication" /> that provides access to the methods, properties, and events common to all application objects within an ASP.NET application
/// </param>
public void Init(HttpApplication context)
{
- context.Error += context_Error;
+ context.EnsureArgumentNotNull("context");
+
+ if (!InitializeRubyEngine(context)) return;
+ if (!InitializeRubyApplication(context)) return;
+ InitializeRubyApplicationHooks(context);
+
+ _application = context;
+ }
+
+ private void InitializeRubyApplicationHooks(HttpApplication context)
+ {
+ if (_mvcApplication.IsNull()) return;
+
+ context.Error += (sender, args) => _mvcApplication.Error(sender, args);
+ context.AcquireRequestState += (sender, args) => _mvcApplication.AcquireRequestState(sender, args);
+ context.AuthenticateRequest += (sender, args) => _mvcApplication.AuthenticateRequest(sender, args);
+ context.AuthorizeRequest += (sender, args) => _mvcApplication.AuthorizeRequest(sender, args);
+ context.BeginRequest += (sender, args) => _mvcApplication.BeginRequest(sender, args);
+ context.Disposed += (sender, args) => _mvcApplication.Disposed(sender, args);
+ context.EndRequest += (sender, args) => _mvcApplication.EndRequest(sender, args);
+ context.LogRequest += (sender, args) => _mvcApplication.LogRequest(sender, args);
+ context.PostAcquireRequestState += (sender, args) => _mvcApplication.PostAcquireRequestState(sender, args);
+ context.MapRequestHandler += (sender, args) => _mvcApplication.MapRequestHandler(sender, args);
+ context.PostAuthenticateRequest += (sender, args) => _mvcApplication.PostAuthenticateRequest(sender, args);
+ context.PostAuthorizeRequest += (sender, args) => _mvcApplication.PostAuthorizeRequest(sender, args);
+ context.PostLogRequest += (sender, args) => _mvcApplication.PostLogRequest(sender, args);
+ context.PostMapRequestHandler += (sender, args) => _mvcApplication.PostMapRequestHandler(sender, args);
+ context.PostReleaseRequestState += (sender, args) => _mvcApplication.PostReleaseRequestState(sender, args);
+ context.PostRequestHandlerExecute += (sender, args) => _mvcApplication.PostRequestHandlerExecute(sender, args);
+ context.PostResolveRequestCache += (sender, args) => _mvcApplication.PostResolveRequestCache(sender, args);
+ context.PostUpdateRequestCache += (sender, args) => _mvcApplication.PostUpdateRequestCache(sender, args);
+ context.PreRequestHandlerExecute += (sender, args) => _mvcApplication.PreRequestHandlerExecute(sender, args);
+ context.PreSendRequestContent += (sender, args) => _mvcApplication.PreSendRequestContent(sender, args);
+ context.PreSendRequestHeaders += (sender, args) => _mvcApplication.PreSendRequestHeaders(sender, args);
+ context.ReleaseRequestState += (sender, args) => _mvcApplication.ReleaseRequestState(sender, args);
+ context.ResolveRequestCache += (sender, args) => _mvcApplication.ResolveRequestCache(sender, args);
+ context.UpdateRequestCache += (sender, args) => _mvcApplication.UpdateRequestCache(sender, args);
+
}
- void context_Error(object sender, EventArgs e)
+ private bool InitializeRubyApplication(HttpApplication context)
{
- var application = sender as RubyMvcApplication;
- if(sender.IsNotNull())
- {
- application.Context.Error
- }
+ if (_mvcApplication.IsNotNull()) return false;
+
+ _mvcApplication = _rubyEngine.ExecuteFile<MvcApplication>("~/mvc_application.rb", false);
+ if(_mvcApplication.IsNotNull()) _mvcApplication.Start(context, EventArgs.Empty);
+ return true;
}
+ 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;
+ }
+
+
/// <summary>
- /// Disposes of the resources (other than memory) used by the module that implements <see cref="T:System.Web.IHttpModule" />.
+ /// Disposes of the resources (other than memory) used by the module that implements <see cref="T:System.Web.IHttpModule" />.
/// </summary>
public void Dispose()
{
- throw new System.NotImplementedException();
+ if (_application.IsNull()) return;
+
+ _application.Error -= (sender, args) => _mvcApplication.Error(sender, args);
+ _application.AcquireRequestState -= (sender, args) => _mvcApplication.AcquireRequestState(sender, args);
+ _application.AuthenticateRequest -= (sender, args) => _mvcApplication.AuthenticateRequest(sender, args);
+ _application.AuthorizeRequest -= (sender, args) => _mvcApplication.AuthorizeRequest(sender, args);
+ _application.BeginRequest -= (sender, args) => _mvcApplication.BeginRequest(sender, args);
+ _application.Disposed -= (sender, args) => _mvcApplication.Disposed(sender, args);
+ _application.EndRequest -= (sender, args) => _mvcApplication.EndRequest(sender, args);
+ _application.LogRequest -= (sender, args) => _mvcApplication.LogRequest(sender, args);
+ _application.PostAcquireRequestState -= (sender, args) => _mvcApplication.PostAcquireRequestState(sender, args);
+ _application.MapRequestHandler -= (sender, args) => _mvcApplication.MapRequestHandler(sender, args);
+ _application.PostAuthenticateRequest -= (sender, args) => _mvcApplication.PostAuthenticateRequest(sender, args);
+ _application.PostAuthorizeRequest -= (sender, args) => _mvcApplication.PostAuthorizeRequest(sender, args);
+ _application.PostLogRequest -= (sender, args) => _mvcApplication.PostLogRequest(sender, args);
+ _application.PostMapRequestHandler -= (sender, args) => _mvcApplication.PostMapRequestHandler(sender, args);
+ _application.PostReleaseRequestState -= (sender, args) => _mvcApplication.PostReleaseRequestState(sender, args);
+ _application.PostRequestHandlerExecute -= (sender, args) => _mvcApplication.PostRequestHandlerExecute(sender, args);
+ _application.PostResolveRequestCache -= (sender, args) => _mvcApplication.PostResolveRequestCache(sender, args);
+ _application.PostUpdateRequestCache -= (sender, args) => _mvcApplication.PostUpdateRequestCache(sender, args);
+ _application.PreRequestHandlerExecute -= (sender, args) => _mvcApplication.PreRequestHandlerExecute(sender, args);
+ _application.PreSendRequestContent -= (sender, args) => _mvcApplication.PreSendRequestContent(sender, args);
+ _application.PreSendRequestHeaders -= (sender, args) => _mvcApplication.PreSendRequestHeaders(sender, args);
+ _application.ReleaseRequestState -= (sender, args) => _mvcApplication.ReleaseRequestState(sender, args);
+ _application.ResolveRequestCache -= (sender, args) => _mvcApplication.ResolveRequestCache(sender, args);
+ _application.UpdateRequestCache -= (sender, args) => _mvcApplication.UpdateRequestCache(sender, args);
}
#endregion
View
36 IronRubyMvc/Core/TypeConverter.cs
@@ -0,0 +1,36 @@
+namespace System.Web.Mvc.IronRuby.Core
+{
+ public class TypeConverter
+ {
+ public static T ConvertTo<T>(object value)
+ {
+ return (T)ConvertType(value, typeof(T));
+ }
+
+ public static object ConvertType(object value, Type targetType)
+ {
+ if (value == null)
+ return null;
+
+ if (value.GetType() == targetType)
+ return value;
+
+ if (targetType.IsValueType)
+ {
+ if (!targetType.IsGenericType)
+ {
+ return targetType.IsEnum ? Enum.ToObject(targetType, value) : Convert.ChangeType(value, targetType);
+ }
+
+ if (targetType.GetGenericTypeDefinition() == typeof(Nullable<>))
+ {
+ var realType = targetType.GetGenericArguments()[0];
+
+ return ConvertType(value, realType);
+ }
+ }
+
+ return Convert.ChangeType(value, targetType);
+ }
+ }
+}
View
36 IronRubyMvc/Core/VirtualPathProvider.cs
@@ -14,9 +14,25 @@ public class VirtualPathProvider : IPathProvider
public bool FileExists(string filePath)
{
+
return HostingEnvironment.VirtualPathProvider.FileExists(filePath);
}
+ public bool DirectoryExists(string dirPath)
+ {
+ return HostingEnvironment.VirtualPathProvider.DirectoryExists(dirPath);
+ }
+
+ public string[] GetDirectories(string path, string searchPattern)
+ {
+ return Directory.GetDirectories(HostingEnvironment.MapPath(path) ?? ApplicationPhysicalPath, searchPattern);
+ }
+
+ public string[] GetFiles(string path, string searchPattern)
+ {
+ return Directory.GetFiles(HostingEnvironment.MapPath(path) ?? ApplicationPhysicalPath, searchPattern);
+ }
+
public Stream Open(string filePath)
{
var file = HostingEnvironment.VirtualPathProvider.GetFile(filePath);
@@ -28,6 +44,26 @@ public string MapPath(string filePath)
return HostingEnvironment.MapPath(filePath);
}
+ public bool IsAbsolutePath(string path)
+ {
+ return new Uri(GetFullPath(path), UriKind.RelativeOrAbsolute).IsAbsoluteUri;
+ }
+
+ public string GetFullPath(string path)
+ {
+ return path.Replace(Path.DirectorySeparatorChar, '/');
+ }
+
+ public Stream Open(string path, FileMode mode, FileAccess access, FileShare share)
+ {
+ return new FileStream(MapPath(path), mode, access, share);
+ }
+
+ public Stream Open(string path, FileMode mode, FileAccess access, FileShare share, int size)
+ {
+ return new FileStream(MapPath(path), mode, access, share, size);
+ }
+
public string ApplicationPhysicalPath
{
get { return HostingEnvironment.ApplicationPhysicalPath; }
View
11 IronRubyMvc/Extensions/IDictionaryExtensions.cs
@@ -1,11 +1,13 @@
-#region Usings
+extern alias clr3;
+
+#region Usings
using System.Collections;
using System.Collections.Generic;
using System.Web.Routing;
using IronRuby.Builtins;
using Microsoft.Scripting;
-
+using clr3::System.Linq;
#endregion
namespace System.Web.Mvc.IronRuby.Extensions
@@ -67,7 +69,10 @@ private static IEnumerable<TITarget> ToFilters<TITarget>(this IDictionary<object
var filters = new List<TITarget>();
var key = SymbolTable.StringToId(actionName);
var hasKey = filterDescriptions.ContainsKey(key);
- if (hasKey) filters.AddRange((filterDescriptions[key] as RubyArray).Cast<TITarget>());
+ if (hasKey)
+ {
+ filters.AddRange((filterDescriptions[key] as RubyArray).Cast<TITarget>());
+ }
return filters;
}
View
143 IronRubyMvc/Extensions/IEnumerableExtensions.cs
@@ -30,6 +30,7 @@ public static void ForEach(this IEnumerable collection, Action<object> action)
[SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "o")]
public static bool IsEmpty<T>(this IEnumerable<T> collection)
{
+ // not guarding for null foreach does that for me
foreach (var o in collection)
{
return false;
@@ -40,41 +41,15 @@ public static bool IsEmpty<T>(this IEnumerable<T> collection)
[SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "o")]
public static bool IsEmpty(this IEnumerable collection)
{
+ // not guarding for null, foreach does that for me
foreach (var o in collection)
{
return false;
}
return true;
}
- public static bool Contains<T>(this IEnumerable<T> collection, T value)
- {
- foreach (var t in collection)
- {
- if ((t.IsNull() && value.IsNull()) || (t.IsNotNull() && t.Equals(value))) return true;
- }
- return false;
- }
-
- public static bool DoesNotContain<T>(this IEnumerable<T> collection, T value)
- {
- foreach (var t in collection)
- {
- if (t.Equals(value)) return false;
- }
- return true;
- }
-
- public static bool DoesNotContain(this IEnumerable collection, object value)
- {
- foreach (var t in collection)
- {
- if (t.Equals(value)) return false;
- }
- return true;
- }
-
- public static bool DoesNotContain<TSource>(this IEnumerable<TSource> collection, Func<TSource, bool> predicate)
+ internal static bool DoesNotContain<TSource>(this IEnumerable<TSource> collection, Func<TSource, bool> predicate)
{
foreach (var o in collection)
{
@@ -83,88 +58,6 @@ public static bool DoesNotContain<TSource>(this IEnumerable<TSource> collection,
return true;
}
- public static bool Contains(this IEnumerable collection, Predicate<object> predicate)
- {
- foreach (var o in collection)
- {
- if (predicate(o)) return true;
- }
- return false;
- }
-
- public static bool Contains(this IEnumerable collection, object value)
- {
- foreach (var t in collection)
- {
- if (t.Equals(value)) return true;
- }
- return false;
- }
-
- public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> collection, Predicate<TSource> predicate)
- {
- foreach (var source in collection)
- {
- if (predicate(source)) yield return source;
- }
- }
-
- public static TSource FirstOrDefault<TSource>(this IEnumerable<TSource> collection, Predicate<TSource> predicate)
- {
- foreach (var source in collection)
- {
- if (predicate(source)) return source;
- }
- return default(TSource);
- }
-
- public static TSource FirstOrDefault<TSource>(this IEnumerable<TSource> collection)
- {
- foreach (var source in collection)
- {
- return source;
- }
- return default(TSource);
- }
-
- public static bool All<TSource>(this IEnumerable<TSource> collection, Predicate<TSource> predicate)
- {
- foreach (var source in collection)
- {
- if (!predicate(source)) return false;
- }
- return true;
- }
-
- public static bool Any<TSource>(this IEnumerable<TSource> collection, Predicate<TSource> predicate)
- {
- foreach (var source in collection)
- {
- if (predicate(source)) return true;
- }
- return false;
- }
-
- public static IEnumerable Where(this IEnumerable collection, Predicate<object> predicate)
- {
- foreach (var source in collection)
- {
- if (predicate(source)) yield return source;
- }
- }
-
-
- internal static IEnumerable<TTarget> Cast<TTarget>(this IEnumerable collection) where TTarget : class
- {
- var result = new List<TTarget>();
- collection.ForEach(item =>
- {
- var casted = (typeof (TTarget) == typeof (string)) ? item.ToString() as TTarget : item as TTarget;
- if (casted.IsNotNull()) result.Add(casted);
- });
- return result;
- }
-
internal static IEnumerable<TTarget> Map<TSource, TTarget>(this IEnumerable<TSource> collection, Func<TSource, TTarget> iterator)
{
foreach (var source in collection)
@@ -181,36 +74,6 @@ internal static IEnumerable Map(this IEnumerable collection, Func<object, object
}
}
- internal static int Count(this IEnumerable collection)
- {
- var count = 0;
- foreach (var o in collection)
- {
- count++;
- }
- return count;
- }
-
- internal static int Count<TSource>(this IEnumerable<TSource> collection, Predicate<TSource> predicate)
- {
- var count = 0;
- foreach (var o in collection)
- {
- if (predicate(o)) count++;
- }
- return count;
- }
-
- internal static TSource[] ToArray<TSource>(this IEnumerable<TSource> collection)
- {
- var result = new TSource[collection.Count()];
- var idx = 0;
-
- collection.ForEach(item => result[idx++] = item);
-
- return result;
- }
-
internal static IEnumerable<SelectListItem> ToSelectListItemList(this IEnumerable collection)
{
var result = new List<SelectListItem>();
View
11 IronRubyMvc/Extensions/ObjectExtensions.cs
@@ -1,8 +1,10 @@
+extern alias clr3;
#region Usings
using System.Collections.Generic;
using IronRuby.Builtins;
-
+using Microsoft.Scripting.Runtime;
+using clr3::System.Linq;
#endregion
namespace System.Web.Mvc.IronRuby.Extensions
@@ -41,11 +43,16 @@ public static bool IsNull(this object value)
/// </summary>
/// <param name="value">The value.</param>
/// <param name="argumentName">Name of the argument.</param>
- public static void EnsureArgumentNotNull(this object value, string argumentName)
+ internal static void EnsureArgumentNotNull(this object value, string argumentName)
{
if (value.IsNull()) throw new ArgumentNullException(argumentName, "Cannot be null");
}
+ /// <summary>
+ /// Converts the object to a string collection.
+ /// </summary>
+ /// <param name="value">The value.</param>
+ /// <returns></returns>
internal static IEnumerable<string> ToStringCollection(this object value)
{
var array = (RubyArray) value;
View
6 IronRubyMvc/Extensions/StringExtensions.cs
@@ -52,7 +52,7 @@ public static string FormattedWith(this string value, params object[] parameters
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
- public static SymbolId ToSymbolId(this string value)
+ internal static SymbolId ToSymbolId(this string value)
{
return ToSymbolId(value, true);
}
@@ -63,7 +63,7 @@ public static SymbolId ToSymbolId(this string value)
/// <param name="value">The value.</param>
/// <param name="caseSensitive">if set to <c>true</c> the <see cref="SymbolId"/> will be case-sensitive.</param>
/// <returns></returns>
- public static SymbolId ToSymbolId(this string value, bool caseSensitive)
+ internal static SymbolId ToSymbolId(this string value, bool caseSensitive)
{
return caseSensitive ? SymbolTable.StringToId(value) : SymbolTable.StringToCaseInsensitiveId(value);
}
@@ -73,7 +73,7 @@ public static SymbolId ToSymbolId(this string value, bool caseSensitive)
/// </summary>
/// <param name="value">The value.</param>
/// <param name="argumentName">Name of the argument.</param>
- public static void EnsureArgumentNotEmpty(this string value, string argumentName)
+ internal static void EnsureArgumentNotEmpty(this string value, string argumentName)
{
if (value.IsNullOrBlank()) throw new ArgumentNullException(argumentName, "Cannot be null");
}
View
10 IronRubyMvc/Helpers/RubyAjaxHelper.cs
@@ -1,10 +1,13 @@
-using System.Collections.Generic;
+#region Usings
+
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Mvc.IronRuby.Extensions;
using System.Web.Routing;
using IronRuby.Builtins;
+#endregion
+
namespace System.Web.Mvc.IronRuby.Helpers
{
public class RubyAjaxHelper : AjaxHelper
@@ -51,7 +54,8 @@ public string ActionLink(string linkText, string actionName, string controllerNa
return _helper.ActionLink(linkText, actionName, controllerName, routeValues.ToRouteDictionary(), ajaxOptions, htmlAttributes.ToDictionary());
}
- public string ActionLink(string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, Hash routeValues, AjaxOptions ajaxOptions, Hash htmlAttributes)
+ public string ActionLink(string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, Hash routeValues, AjaxOptions ajaxOptions,
+ Hash htmlAttributes)
{
return _helper.ActionLink(linkText, actionName, controllerName, protocol, hostName, fragment, routeValues.ToRouteDictionary(), ajaxOptions, htmlAttributes.ToDictionary());
}
@@ -136,7 +140,5 @@ public string RouteLink(string linkText, string routeName, Hash routeValues, Aja
{
return _helper.RouteLink(linkText, routeName, routeValues.ToRouteDictionary(), ajaxOptions, htmlAttributes.ToDictionary());
}
-
-
}
}
View
15 IronRubyMvc/System.Web.Mvc.IronRuby.csproj
@@ -77,6 +77,10 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ <Aliases>clr3</Aliases>
+ </Reference>
<Reference Include="System.Web" />
<Reference Include="System.Data" />
<Reference Include="System.Web.Abstractions">
@@ -103,14 +107,23 @@
<Compile Include="Controllers\RubyResultFilter.cs" />
<Compile Include="Core\Constants.cs" />
<Compile Include="Core\Enums.cs" />
- <Compile Include="Core\RubyMvcApplication.cs" />
+ <Compile Include="Core\MvcApplication.cs" />
+ <Compile Include="Core\MvcScriptHost.cs" />
+ <Compile Include="Core\PathProviderPAL.cs" />
+ <Compile Include="Core\RubyMvcApplication.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Core\RubyMvcModule.cs">
+ <SubType>Code</SubType>
+ </Compile>
<Compile Include="Core\RubyRoutes.cs" />
<Compile Include="Controllers\RubyActionDescriptor.cs" />
<Compile Include="Controllers\RubyController.cs" />
<Compile Include="Controllers\RubyControllerActionInvoker.cs" />
<Compile Include="Controllers\RubyControllerDescriptor.cs" />
<Compile Include="Controllers\RubyControllerFactory.cs" />
<Compile Include="Core\RubyEngine.cs" />
+ <Compile Include="Core\TypeConverter.cs" />
<Compile Include="Core\VirtualPathProvider.cs" />
<Compile Include="Core\VirtualPathStreamContentProvider.cs" />
<Compile Include="Extensions\FilterInfoExtensions.cs" />
View
2 IronRubyMvcWeb/Default.aspx
@@ -1,3 +1,3 @@
<%@ Page Language="C#" %>
<%
- Response.Redirect("~/Home");%>
+Response.Redirect("~/Home");%>
View
2 IronRubyMvcWeb/Web.config
@@ -80,6 +80,7 @@
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
+<!-- <add name="RubyMvcModule" type="System.Web.Mvc.IronRuby.Core.RubyMvcModule, System.Web.Mvc.IronRuby"/>-->
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
@@ -109,6 +110,7 @@
<modules runAllManagedModulesForAllRequests="true">
<remove name="ScriptModule"/>
<remove name="UrlRoutingModule"/>
+<!-- <add name="RubyMvcModule" type="System.Web.Mvc.IronRuby.Core.RubyMvcModule, System.Web.Mvc.IronRuby"/>-->
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
View
BIN dependencies/IronRuby.Libraries.Yaml.dll
Binary file not shown.
View
BIN dependencies/IronRuby.Libraries.Yaml.pdb
Binary file not shown.
View
BIN dependencies/IronRuby.Libraries.dll
Binary file not shown.
View
BIN dependencies/IronRuby.Libraries.pdb
Binary file not shown.
View
BIN dependencies/IronRuby.dll
Binary file not shown.
View
BIN dependencies/IronRuby.pdb
Binary file not shown.
View
BIN dependencies/Microsoft.Scripting.Core.dll
Binary file not shown.
View
BIN dependencies/Microsoft.Scripting.Core.pdb
Binary file not shown.
View
BIN dependencies/Microsoft.Scripting.ExtensionAttribute.dll
Binary file not shown.
View
BIN dependencies/Microsoft.Scripting.ExtensionAttribute.pdb
Binary file not shown.
View
BIN dependencies/Microsoft.Scripting.dll
Binary file not shown.
View
BIN dependencies/Microsoft.Scripting.pdb
Binary file not shown.
View
BIN dependencies/xUnit.BDDExtensions.dll
Binary file not shown.
View
BIN dependencies/xUnit.BDDExtensions.pdb
Binary file not shown.
View
BIN dependencies/xunit.dll
Binary file not shown.
View
14 dependencies/xunit.xml
@@ -1486,14 +1486,7 @@
<summary>
Creates a new instance of the <see cref="T:Xunit.Sdk.AssemblyResult"/> class.
</summary>
- <param name="assemblyFilename">The filename of the assembly</param>
- </member>
- <member name="M:Xunit.Sdk.AssemblyResult.#ctor(System.String,System.String)">
- <summary>
- Creates a new instance of the <see cref="T:Xunit.Sdk.AssemblyResult"/> class.
- </summary>
- <param name="assemblyFilename">The filename of the assembly</param>
- <param name="configFilename">The configuration filename</param>
+ <param name="filename">The filename of the assembly</param>
</member>
<member name="M:Xunit.Sdk.AssemblyResult.ToXml(System.Xml.XmlNode)">
<summary>
@@ -1502,11 +1495,6 @@
<param name="parentNode">The parent node.</param>
<returns>The newly created XML node.</returns>
</member>
- <member name="P:Xunit.Sdk.AssemblyResult.ConfigFilename">
- <summary>
- Gets the fully qualified filename of the configuration file.
- </summary>
- </member>
<member name="P:Xunit.Sdk.AssemblyResult.Directory">
<summary>
Gets the directory where the assembly resides.

0 comments on commit 39143f0

Please sign in to comment.