Skip to content

Instantly share code, notes, and snippets.

View jarib's full-sized avatar

Jari Bakken jarib

View GitHub Profile
$ 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
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 ??..
#!/usr/bin/env ruby -wKU
require "osx/cocoa"
include OSX
class Sleeper < NSObject
def initialize
NSWorkspace.sharedWorkspace.notificationCenter.objc_send(
:addObserver, self,
$ 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
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
$ 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]
$
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
$ cat example.rb
require "rubygems"
require "highline"
puts "Type a char: "
p :got => HighLine::SystemExtensions.get_character
$ ruby example.rb
Type a char:
require "rubygems"
require "celerity"
threads = []
threads << Thread.new do
# en ny browser per tråd
browser = Celerity::Browser.new
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