Permalink
Browse files

Support Serfs Decoders, rexml example, clean up, improved File suppor…

…t, commit prior to refactoring boostrap
  • Loading branch information...
1 parent da13ec2 commit f2a4bfb075d6ceb1dad1de52534adf30a6f04604 @rifraf committed May 2, 2010
Showing with 442 additions and 92 deletions.
  1. +8 −1 .gitignore
  2. +34 −0 ExampleApps/Applications/file_accesses.rb
  3. +26 −0 ExampleApps/Applications/mydoc.xml
  4. +33 −0 ExampleApps/Applications/test_rexml.rb
  5. +17 −0 ExampleApps/ExampleApps.csproj
  6. +26 −1 ExampleApps/Program.cs
  7. BIN ExampleApps/bin/ExampleApps.exe
  8. BIN ExampleApps/bin/ExampleApps.pdb
  9. BIN ExampleApps/bin/ExampleApps.vshost.exe
  10. BIN ExampleApps/bin/IREmbeddedApp.dll
  11. BIN ExampleApps/bin/IREmbeddedApp.pdb
  12. BIN ExampleApps/bin/IRTestResources.dll
  13. BIN ExampleApps/bin/IRTestResources.pdb
  14. BIN ExampleApps/bin/Serfs.dll
  15. +5 −1 IREmbeddedApp.sln
  16. BIN IREmbeddedApp.suo
  17. +21 −7 IREmbeddedApp/EmbeddedRuby.cs
  18. +100 −3 IREmbeddedApp/EmbeddedRuby/bootstrap.rb
  19. +5 −0 IREmbeddedApp/IREmbeddedApp.csproj
  20. +13 −13 IREmbeddedApp/Properties/AssemblyInfo.cs
  21. +34 −0 IREmbeddedApp/Properties/AssemblyInfo_in.cs
  22. BIN IREmbeddedApp/Serfs.dll
  23. +5 −0 IREmbeddedLibraries/IREmbeddedLibraries.csproj
  24. +13 −13 IREmbeddedLibraries/Properties/AssemblyInfo.cs
  25. +34 −0 IREmbeddedLibraries/Properties/AssemblyInfo_in.cs
  26. +20 −0 IRSinatra/IRSinatra.csproj
  27. BIN IRSinatra/bin/IREmbeddedApp.dll
  28. BIN IRSinatra/bin/IREmbeddedApp.pdb
  29. BIN IRSinatra/bin/IREmbeddedLibraries.dll
  30. BIN IRSinatra/bin/IREmbeddedLibraries.pdb
  31. BIN IRSinatra/bin/IRSinatra.exe
  32. BIN IRSinatra/bin/IRSinatra.pdb
  33. BIN IRSinatra/bin/IRTestResources.pdb
  34. BIN IRSinatra/bin/Serfs.dll
  35. BIN IRSinatra/bin/merge/IRSinatra.exe
  36. BIN IRSinatra/bin/merge/IRSinatra.pdb
  37. +0 −50 README
  38. +46 −0 README.textile
  39. +2 −3 code_style.xml
View
9 .gitignore
@@ -1,13 +1,20 @@
+.svn
+prebuild.bat
+postbuild.bat
_ReSharper.IREmbeddedApp/*
ExampleApps/obj/
+ExampleApps/bin/
IREmbeddedApp/bin/
IREmbeddedApp/obj/
IRTestResources/bin/
IRTestResources/obj/
IREmbeddedLibraries/bin/
IREmbeddedLibraries/obj/
IRSinatra/obj/
+IRSinatra/bin/
IREmbeddedApp.4.5.resharper
IREmbeddedApp.4.5.resharper.user
**/Iron*.dll
-**/Micro*.dll
+**/Micro*.dll
+**/*.pdb
+**/*.suo
View
34 ExampleApps/Applications/file_accesses.rb
@@ -0,0 +1,34 @@
+# Sample code for reading embedded resource files
+
+# SerfSupp.Debug = true
+
+# File.stat support
+stat = File.stat("mydoc.xml")
+puts "File time: #{stat.mtime}"
+puts "File size: #{stat.size}"
+
+# Read a file in text mode
+puts "Text mode:"
+f = File.new("mydoc.xml")
+p f.readline
+f.rewind
+p f.readline
+count = 1
+until f.eof?
+ count += 1
+ f.readline
+end
+puts "#{count} lines read"
+
+# Read a file in binary mode
+puts "Binary mode:"
+f = File.new("mydoc.xml", 'rb')
+p f.readline
+f.rewind
+p f.readline
+count = 1
+until f.eof?
+ count += 1
+ f.readline
+end
+puts "#{count} lines read"
View
26 ExampleApps/Applications/mydoc.xml
@@ -0,0 +1,26 @@
+<inventory title="OmniCorp Store #45x10^3">
+ <section name="health">
+ <item upc="123456789" stock="12">
+ <name>Invisibility Cream</name>
+ <price>14.50</price>
+ <description>Makes you invisible</description>
+ </item>
+ <item upc="445322344" stock="18">
+ <name>Levitation Salve</name>
+ <price>23.99</price>
+ <description>Levitate yourself for up to 3 hours per application</description>
+ </item>
+ </section>
+ <section name="food">
+ <item upc="485672034" stock="653">
+ <name>Blork and Freen Instameal</name>
+ <price>4.95</price>
+ <description>A tasty meal in a tablet; just add water</description>
+ </item>
+ <item upc="132957764" stock="44">
+ <name>Grob winglets</name>
+ <price>3.56</price>
+ <description>Tender winglets of Grob. Just add water</description>
+ </item>
+ </section>
+</inventory>
View
33 ExampleApps/Applications/test_rexml.rb
@@ -0,0 +1,33 @@
+# Sample code from http://germane-software.com/software/rexml/docs/tutorial.html
+
+require "rexml/document"
+include REXML
+
+# Simple string load/write
+string = <<EOF
+ <mydoc>
+ <someelement attribute="nanoo">Text, text, text</someelement>
+ </mydoc>
+EOF
+doc = Document.new(string)
+doc.write $stdout
+
+doc = Document.new File.new("mydoc.xml")
+doc.elements.each("inventory/section") { |element| puts element.attributes["name"] }
+# -> health
+# -> food
+doc.elements.each("*/section/item") { |element| puts element.attributes["upc"] }
+# -> 123456789
+# -> 445322344
+# -> 485672034
+# -> 132957764
+root = doc.root
+puts root.attributes["title"]
+# -> OmniCorp Store #45x10^3
+puts root.elements["section/item[@stock='44']"].attributes["upc"]
+# -> 132957764
+puts root.elements["section"].attributes["name"]
+# -> health (returns the first encountered matching element)
+puts root.elements[1].attributes["name"]
+# -> health (returns the FIRST child element)
+root.detect {|node| node.kind_of? Element and node.attributes["name"] == "food" }
View
17 ExampleApps/ExampleApps.csproj
@@ -32,6 +32,14 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\IREmbeddedApp\bin\IREmbeddedApp.dll</HintPath>
</Reference>
+ <Reference Include="IREmbeddedLibraries, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\IREmbeddedLibraries\bin\IREmbeddedLibraries.dll</HintPath>
+ </Reference>
+ <Reference Include="IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>C:\Program Files\IronRuby 1.0\bin\IronRuby.Libraries.dll</HintPath>
+ </Reference>
<Reference Include="IRTestResources, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\IRTestResources\bin\IRTestResources.dll</HintPath>
@@ -60,6 +68,15 @@
<ItemGroup>
<EmbeddedResource Include="Applications\list_args.rb" />
</ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Applications\test_rexml.rb" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Applications\mydoc.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Applications\file_accesses.rb" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
27 ExampleApps/Program.cs
@@ -8,7 +8,7 @@ class Program {
static int Main(string[] args) {
int exitcode = 0;
- // First application : bottles
+ // bottles
Console.WriteLine("bottles.rb");
Console.WriteLine("----------");
try {
@@ -32,6 +32,31 @@ class Program {
}
Console.WriteLine();
+ // file access
+ Console.WriteLine("file_accesses.rb");
+ Console.WriteLine("----------------");
+ try {
+ EmbeddedRuby er1 = new EmbeddedRuby();
+ er1.Mount("Applications");
+ exitcode = er1.Run("file_accesses.rb");
+ } catch (Exception e) {
+ Console.WriteLine(e.Message);
+ }
+ Console.WriteLine();
+return 1;
+ // rexml
+ Console.WriteLine("test_rexml.rb");
+ Console.WriteLine("-------------");
+ try {
+ EmbeddedRuby er1 = new EmbeddedRuby();
+ er1.Mount("Applications");
+ er1.AddAssembly("IREmbeddedLibraries").Mount("Files/site_ruby/1.8").Mount("Files/1.8");
+ exitcode = er1.Run("test_rexml.rb");
+ } catch (Exception e) {
+ Console.WriteLine(e.Message);
+ }
+ Console.WriteLine();
+
// Demo of test::unit
Console.WriteLine("test_unit_app.rb");
Console.WriteLine("----------------");
View
BIN ExampleApps/bin/ExampleApps.exe
Binary file not shown.
View
BIN ExampleApps/bin/ExampleApps.pdb
Binary file not shown.
View
BIN ExampleApps/bin/ExampleApps.vshost.exe
Binary file not shown.
View
BIN ExampleApps/bin/IREmbeddedApp.dll
Binary file not shown.
View
BIN ExampleApps/bin/IREmbeddedApp.pdb
Binary file not shown.
View
BIN ExampleApps/bin/IRTestResources.dll
Binary file not shown.
View
BIN ExampleApps/bin/IRTestResources.pdb
Binary file not shown.
View
BIN ExampleApps/bin/Serfs.dll
Binary file not shown.
View
6 IREmbeddedApp.sln
@@ -7,8 +7,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IRTestResources", "IRTestRe
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleApps", "ExampleApps\ExampleApps.csproj", "{F81E1902-C72C-4457-A526-A49AE80FEA1F}"
ProjectSection(ProjectDependencies) = postProject
- {9FE6381A-B2E1-4B08-A9CC-F62CD14B719C} = {9FE6381A-B2E1-4B08-A9CC-F62CD14B719C}
{252B7E48-4D69-4AAF-AB8F-BCA432D0BF2E} = {252B7E48-4D69-4AAF-AB8F-BCA432D0BF2E}
+ {68CBAEDA-18CC-4CC0-8555-942890512EF8} = {68CBAEDA-18CC-4CC0-8555-942890512EF8}
+ {9FE6381A-B2E1-4B08-A9CC-F62CD14B719C} = {9FE6381A-B2E1-4B08-A9CC-F62CD14B719C}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IRSinatra", "IRSinatra\IRSinatra.csproj", "{499B4084-8BA3-4B33-A146-CA32D078D961}"
@@ -18,6 +19,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IRSinatra", "IRSinatra\IRSi
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IREmbeddedLibraries", "IREmbeddedLibraries\IREmbeddedLibraries.csproj", "{68CBAEDA-18CC-4CC0-8555-942890512EF8}"
+ ProjectSection(ProjectDependencies) = postProject
+ {252B7E48-4D69-4AAF-AB8F-BCA432D0BF2E} = {252B7E48-4D69-4AAF-AB8F-BCA432D0BF2E}
+ EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
View
BIN IREmbeddedApp.suo
Binary file not shown.
View
28 IREmbeddedApp/EmbeddedRuby.cs
@@ -11,11 +11,25 @@
namespace IREmbeddedApp {
public class EmbeddedRuby {
private readonly Serfs _serfs;
+ private ScriptRuntime _runtime;
+ private ScriptEngine _engine;
+ private RubyContext _context;
public EmbeddedRuby() {
_serfs = new Serfs(null);
_serfs.IgnoreMissingAssemblies = true;
AddAssembly("IREmbeddedApp", "EmbeddedRuby");
+ Reset();
+ }
+
+ public void Reset() {
+ _runtime = Ruby.CreateRuntime();
+ _engine = _runtime.GetEngine("rb");
+ _context = (RubyContext)HostingHelpers.GetLanguageContext(_engine);
+ }
+
+ public IStreamDecoder Decoder {
+ set { _serfs.Decoder = value; }
}
public AssemblyInfo Mount(string topFolder) {
@@ -34,15 +48,16 @@ public class EmbeddedRuby {
return info;
}
+ public void SetConstant(string name, object obj) {
+ _context.ObjectClass.SetConstant(name, obj);
+ }
+
public int Run(string app) {
return Run(app, null);
}
public int Run(string app, string[] args) {
- ScriptRuntime runtime = Ruby.CreateRuntime();
- ScriptEngine engine = runtime.GetEngine("rb");
- RubyContext context = (RubyContext)HostingHelpers.GetLanguageContext(engine);
- context.ObjectClass.SetConstant("SerfsInstance", _serfs);
+ SetConstant("SerfsInstance", _serfs);
// Sort out ARGV
string argv;
@@ -57,13 +72,12 @@ public class EmbeddedRuby {
}
// Prefix bootstrap with $0 and ARGV
string boot = String.Format(
- //"$0='S:/{0}'\r\n{1}{2}",
"$0='/{0}' {1}{2}",
app, argv, _serfs.Read("bootstrap.rb")
);
- ScriptSource source = engine.CreateScriptSourceFromString(boot, "bootstrap.rb", SourceCodeKind.File);
+ ScriptSource source = _engine.CreateScriptSourceFromString(boot, "bootstrap.rb", SourceCodeKind.File);
int ex = source.ExecuteProgram();
- context.Shutdown();
+ _context.Shutdown();
return ex;
}
}
View
103 IREmbeddedApp/EmbeddedRuby/bootstrap.rb
@@ -9,7 +9,11 @@
module SerfSupp
def self.Debug
- false
+ @_serfsupp_debug
+ end
+
+ def self.Debug=(value)
+ @_serfsupp_debug = value
end
#---------------------
@@ -80,8 +84,22 @@ def self.stat(filename)
# Provide File::open equivalent
#---------------------
def self.open(filename, *args, &blk)
+
+ # Check the requested open mode. It can be a mode string or a mode number
+ open_mode = 'r' # default
+ if args.length > 0
+ open_mode = args[0] if args[0].kind_of?(String)
+ # TODO : mode number
+ end
+
+ # Cannot write to embedded resources...
+ return nil unless open_mode[0,1] == 'r'
+ return nil if open_mode.include?('+')
+
stream = read_embedded_stream(filename)
return nil unless stream
+
+ open_mode.include?('b') ? stream.select_binarymode : stream.select_textmode
# Sinatra hack
class << stream
@@ -106,13 +124,79 @@ class System::IO::UnmanagedMemoryStream
def rewind
self.position = 0
+ @reader = @textmode ? System::IO::StreamReader.new(self) : System::IO::BinaryReader.new(self)
+ end
+
+ def select_textmode
+ @textmode = true
+ rewind
+ end
+
+ def select_binarymode
+ @textmode = false
+ rewind
end
def read(num)
- buffer = String.CreateBinary(System::IO::BinaryReader.new(self).ReadBytes(num))
- (buffer.length == 0) ? nil : buffer
+ if @textmode
+ str = ""
+ last_ch = nil
+ until num == 0
+ ch = reader.Read
+ return str if ch < 0
+ if (ch == 13) && (reader.Peek == 10)
+ ch = reader.Read
+ end
+ str << ch
+ num -= 1
+ end
+ return str
+ else
+ buffer = String.CreateBinary(reader.ReadBytes(num))
+ (buffer.length == 0) ? nil : buffer
+ end
end
+ def gets(aSepString = $/)
+ # TODO: Reads the next 'line' from the I/O stream; lines are separated by aSepString.
+ # A separator of nil reads the entire contents, and a zero-length separator
+ # reads the input a paragraph at a time (two successive newlines in the input
+ # separate paragraphs). The stream must be opened for reading or an IOerror will
+ # be raised. The line read in will be returned and also assigned to $_.
+ # Returns nil if called at end of file.
+ $_ = ''
+ val = read(1)
+ return nil unless val
+ while val
+ $_ << val
+ return $_ if (val == aSepString)
+ return $_ if (val.length == 0) && $_[-2,2] == "\n\n"
+ val = read(1)
+ end
+ return $_
+ end
+
+ def readline(aSepString = $/)
+ # TODO: Reads a line as with IO#gets, but raises an EOFError on end of file.
+ raise EOFError if eof?
+ gets aSepString
+ end
+
+ def eof?
+ eof = @textmode ?
+ @reader.end_of_stream :
+ @reader.peek_char < 0
+ end
+
+ def reader
+ unless @reader
+ rewind
+ @reader = System::IO::StreamReader.new(self)
+ end
+ @reader
+ end
+
+ private :reader
end
# --------------------------------------------------
@@ -261,14 +345,27 @@ def expand_path(path, aDirString = nil)
old_expand_path(path, aDirString)
end
+ # TODO: service blk
alias old_open open
def open(filename, *args, &blk)
old_open(filename, *args, &blk)
rescue => error
+ puts "FILE:OPEN(#{filename}, #{args.join(', ')})" if SerfSupp.Debug
stream = SerfSupp.open(filename, *args, &blk)
return stream if stream
raise error
end
+
+ alias old_new new
+ def new(filename, *args)
+ old_new(filename, *args)
+ rescue Errno::ENOENT => error
+ puts "FILE:NEW(#{filename}, #{args.join(', ')})" if SerfSupp.Debug
+ stream = SerfSupp.open(filename, *args)
+ return stream if stream
+ raise error
+ end
+
end
end
View
5 IREmbeddedApp/IREmbeddedApp.csproj
@@ -59,6 +59,7 @@
<ItemGroup>
<Compile Include="EmbeddedRuby.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <None Include="Properties\AssemblyInfo_in.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="EmbeddedRuby\bootstrap.rb" />
@@ -71,4 +72,8 @@
<Target Name="AfterBuild">
</Target>
-->
+ <PropertyGroup>
+ <PreBuildEvent>if exist ..\..\prebuild.bat ..\..\prebuild.bat</PreBuildEvent>
+ <PostBuildEvent>if exist ..\..\postbuild.bat ..\..\postbuild.bat</PostBuildEvent>
+ </PropertyGroup>
</Project>
View
26 IREmbeddedApp/Properties/AssemblyInfo.cs
@@ -1,15 +1,22 @@
using System.Reflection;
using System.Runtime.InteropServices;
+using System.Security.Permissions;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("IREmbeddedApp")]
-[assembly: AssemblyDescription("Class to support embedding IronRuby scripts within an Application or Assembly")]
+[assembly: AssemblyDescription("Class to support embedding IronRuby scripts within an Application or Assembly. http://github.com/rifraf/IronRubyEmbeddedApps")]
+#if DEBUG
+[assembly: AssemblyConfiguration("Debug")]
+#elif BETA
+[assembly: AssemblyConfiguration("Beta")]
+#else
[assembly: AssemblyConfiguration("")]
+#endif
[assembly: AssemblyCompany("djlSoft")]
[assembly: AssemblyProduct("IREmbeddedApp")]
-[assembly: AssemblyCopyright("Copyright David Lake © 2010")]
+[assembly: AssemblyCopyright("Copyright David Lake © 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -21,14 +28,7 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("04947356-1695-4c1c-89a6-b8095f16907f")]
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("0.1.0.0")]
-[assembly: AssemblyFileVersion("0.1.0.0")]
+[assembly: AssemblyVersion("0.1.0.11545")]
+[assembly: AssemblyFileVersion("0.1.0.11545")]
+[assembly: AssemblyInformationalVersionAttribute("0.1.0.11545")]
+[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]
View
34 IREmbeddedApp/Properties/AssemblyInfo_in.cs
@@ -0,0 +1,34 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security.Permissions;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("IREmbeddedApp")]
+[assembly: AssemblyDescription("Class to support embedding IronRuby scripts within an Application or Assembly. http://github.com/rifraf/IronRubyEmbeddedApps")]
+#if DEBUG
+[assembly: AssemblyConfiguration("Debug")]
+#elif BETA
+[assembly: AssemblyConfiguration("Beta")]
+#else
+[assembly: AssemblyConfiguration("")]
+#endif
+[assembly: AssemblyCompany("djlSoft")]
+[assembly: AssemblyProduct("IREmbeddedApp")]
+[assembly: AssemblyCopyright("Copyright David Lake © 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("04947356-1695-4c1c-89a6-b8095f16907f")]
+
+[assembly: AssemblyVersion("0.1.0.$WCREV$")]
+[assembly: AssemblyFileVersion("0.1.0.$WCREV$")]
+[assembly: AssemblyInformationalVersionAttribute("0.1.0.$WCREV$")]
+[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]
View
BIN IREmbeddedApp/Serfs.dll
Binary file not shown.
View
5 IREmbeddedLibraries/IREmbeddedLibraries.csproj
@@ -34,6 +34,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
+ <None Include="Properties\AssemblyInfo_in.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Files\rack-1.1.0\bin\rackup" />
@@ -873,4 +874,8 @@
<Target Name="AfterBuild">
</Target>
-->
+ <PropertyGroup>
+ <PreBuildEvent>if exist ..\..\prebuild.bat ..\..\prebuild.bat</PreBuildEvent>
+ <PostBuildEvent>if exist ..\..\postbuild.bat ..\..\postbuild.bat</PostBuildEvent>
+ </PropertyGroup>
</Project>
View
26 IREmbeddedLibraries/Properties/AssemblyInfo.cs
@@ -1,15 +1,22 @@
using System.Reflection;
using System.Runtime.InteropServices;
+using System.Security.Permissions;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("IREmbeddedLibraries")]
-[assembly: AssemblyDescription("Assembly containing Ruby source files from library")]
+[assembly: AssemblyDescription("Assembly containing Ruby source files from library. http://github.com/rifraf/IronRubyEmbeddedApps")]
+#if DEBUG
+[assembly: AssemblyConfiguration("Debug")]
+#elif BETA
+[assembly: AssemblyConfiguration("Beta")]
+#else
[assembly: AssemblyConfiguration("")]
+#endif
[assembly: AssemblyCompany("djlSoft")]
[assembly: AssemblyProduct("IREmbeddedLibraries")]
-[assembly: AssemblyCopyright("Copyright David Lake © 2010")]
+[assembly: AssemblyCopyright("Copyright David Lake © 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -21,14 +28,7 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e94d3130-fea2-47da-962b-6ee0965a42d4")]
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("0.1.0.0")]
-[assembly: AssemblyFileVersion("0.1.0.0")]
+[assembly: AssemblyVersion("0.1.0.11536")]
+[assembly: AssemblyFileVersion("0.1.0.11536")]
+[assembly: AssemblyInformationalVersionAttribute("0.1.0.11536")]
+[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]
View
34 IREmbeddedLibraries/Properties/AssemblyInfo_in.cs
@@ -0,0 +1,34 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security.Permissions;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("IREmbeddedLibraries")]
+[assembly: AssemblyDescription("Assembly containing Ruby source files from library. http://github.com/rifraf/IronRubyEmbeddedApps")]
+#if DEBUG
+[assembly: AssemblyConfiguration("Debug")]
+#elif BETA
+[assembly: AssemblyConfiguration("Beta")]
+#else
+[assembly: AssemblyConfiguration("")]
+#endif
+[assembly: AssemblyCompany("djlSoft")]
+[assembly: AssemblyProduct("IREmbeddedLibraries")]
+[assembly: AssemblyCopyright("Copyright David Lake © 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("e94d3130-fea2-47da-962b-6ee0965a42d4")]
+
+[assembly: AssemblyVersion("0.1.0.$WCREV$")]
+[assembly: AssemblyFileVersion("0.1.0.$WCREV$")]
+[assembly: AssemblyInformationalVersionAttribute("0.1.0.$WCREV$")]
+[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]
View
20 IRSinatra/IRSinatra.csproj
@@ -36,6 +36,26 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\IREmbeddedLibraries\bin\IREmbeddedLibraries.dll</HintPath>
</Reference>
+ <Reference Include="IronRuby, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>C:\Program Files\IronRuby 1.0\bin\IronRuby.dll</HintPath>
+ </Reference>
+ <Reference Include="IronRuby.Libraries, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>C:\Program Files\IronRuby 1.0\bin\IronRuby.Libraries.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Dynamic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>C:\Program Files\IronRuby 1.0\bin\Microsoft.Dynamic.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Scripting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>C:\Program Files\IronRuby 1.0\bin\Microsoft.Scripting.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Scripting.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>C:\Program Files\IronRuby 1.0\bin\Microsoft.Scripting.Core.dll</HintPath>
+ </Reference>
<Reference Include="Serfs, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\IREmbeddedApp\Serfs.dll</HintPath>
View
BIN IRSinatra/bin/IREmbeddedApp.dll
Binary file not shown.
View
BIN IRSinatra/bin/IREmbeddedApp.pdb
Binary file not shown.
View
BIN IRSinatra/bin/IREmbeddedLibraries.dll
Binary file not shown.
View
BIN IRSinatra/bin/IREmbeddedLibraries.pdb
Binary file not shown.
View
BIN IRSinatra/bin/IRSinatra.exe
Binary file not shown.
View
BIN IRSinatra/bin/IRSinatra.pdb
Binary file not shown.
View
BIN IRSinatra/bin/IRTestResources.pdb
Binary file not shown.
View
BIN IRSinatra/bin/Serfs.dll
Binary file not shown.
View
BIN IRSinatra/bin/merge/IRSinatra.exe
Binary file not shown.
View
BIN IRSinatra/bin/merge/IRSinatra.pdb
Binary file not shown.
View
50 README
@@ -1,50 +0,0 @@
-IronRubyEmbeddedApps
-====================
-
-This repository shows how to create 'standalone' .Net applications written in Ruby. You
-can package up Ruby applications as ordinary .Net executables without having to ship a
-collection of plain-text Ruby source files. No-one need ever know....
-
-This is done by using the following components:
-
-# IronRuby
-# Serfs
-# IREmbeddedApp
-
-IronRuby
---------
-This is the Open Source version of Ruby for .Net
-
-Serfs
------
-Serfs is a "Simple Embedded Resource File System" for .Net. It provides
-access to files embedded in .Net assemblies.
-
-IREmbeddedApp
--------------
-This provides a wrapper for IronRuby and Serfs, and a bootstrapper that
-modifies the Ruby load and require functions so that they can read files
-from embedded resources instead of reading them from disk.
-
-Contents
---------
-This repository contains 4 projects:
-
-IREmbeddedApp : The core IREmbeddedApp dll.
-
-IRTestResources : An example DLL containing no code, just embedded resources
-(optparse, test::unit and flexmock taken directly from an ordinary Ruby install).
-
-ExampleApps : An example command-line program showing how to run Ruby programs.
-
-Example:
-
-try {
- EmbeddedRuby er1 = new EmbeddedRuby();
- er1.Mount("Applications");
- exitcode = er1.Run("bottles.rb");
-} catch (Exception e) {
- Console.WriteLine(e.Message);
-}
-
-IRSinatra : Yes - a fully embedded Sinatra application. Run and see!!
View
46 README.textile
@@ -0,0 +1,46 @@
+h1. IronRubyEmbeddedApps
+
+(More detail on the Wiki pages)
+
+This repository shows how to create _standalone_ .Net applications written in Ruby.
+
+You can package up Ruby applications as ordinary .Net executables without having to ship a collection of plain-text Ruby source files and the associated standard Ruby libraries.
+
+If you want proof, look at the single file @IRSinatra.exe@ which demonstrates a fully operational Sinatra example program. It needs no other files - you just need the IronRuby runtime DLLs to be available on the PC.
+
+Your source Ruby files are embedded directly into your executable, and you can use @require@, @load@, @File.open@ etc just as if the files were on disk.
+
+No-one need ever know... (including your IT department).
+
+Example:
+
+<pre><code> EmbeddedRuby er = new EmbeddedRuby();
+ er.Mount("Applications");
+ exitcode = er1.Run("main.rb");
+</code></pre>
+
+h2. How
+
+To create an Embedded Ruby application, you just need the following components:
+
+h3. IronRuby
+
+"IronRuby":http://github.com/ironruby/ironruby is the Open Source version of Ruby for .Net
+
+h3. Serfs
+
+"Serfs":http://github.com/rifraf/Serfs is a "Simple Embedded Resource File System" for .Net. It provides access to files embedded in .Net assemblies. Files can be encoded for privacy.
+
+h3. IREmbeddedApp
+
+"IREmbeddedApp":http://github.com/rifraf/IronRubyEmbeddedApps/tree/master/IREmbeddedApp/ provides a wrapper for IronRuby and Serfs, and a bootstrapper that patches the appropriate Ruby methods so that they can read files from embedded resources.
+
+h1. Repository contents
+
+This repository contains the following parts
+
+# *IREmbeddedApp* : The core IREmbeddedApp dll.
+# *ExampleApps* : An example command-line program showing how to run Ruby programs.
+# *IREmbeddedLibraries* : A DLL containing a copy of the standard Ruby 1.8 libraries (including @rubygems@, @rexml@ etc), plus @rack-1.1.0@ and @sinatra-1.0@. This can be optionally included in an application if you need library support.
+# *IRSinatra* : A fully working Sinatra application with 2 flavours, one with libraries in individual DLLs, one with them all merged into the .exe
+# *IRTestResources* : An example DLL containing no code, just embedded resources (optparse, test::unit and flexmock taken directly from an ordinary Ruby install).
View
5 code_style.xml
@@ -75,11 +75,10 @@
<PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aa_bb" ElementKind="StaticReadonly" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="EnumMember" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
- <Abbreviation Text="CAH" />
<Abbreviation Text="OS" />
- <Abbreviation Text="XML" />
- <Abbreviation Text="NS" />
<Abbreviation Text="PL" />
+ <Abbreviation Text="NS" />
+ <Abbreviation Text="XML" />
<Abbreviation Text="GUI" />
<Abbreviation Text="AR" />
<Abbreviation Text="RTA" />

0 comments on commit f2a4bfb

Please sign in to comment.