Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}
h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}
.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}
.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}
.tabSelected{color:[[ColorPalette::PrimaryDark]];
background:[[ColorPalette::TertiaryPale]];
border-left:1px solid [[ColorPalette::TertiaryLight]];
border-top:1px solid [[ColorPalette::TertiaryLight]];
border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}
#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}
.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background::[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}
#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}
.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}
.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}
.tiddler .defaultCommand {font-weight:bold;}
.shadow .title {color:[[ColorPalette::TertiaryDark]];}
.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}
.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}
.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}
.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}
.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}
.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}
.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}
.imageLink, #displayArea .imageLink {background:transparent;}
.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}
.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}
.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}
.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}
.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}
.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}
#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity:60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}
body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}
h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}
hr {height:1px;}
a {text-decoration:none;}
dt {font-weight:bold;}
ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}
.txtOptionInput {width:11em;}
#contentWrapper .chkOptionInput {border:0;}
.externalLink {text-decoration:underline;}
.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}
.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}
/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}
#mainMenu .tiddlyLinkExisting,
#mainMenu .tiddlyLinkNonExisting,
#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}
.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}
.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}
#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}
#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0em 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}
.wizard {padding:0.1em 1em 0em 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0em 0em 0em; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0em;}
.wizardFooter .status {padding:0em 0.4em 0em 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em 0.1em 0.2em;}
#messageArea {position:fixed; top:2em; right:0em; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em 0.2em 0.2em 0.2em;}
#messageArea a {text-decoration:underline;}
.tiddlerPopupButton {padding:0.2em 0.2em 0.2em 0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 1em; margin:0;}
.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0em;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}
.tabset {padding:1em 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}
#contentWrapper {display:block;}
#splashScreen {display:none;}
#displayArea {margin:1em 17em 0em 14em;}
.toolbar {text-align:right; font-size:.9em;}
.tiddler {padding:1em 1em 0em 1em;}
.missing .viewer,.missing .title {font-style:italic;}
.title {font-size:1.6em; font-weight:bold;}
.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}
.tiddler .button {padding:0.2em 0.4em;}
.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}
.footer {font-size:.9em;}
.footer li {display:inline;}
.annotation {padding:0.5em; margin:0.5em;}
* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0em 0.25em; padding:0em 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}
.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}
.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}
.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0em; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}
.fieldsetFix {border:0; padding:0; margin:1px 0px 1px 0px;}
.sparkline {line-height:1em;}
.sparktick {outline:0;}
.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}
* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}
.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which use a logographic writing system and need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
.htmlarea .toolbarHA table {border:1px solid ButtonFace; margin:0em 0em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
noscript {display:none;}
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser
Your username for signing your edits. Write it as a WikiWord (eg JoeBloggs)
<<option txtUserName>>
<<option chkSaveBackups>> SaveBackups
<<option chkAutoSave>> AutoSave
<<option chkRegExpSearch>> RegExpSearch
<<option chkCaseSensitiveSearch>> CaseSensitiveSearch
<<option chkAnimate>> EnableAnimations
----
Also see AdvancedOptions
!Implementation
Let's add a {{{downcase}}} method to the MutableString class. This is the simplest kind of method - it accepts no parameters and returns a MutableString.
MutableString lives in Ruby\Builtins\MutableString.cs. Its unit tests live in Tests\Builtins\String\test_string.rb. Here's one possible implementation of this method:
{{{
[RubyMethodAttribute("downcase", RubyMethodAttributes.PublicInstance)]
public static MutableString DownCase(MutableString str) {
MutableString result = new MutableString(str);
DownCaseMutableString(result);
return result;
}
}}}
Notice that the method is a _static_ method. DLR provides its own version of C#
3.0's ExtensionMethods. In library code, all methods are implemented as ''static''
methods on the type, particularly if its on a type that we define (which is the case with MutableString).
If it's a type that we don't define, such as Int32, we define our extension
methods in a class that has the suffix "Ops" attached to the name. In the case
of Int32, which is really a Ruby Fixnum type, our extension methods are
implemented in a type called FixnumOps.
Notice that we have attached a RubyMethodAttribute to this class. This attribute
defines the Ruby-callable name of the method since Ruby supports method names
that are illegal in C#, such as "downcase!". The RubyMethodAttributes
enumeration defines the instancing and visibility of the method; in this case we
are defining a public instance method on the String type.
!Unit Tests
Next, we have to implement the unit tests. In this early implementation of
IronRuby, we support a simple form of RSpec tests. The testing framework can be
found in Ruby\Tests\Util\simple_test.rb. Here's an implementation of the tests:
{{{
describe "String#downcase" do
it "returns a copy of self with all uppercase letters downcased" do
"hELLO".downcase.should == "hello"
"hello".downcase.should == "hello"
end
it "is locale insensitive (only replacing A-Z)" do
"ÄÖÜ".downcase.should == "ÄÖÜ"
end
end
}}}
Next up, lets define a method that AcceptsParameters.
IronRuby uses four-space indentation. Tabs must be expanded as spaces. No exceptions.
Public names are subject to FxCop rules.
!!Private class member variables start with underscore “_”:
{{{
class MyClass {
private string _name;
public MyClass(string name) {
_name = name;
}
}
}}}
!!Static variable names start with underscore followed by upper case letter:
{{{
_StaticVar
}}}
!!Open brace on same line as code:
{{{
if (true) {
DoSomething();
}
}}}
!!Member variables should be declared at the top of a class declaration:
{{{
class MyClass {
private string _name;
public MyClass(string name) {
_name = name;
}
// Additional Code Here
public string Name {
get { return _name; }
set { _name = value; }
}
}
}}}
Not:
{{{
class MyClass {
public MyClass(string name) {
_name = name;
}
// Additional Code Here
private string _name;
public string Name {
get { return _name; }
set { _name = value; }
}
}
}}}
IronRuby uses uniform formatting of the C# code. Set your editor to use the IronRuby.vssettings file to set handling of tabs and formatting of the code. This file is located in the root directory of the IronRuby project.
To use the team settings in Visual Studio, go to Tools->Options… Expand the “Environment” node, select “Import and Export Settings”. Check the “Use team settings file” and browse to the "IronRuby.vssettings” file located in your workspace.
You can compile IronRuby by running {{build.cmd}} from the root directory of your IronRuby source distribution. You must have the .NET 2.0 Framework redistributable installed, since the build scripts rely on MSBuild.
This will generate a release mode build of IronRuby in the \bin\release directory of your source distribution.
Extension methods let us add methods (instance and static) to types that we didn't define. The DLR method dispatch mechanism generates the correct code to call these methods.
For more details on C# 3.0 extension methods, see <<some article>>
Welcome to the IronRuby project!
The current version of IronRuby is the 0.1 Pre-Alpha, released on July 23.
IronRuby is licensed under the terms of the Microsoft Public License (Ms-PL).
This release of IronRuby ships only in source form. You must CompileSources first.
If you're new here, make sure you read the NewDev page first. We're currently looking for contributions in the StandardLibraries, which you can find under \ironruby\src\ironrubylibs\.
We are dividing the IronRuby libraries into BuiltIns and StandardLibraries. This is the area of IronRuby where we need external help the most.
Make sure that you follow the CodingConventions.
If this is your first contribution, read the tutorial on how to AddAMethod to an existing type.
John Lam is an IronRuby core team member, and a Program Manager on the DynamicLanguageRuntime team at Microsoft.
John tracks the progress of the IronRuby project on his blog, http://www.iunknown.com
It ships with the [[.NET 2.0 Framework redist|http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en]]. We have build scripts to help you build the projects and run the unit tests.
The Ms-PL is the least restrictive of the Microsoft source code licenses. It allows licensees to view, modify, and redistribute the source code for either commercial or non-commercial purposes. Under the Ms-PL, licensees may change the source code and share it with others. Licensees may also charge a licensing fee for their modified work if they so wish. Microsoft uses this license most commonly for its developer tools, applications, and components.
!Microsoft Public License (Ms-PL)
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
!!1. Definitions
The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the same meaning here as under U.S. copyright law.
A “contribution” is the original software, or any additions or changes to the software.
A “contributor” is any person that distributes its contribution under this license.
“Licensed patents” are a contributor’s patent claims that read directly on its contribution.
!!2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
!!3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors’ name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed “as-is.” You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
You can always read the full text of the Microsoft Public License on the [[official web site|http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.mspx]].
MutableString is the CLR type that represents a Ruby String. It's currently based on the StringBuilder type, which is a very efficient implementation of a char[] buffer. The current plan of record is to use this type for the near future before we invest in converting this type to a byte[] which is the long term plan.
New to the project? There are a few things that you should know before you dive in.
* We are currently only accepting contributions into the StandardLibraries.
* Take some time to familiarize yourself with the SourceCodeLayout.
* Make sure you understand how the UnitTests work.
* Work through the RunningFirstTime tutorial.
Contributing code
* Read the CodingStandards
* Read the tutorial on how to AddAMethod to the libraries
* Build the solution using MSBuild and verify that the UnitTests pass
<!--{{{-->
<div class='header'>
<div class='gradient' macro='gradient vert #FF8614 #DA4A0D '>
<div class='titleLine' >
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div id='topMenu' refresh='content' tiddler='MainMenu'></div>
</div>
</div>
<div id='bodywrapper'>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter'>TiddlyWiki</div>
</div>
<!--}}}-->
This topic will teach you the basics of how things run in IronRuby.
First, we will step through the Ruby.Console application to see what happens when we run a simple program:
{{{
puts 'Hello, World!'
}}}
You will see a number of things when we step through this code:
# The hosting interfaces
# The Ruby parser
# The Ruby AST
# The transformation of the Ruby AST into the DLR AST
# Some interesting execution paths
/***
This CSS by DaveBirss.
***/
/*{{{*/
.tabSelected {
background: #fff;
}
.tabUnselected {
background: #eee;
}
#sidebar {
color: #000;
background: transparent;
}
#sidebarOptions {
background: #fff;
}
#sidebarOptions input {
border: 1px solid #ccc;
}
#sidebarOptions input:hover, #sidebarOptions input:active, #sidebarOptions input:focus {
border: 1px solid #000;
}
#sidebarOptions .button {
color: #999;
}
#sidebarOptions .button:hover {
color: #000;
background: #fff;
border-color:white;
}
#sidebarOptions .button:active {
color: #000;
background: #fff;
}
#sidebarOptions .sliderPanel {
background: transparent;
}
#sidebarOptions .sliderPanel A {
color: #999;
}
#sidebarOptions .sliderPanel A:hover {
color: #000;
background: #fff;
}
#sidebarOptions .sliderPanel A:active {
color: #000;
background: #fff;
}
.sidebarSubHeading {
color: #000;
}
#sidebarTabs {`
background: #fff
}
#sidebarTabs .tabSelected {
color: #000;
background: #fff;
border-top: solid 1px #ccc;
border-left: solid 1px #ccc;
border-right: solid 1px #ccc;
border-bottom: none;
}
#sidebarTabs .tabUnselected {
color: #999;
background: #eee;
border-top: solid 1px #ccc;
border-left: solid 1px #ccc;
border-right: solid 1px #ccc;
border-bottom: none;
}
#sidebarTabs .tabContents {
background: #fff;
}
#sidebarTabs .txtMoreTab .tabSelected {
background: #fff;
}
#sidebarTabs .txtMoreTab .tabUnselected {
background: #eee;
}
#sidebarTabs .txtMoreTab .tabContents {
background: #fff;
}
#sidebarTabs .tabContents .tiddlyLink {
color: #999;
border:none;
}
#sidebarTabs .tabContents .tiddlyLink:hover {
background: #fff;
color: #000;
border:none;
}
#sidebarTabs .tabContents {
color: #000;
}
#sidebarTabs .button {
color: #666;
}
#sidebarTabs .tabContents .button:hover {
color: #000;
background: #fff;
}
#sidebar {color:#999;}
/*}}}*/
Developer documentation for Microsoft IronRuby
The IronRuby source code has the following layout:
{{{
\ironruby
src\
ironruby\
ironrubylibs\
microsoft.scripting\
tests\
ironruby\
microsoft.scripting\
utils\
IronRuby.Tests\
ironruby.console\
classinitgenerator\
}}}
The src\ironruby directory contains the code for the compiler and the BuiltIns. We are currently not AcceptingContributions into the core compiler.
The src\ironrubylibs directory contains the code for the StandardLibraries. We are AcceptingContributions into this directory tree.
The tests\ironruby directory contains the UnitTests for the compiler, BuiltIns, and StandardLibraries.
The tests\microsoft.scripting directory contains the UnitTests for the DynamicLanguageRuntime.
The utils\IronRuby.Tests directory contains a set of tests that are useful if you want to step into the core compiler using a debugger.
The utils\ironruby.console directory contains a simple console-based host for the IronRuby compiler that supports REPL-style programming.
The utils\classinitgenerator directory contains a utility that will generate code from class and method attributes used in the libraries.
The StandardLibraries are the same list of libraries described in Chapter 28 of the PickAxe book. These libraries will be compiled into a separate assembly, IronRubyLibs.dll. The sources live in \ironruby\src\ironrubylibs\.
Here's a complete list of the libraries that we are looking for contributions in:
!Libraries to be ported to C#
# [[strscan|http://ruby-doc.org/stdlib/libdoc/strscan/rdoc/classes/StringScanner.html]]: a high-speed string token scanner
# syck: high-speed YAML parser
# zlib: library for [de]compressing streams and working with gzip files
# bigdecimal: variable precision floating point library (GPL)
# readline: wrapper around GNU readline library
# curses: wrapper around C-based curses library
# enumerator: adds enumeration support to arbitrary objects and mixes in Enumerable
# fcntl: symbolic names for fcntl constants based on underlying OS
# iconv: translates string between different character encodings
# io: adds IO#ready? and IO#wait methods to standard IO class
# pty: pseudo-terminal interface
# racc: runtime library for code produced by racc [Ruby yacc]
# stringio: treat a string as if it were an I/O stream
# thread: utility methods for multithreaded programming. Queue utility class is still used today by some libraries - most functionality superceded by Monitor
!Libraries that should delegate functionality to existing .NET libraries
# openssl: wrapper around OpenSSL library
# digest: various hashing algorithms (md5, rmd160, sha1, sha2)
# dl: access underlying platform's DLL infrastructure [similar to Win32API]
# socket: interface with platform socket implementation (unknown license)
# Win32API: allows access to arbitrary Win32 functions P/Invoke style wrapper
# win32ole: library for manipulating COM objects (GPL or Artistic License)
!Libraries that target non-Windows platforms
# Dbm: wrapper around DBM databases which are persistent hash-like files
# gdbm: Ruby wrapper around GNU database
# nkf: wrapper around Network Kanji Filter library - guess character encodings
# sdbm: key-value hashtable persistence library
# etc: used to retrieve data under /etc directory on Unix systems
# syslog: wrapper around Unix syslog library
# tk: library for creating cross-platform UIs
[[SideBarWG]]
/***
!Top Menu Styles
***/
/*{{{*/
#topMenu br {display:none; }
#topMenu { background: #000 ; color:#fff;padding: 1em 1em;}
/*}}}*/
/***
!General
***/
/*{{{*/
body {
background: #444;
margin: 0 auto;
}
#contentWrapper{
background: #fff;
border: 0;
margin: 0 auto;
width: 792px;
padding:0;
}
/*}}}*/
/***
!Header rules
***/
/*{{{*/
.titleLine{
margin: 80px auto 0em ;
margin-left:1.7em;
margin-bottom: 40px;
padding: 0;
text-align: left;
color: #fff;
}
.siteTitle {
font-size: 2em;
font-weight: bold;
}
.siteSubtitle {
font-size: 1.1em;
display: block;
margin: .5em auto 1em;
}
.gradient {margin: 0 auto;}
.header {
background: #fff;
margin: 0 auto;
padding:0 12px;
width: 768px;
}
/*}}}*/
/***
!Display Area
***/
/*{{{*/
#bodywrapper {margin:0 12px; padding:0;background:#fff; height:1%}
#displayArea{
margin: 0em 16em 0em 1em;
text-align: left;
}
.tiddler {
padding: 1em 1em 0em 0em;
}
h1,h2,h3,h4,h5 { color: #000; background: transparent; padding-bottom:2px; border-bottom: 1px dotted #666; }
.title {color:black; font-size:1.8em; border-bottom:1px solid #333; padding-bottom:0.3px;}
.subtitle { font-size:90%; color:#ccc; padding-left:0.25em; margin-top:0.1em; }
.shadow .title {
color: #aaa;
}
.tagClear{
clear: none;
}
* html .viewer pre {
margin-left: 0em;
}
* html .editor textarea, * html .editor input {
width: 98%;
}
.tiddler {margin-bottom:1em; padding-bottom:0em;}
.toolbar .button {color:#bbb; border:none;}
.toolbar .button:hover, .toolbar .highlight, .toolbar .marked, .toolbar a.button:active {background:transparent; color:#111; border:none; text-decoration:underline;}
#sidebar .highlight, #sidebar .marked {background:transparent;}
.tagging, .tagged {
border: 1px solid #eee;
background-color: #F7F7F7;
}
.selected .tagging, .selected .tagged {
background-color: #eee;
border: 1px solid #bbb;
}
.tagging .listTitle, .tagged .listTitle {
color: #bbb;
}
.selected .tagging .listTitle, .selected .tagged .listTitle {
color: #222;
}
.tagging .button:hover, .tagged .button:hover {
border: none; background:transparent; text-decoration:underline; color:#000;
}
.tagging .button, .tagged .button {
color:#aaa;
}
.selected .tagging .button, .selected .tagged .button {
color:#000;
}
.viewer blockquote {
border-left: 3px solid #000;
}
.viewer pre, .viewer code {
border: 1px dashed #ccc;
background: #eee;}
.viewer hr {
border: 0;
border-top: solid 1px #333;
margin: 0 8em;
color: #333;
}
.highlight, .marked {background:transparent; color:#111; border:none; text-decoration:underline;}
.viewer .highlight, .viewer .marked {text-decoration:none;}
#sidebarTabs .highlight, #sidebarTabs .marked {color:#000; text-decoration:none;}
.tabSelected {
color: #000;
background: #fff;
border-top: solid 1px #ccc;
border-left: solid 1px #ccc;
border-right: solid 1px #ccc;
border-bottom: none;
}
.viewer .tabSelected:hover{color:#000;}
.viewer .tabSelected {font-weight:bold;}
.tabUnselected {
color: #999;
background: #eee;
border-top: solid 1px #ccc;
border-left: solid 1px #ccc;
border-right: solid 1px #ccc;
border-bottom: solid 1px #ccc;
padding-bottom:1px;
}
.tabContents {
background: #fff;
color: #000;
}
/*}}}*/
/***
!!!Tables
***/
/*{{{*/
.viewer table {
border: 1px solid #000;
}
.viewer th, thead td {
background: #000;
border: 1px solid #000;
color: #fff;
}
.viewer td, .viewer tr {
border: 1px solid #111;
}
/*}}}*/
/***
!!!Editor area
***/
/*{{{*/
.editor input, .editor textarea {
border: 1px solid #ccc;
}
.editor {padding-top:0.3em;}
.editor textarea:focus, .editor input:focus {
border: 1px solid #333;
}
/*}}}*/
/***
!Sidebar
***/
/*{{{*/
#sidebar{
position:relative;
float:right;
margin-bottom:1em;
display:inline;
width: 16em;
}
#sidebarOptions .sliderPanel {
background: #eee; border:1px solid #ccc;
}
/*}}}*/
/***
!Body Footer rules
***/
/*{{{*/
#contentFooter {
text-align: left;
clear: both;
color:#fff;
background: #000;
padding: 1em 2em;
font-weight:bold;
}
/*}}}*/
/***
!Link Styles
***/
/*{{{*/
a{
color: #000;
}
a:hover{
color: #FF6600;
background:#fff;
}
.button {
color: #000;
border: 1px solid #fff;
}
.button:hover {
color: #fff;
background: #ff8614;
border-color: #000;
}
.button:active {
color: #fff;
background: #ff8614;
border: 1px solid #000;
}
.tiddlyLink {border-bottom: 1px dotted #000;}
.tiddlyLink:hover {border-bottom: 1px dotted #FF6600;}
.titleLine a {border-bottom: 1px dotted #FF9900;}
.titleLine a:hover {border-bottom: 1px dotted #fff;}
.siteTitle a, .siteSubtitle a{
color: #fff;
}
.viewer .button {border: 1px solid #ff8614; font-weight:bold;}
.viewer .button:hover, .viewer .marked, .viewer .highlight{background:#ff8614; color:#fff; font-weight:bold; border: 1px solid #000;}
#topMenu .button, #topMenu .tiddlyLink {
margin-left:0.5em; margin-right:0.5em;
padding-left:3px; padding-right:3px;
color:white;
}
#topMenu .button:hover, #topMenu .tiddlyLink:hover { background:#000; color:#FF8814}
#topMenu a{border:none;}
/*}}}*/
/***
!Message Area /%=================================================%/
***/
/*{{{*/
#messageArea {
border: 4px dotted #ff8614;
background: #000;
color: #fff;
font-size:90%;
}
#messageArea .button {
padding: 0.2em;
color: #000;
background: #fff;
text-decoration:none;
font-weight:bold;
border:1px solid #000;
}
#messageArea a {color:#fff;}
#messageArea a:hover {color:#ff8614; background:transparent;}
#messageArea .button:hover {background: #FF8614; color:#fff; border:1px solid #fff; }
/*}}}*/
/***
!Popup /%=================================================%/
***/
/*{{{*/
.popup {
background: #ff8814;
border: 1px solid #333;
}
.popup hr {
color: #333;
background: #333;
border-bottom: 1px;
}
.popup li.disabled {
color: #333;
}
.popup li a, .popup li a:visited {
color: #eee;
border: none;
}
.popup li a:hover {
background: #ff8614;
color: #fff;
border: none;
text-decoration:underline;
}
/*}}}*/
.blog h2, .blog h3, .blog h4{
margin:0;
padding:0;
border-bottom:none;
}
.blog {margin-left:1.5em;}
.blog .excerpt {
margin:0;
margin-top:0.3em;
padding: 0;
margin-left:1em;
padding-left:1em;
font-size:90%;
border-left:1px solid #ddd;
}
#tiddlerWhatsNew h1, #tiddlerWhatsNew h2 {border-bottom:none;}
div[tags~="RecentUpdates"], div[tags~="lewcidExtension"] {margin-bottom: 2em;}
#hoverMenu .button, #hoverMenu .tiddlyLink {border:none; font-weight:bold; background:#f37211; color:#fff; padding:0 5px; float:right; margin-bottom:4px;}
#hoverMenu .button:hover, #hoverMenu .tiddlyLink:hover {font-weight:bold; border:none; color:#f37211; background:#000; padding:0 5px; float:right; margin-bottom:4px;}
#topMenu .fontResizer {float:right;}
#topMenu .fontResizer .button{border:1px solid #000;}
#topMenu .fontResizer .button:hover {border:1px solid #f37211; color:#fff;}
#sidebarTabs .txtMainTab .tiddlyLinkExisting {
font-weight: normal;
font-style: normal;
}
#sidebarTabs .txtMoreTab .tiddlyLinkExisting {
font-weight: bold;
font-style: normal;
}
.blog h2, .blog h3, .blog h4{
margin:0;
padding:0;
border-bottom:none;
}
.blog {margin-left:1.5em;}
.blog .excerpt {
margin:0;
margin-top:0.3em;
padding: 0;
margin-left:1em;
padding-left:1em;
font-size:90%;
border-left:1px solid #ddd;
}
#tiddlerWhatsNew h1, #tiddlerWhatsNew h2 {border-bottom:none;}
div[tags~="RecentUpdates"], div[tags~="lewcidExtension"] {margin-bottom: 2em;}
#hoverMenu {background:transparent;}
#hoverMenu .button, #hoverMenu .tiddlyLink {border:none; font-weight:bold; background:#f37211; color:#fff; padding:0 5px; float:right; margin-bottom:4px;}
#hoverMenu .button:hover, #hoverMenu .tiddlyLink:hover {font-weight:bold; border:none; color:#f37211; background:#000; padding:0 5px; float:right; margin-bottom:4px;}
#topMenu .fontResizer {float:right;}
#topMenu .fontResizer .button{border:1px solid #000;}
#topMenu .fontResizer .button:hover {border:1px solid #f37211; color:#fff;}
#sidebarTabs .txtMainTab .tiddlyLinkExisting {
font-weight: normal;
font-style: normal;
}
#sidebarTabs .txtMoreTab .tiddlyLinkExisting {
font-weight: bold;
font-style: normal;
}
There are several sets of UnitTests in IronRuby.
If you are contributing to the libraries, you will be interested in the tests under \tests\ruby\builtins. These tests use a minimalistic unit testing framework that can be found in \tests\ruby\util\simple_test.rb.
If you have added the \bin\release directory for IronRuby to your PATH, you can run the tests using:
{{{
rbx \tests\ruby\builtins\array\test_array.rb
}}}