This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script language="ruby" src="application.rb"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script language="javascript" src="gestalt.js" /> | |
<div id="message"></div> | |
<script language="ruby"> | |
document.message.innerHTML = "Hello, World!" | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load_assembly "System.Core" | |
#=> true | |
System::Linq::Enumerable.First([1,2,3]) | |
#=> 1 | |
System::Linq::Enumerable.ElementAt([1,2,3,4,5], 2) | |
#=> 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Demo { | |
public class Calculator { | |
private List<int>args = new List<int>(); | |
public void Push(int n) { | |
args.Add(n); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec/expectations' | |
require 'Calculator' # Calculator.dll | |
Before do | |
@calc = Demo::Calculator.new # A .NET class in Calculator.dll | |
end | |
Given "I have entered $n into the calculator" do |n| | |
@calc.push n.to_i | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Addition | |
In order to avoid silly mistakes | |
As a math idiot | |
I want to be told the sum of two numbers | |
Scenario Outline: Add two numbers | |
Given I have entered <input_1> into the calculator | |
And I have entered <input_2> into the calculator | |
When I press add | |
Then the result should be <output> on the screen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// c.dll | |
public class C { | |
public void Foo<T>(T x) { Console.WriteLine(typeof(T)); } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'c' | |
C.new.foo(1) | |
# System.Int32 | |
C.new.foo("x") | |
# IronRuby.Builtins.MutableString | |
C.new.foo(1.0) | |
# System.Double |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class System::Decimal | |
instance_methods(false).each do |name| | |
mangled = '__' + name | |
alias_method(mangled, name) | |
private mangled | |
define_method(name) do |*args| | |
puts "method called: #{name}" | |
send mangled, *args | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System::Byte.instance_methods(false) | |
#=> ["-", "%", "&", "*", "**", "/", "-@", "[]", "^", "|", "~", "+", "<", "<<", "<=", "<=>", "==", ">", ">=", ">>", "abs", "div", "divmod", "modulo", "quo", "to_f", "to_s", "zero?", "size", 'compare_to', 'equals', 'get_hash_code', 'to_string', 'get_type_code'] | |
l = System::Byte.instance_methods(false).last | |
#=> 'get_type_code' | |
l.ruby_name | |
#=> "get_type_code" | |
l.clr_name | |
#=> "GetTypeCode" |