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
| >>> t1 = Time.new | |
| => Tue Aug 18 12:26:40 +02:00 2009 | |
| >>> t2 = Time.at(t1) | |
| => Tue Aug 18 12:26:40 +02:00 2009 | |
| >>> | |
| >>> "t1: #{t1.object_id}" | |
| => "t1: 44" | |
| >>> "t2: #{t1.object_id}" | |
| => "t2: 44" | |
| >>> |
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
| diff --git a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs | |
| index 461f7c9..efb7b33 100644 | |
| --- a/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs | |
| +++ b/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/TimeOps.cs | |
| @@ -53,18 +53,18 @@ namespace IronRuby.Builtins { | |
| return new DateTime(other.Ticks, other.Kind); | |
| } | |
| [RubyMethod("at", RubyMethodAttributes.PublicSingleton)] | |
| public static DateTime Create(object/*!*/ self, double seconds) { |
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
| ------------------------------------------------------------------------ | |
| Client initialization: | |
| Can connect successfully [P] | |
| Accepts an URI for connection parameters [P] | |
| Accepts a table for connection parameters [P] | |
| ------------------------------------------------------------------------ | |
| Client features: | |
| Send raw commands [P] | |
| Create a new unbound command object [P] | |
| Define commands at module level [P] |
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
| --[[ | |
| Extremely simple demo of a Mercury application that uses a various template | |
| engines to render the final html output. The Haml support is provided by | |
| Norman Clarke's excellent lua-haml (http://github.com/norman/lua-haml/). | |
| ]] | |
| require 'luarocks.require' | |
| require 'mercury' | |
| require 'haml' | |
| require 'cosmo' |
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 'luarocks.require' | |
| require 'mercury' | |
| require 'haml' | |
| module('fibonacci', package.seeall, mercury.application) | |
| local templates = { | |
| index = [[ | |
| %html | |
| %head |
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
| # | |
| # [{:op=>"and"}, | |
| # [{:op=>"="}, [{:path=>"hello"}, {:lit=>":ivan"}]], | |
| # [{:op => "or"}, | |
| # [{:op=>"="}, [{:path=>"test"}, {:lit=>":ivan"}]], | |
| # [{:op => ">"}, [:path => "test3", {:list => ":ivan"}]]]] | |
| # | |
| # hello = :ivan and (test = :ivan or test3 = :ivan) | |
| class Parser |
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
| #!/usr/bin/ruby | |
| require 'Qt4' | |
| include Qt | |
| Application.new ARGV do | |
| Widget.new do | |
| button_quit = PushButton.new 'Click me to quit' do | |
| connect(SIGNAL :clicked) { Application.instance.quit } | |
| 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
| require 'luarocks.require' | |
| require 'cosmo' | |
| require 'mustache' | |
| do | |
| local template = "$do_cards[[$rank of $suit, ]]" | |
| local view = { | |
| { rank = "Ace", suit = "Spades", show = true }, | |
| { rank = "Queen", suit = "Diamonds", show = false }, | |
| { rank = "10", suit = "Hearts", show = true }, |
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
| -- Here is mercury's greetings example ported to mustache. | |
| -- Note that support for partial templates is still missing. | |
| require 'luarocks.require' | |
| require 'mercury' | |
| require 'mustache' | |
| module('greetings', package.seeall, mercury.application) | |
| local templates = { |
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
| * PONG | |
| * true | |
| * 0 | |
| * 10 | |
| * 40 | |
| * 1 | |
| * 40 | |
| * {2=40} |