This file contains 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
$ ruby -r stringio -e 's=StringIO.new; s << "æåø"; puts s.string' | xxd | |
0000000: c3a6 c3a5 c3b8 0a ....... | |
$ jruby -r stringio -e 's=StringIO.new; s << "æåø"; puts s.string' | xxd | |
0000000: be8c bf0a |
This file contains 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
UTF-8 | |
$ echo æåø | xxd | |
0000000: c3a6 c3a5 c3b8 0a ....... | |
$ ruby -r stringio -e 's=StringIO.new; s.puts("æåø"); puts s.string' | xxd | |
0000000: c3a6 c3a5 c3b8 0a ....... | |
StringIO#puts, file.encoding=MacRoman (default) - no idea what the encoding is here | |
$ jruby -r stringio -e 's=StringIO.new; s.puts("æåø"); puts s.string' | xxd | |
0000000: 3f3f c00a ??.. |
This file contains 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/env ruby -wKU | |
require "osx/cocoa" | |
include OSX | |
class Sleeper < NSObject | |
def initialize | |
NSWorkspace.sharedWorkspace.notificationCenter.objc_send( | |
:addObserver, self, |
This file contains 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
$ bin/mspec tag --list fails spec/core/kernel | |
rubinius 0.11.0-dev (ruby 1.8.6) (1860a5059 12/31/2009) [i686-apple-darwin9.6.0] | |
Listing specs tagged with 'fails' | |
Kernel#const_lookup raises NameError if the constant is not contained within the module's scope | |
Kernel#const_lookup returns the value of #const_missing | |
Kernel#require loads a .rbc file directly | |
Kernel#require compiles a .rbc file when re-evaluating the source file | |
Kernel#require loads a .rbc file if it's not older than the associated .rb file |
This file contains 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
1) | |
Process.egid returns the effective group ID for this process FAILED | |
Expected Bignum | |
to equal Fixnum | |
#<Object:0x1641c>.__script__ {} at spec/frozen/core/process/egid_spec.rb:5 | |
Kernel(Object)#instance_eval at kernel/common/eval.rb:117 | |
Enumerable(Array)#all? {} at kernel/common/enumerable.rb:284 | |
Array#each at kernel/bootstrap/array_186.rb:9 | |
Enumerable(Array)#all? at kernel/common/enumerable.rb:284 |
This file contains 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
$ ruby -e 'p [Process.egid, Process.egid.class]' | |
[-644472717, Fixnum] | |
$ ruby1.9 -e 'p [Process.egid, Process.egid.class]' | |
[1503010931, Bignum] | |
$ jruby -e 'p [Process.egid, Process.egid.class]' | |
[1503010931, Fixnum] | |
$ bin/rbx -e 'p [Process.egid, Process.egid.class]' | |
[1503010931, Bignum] | |
$ |
This file contains 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
commit f4aa1e3dcc02f946489a2ce83618a82a42f2a1b6 | |
Author: Jari Bakken <[email protected]> | |
Date: Sat May 23 02:02:16 2009 +0200 | |
Check that Method#call works for methods defined with attr_accessor | |
diff --git a/core/method/shared/call.rb b/core/method/shared/call.rb | |
index 0f6451b..a5a45c6 100644 | |
--- a/core/method/shared/call.rb | |
+++ b/core/method/shared/call.rb |
This file contains 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
$ cat example.rb | |
require "rubygems" | |
require "highline" | |
puts "Type a char: " | |
p :got => HighLine::SystemExtensions.get_character | |
$ ruby example.rb | |
Type a char: |
This file contains 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 "rubygems" | |
require "celerity" | |
threads = [] | |
threads << Thread.new do | |
# en ny browser per tråd | |
browser = Celerity::Browser.new |
This file contains 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
def drag_to(element) | |
assert_exists # locates the element, stored in @object | |
element.assert_exists # make sure the other element exists | |
other = element.object # fetch the HtmlUnit object | |
@object.mouseDown | |
other.mouseMove | |
other.mouseUp | |
end |