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/local/bin/macruby | |
# -*- coding: utf-8 -*- | |
# Captures a photo using iSight. | |
framework "Cocoa" | |
framework "QTKit" | |
class AppController | |
def initialize(filename=nil) | |
options = {} |
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/env macruby | |
# -*- coding: utf-8 -*- | |
require 'optparse' | |
framework 'AppKit' | |
class Speech | |
def initialize() | |
@speech = NSSpeechSynthesizer.alloc.initWithVoice(nil) | |
@speech.delegate = self | |
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
# Usage: | |
# $ cd src/MacRuby/ | |
# $ ruby methods.rb include/ruby/intern.h | |
file = ARGV[0] | |
puts "Implementation is necessary." | |
File.open(file) {|f| | |
f.each_line do |line| | |
if(line =~ /^([^ \t\/\{\}#]+) ([^(;]+)/) | |
type = $1 |
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
* ruby.h | |
rb_objc_undef_method | |
rb_eval_string_protect | |
rb_eval_string_wrap | |
rb_catch | |
rb_catch_obj | |
ruby_init_stack | |
ruby_init_stack | |
rb_cISeq | |
rb_cEnv |
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
/* requirement : Mac OS X 10.5, ruby 1.8.6 | |
* usage : $ sudo dtrace -qs method.d -c "ruby test.rb" | |
*/ | |
function-entry | |
{ | |
printf("[DTRACE]%s#%s\n", copyinstr(arg0), copyinstr(arg1)); | |
} |
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
filename = ARGV[0] | |
unless(filename) | |
puts "usage: #{$0} filename" | |
exit | |
end | |
list = {} | |
File.open(filename) {|f| | |
f.each_line do |line| | |
line.strip! |
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
Total: 180 samples | |
30 16.7% 16.7% 32 17.8% _rb_vm_yield_under | |
29 16.1% 32.8% 29 16.1% ___workq_kernreturn | |
23 12.8% 45.6% 23 12.8% _rb_vm_get_opaque_data | |
15 8.3% 53.9% 15 8.3% _strlen | |
10 5.6% 59.4% 137 76.1% _rb_vm_dispatch | |
7 3.9% 63.3% 17 9.4% Auto::Admin::thread_cache_allocate | |
7 3.9% 67.2% 7 3.9% _rb_objc_class_sync_version | |
7 3.9% 71.1% 22 12.2% _st_numhash | |
6 3.3% 74.4% 60 33.3% _rb_ary_equal |
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
$ rake spec:library | |
(in /Users/watson/src/MacRuby) | |
rm -rf rubyspec_temp | |
./mspec/bin/mspec ci -B ./spec/macruby.mspec :library | |
MacRuby 0.9 (ruby 1.9.2) [universal-darwin10.0, x86_64] | |
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................E............................................................................................................................................................................................................ |
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 'formula' | |
class Tscreen <Formula | |
url 'http://www.steve.org.uk/Software/tscreen/dist/tscreen-0.4.9.tar.gz' | |
homepage 'http://www.steve.org.uk/Software/tscreen/' | |
md5 '12303c84a93a78f1c44441323ba38845' | |
def install | |
system "./configure", "--disable-debug", "--disable-dependency-tracking", | |
"--prefix=#{prefix}" |
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
if [[ -s "/Library/Frameworks/MacRuby.framework/Versions/0.5" ]] ; then | |
alias macruby05="/Library/Frameworks/MacRuby.framework/Versions/0.5/usr/bin/macruby" | |
fi | |
if [[ -s "/Library/Frameworks/MacRuby.framework/Versions/0.6" ]] ; then | |
alias macruby06="/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/bin/macruby" | |
fi | |
if [[ -s "/Library/Frameworks/MacRuby.framework/Versions/0.7" ]] ; then | |
alias macruby07="/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/bin/macruby" | |
fi | |
if [[ -s "/Library/Frameworks/MacRuby.framework/Versions/0.8" ]] ; then |
OlderNewer