Skip to content

Instantly share code, notes, and snippets.

View jballanc's full-sized avatar

Joshua Ballanco jballanc

View GitHub Profile
> cat hello.rb
puts "hello, world"
> macrubyc -o hello hello.rb
> file hello
hello: Mach-O 64-bit executable x86_64
> ./hello
hello, world
> otool -L ./hello
./hello:
/Library/Frameworks/MacRuby.framework/Versions/0.5/usr/lib/libmacruby.dylib (compatibility version 0.5.0, current version 0.5.0)
irb(main):001:0> class String
irb(main):002:1> alias :foo :length
irb(main):003:1> end
=> nil
irb(main):004:0> "".foo
=> 0
irb(main):005:0>
Analysis of sampling macruby (pid 85471) every 1 millisecond
Call graph:
9295 Thread_4922375 DispatchQueue_1: com.apple.main-thread (serial)
9295 OBJC_CLASS_$_NSObject
9295 OBJC_CLASS_$_NSObject
9295 OBJC_CLASS_$_NSObject
9295 OBJC_CLASS_$_NSObject
9295 OBJC_CLASS_$_NSObject
9295 OBJC_CLASS_$_NSObject
9295 OBJC_CLASS_$_NSObject
diff --git a/spec/macruby/core/array_spec.rb b/spec/macruby/core/array_spec.rb
index 9bc6b7c..4dbbf69 100644
--- a/spec/macruby/core/array_spec.rb
+++ b/spec/macruby/core/array_spec.rb
@@ -79,3 +79,49 @@ describe "An NSArray object" do
end
=end
end
+
+describe "Objective-C Array methods" do
def parse_splat
split_splat = params[:splat][0].split('/')
[ split_splat.pop,
split_splat,
ITEM_LEVELS[split_splat.length] ]
end
diff --git a/dispatcher.cpp b/dispatcher.cpp
index 3eca605..612f697 100644
--- a/dispatcher.cpp
+++ b/dispatcher.cpp
@@ -18,7 +18,7 @@
#include <execinfo.h>
#include <dlfcn.h>
-#define ROXOR_VM_DEBUG 0
+#define ROXOR_VM_DEBUG 1
#-- encoding: UTF-8 --
ruby19isms = ->(greeting, encoding) {
my_enum = greeting.reverse
.capitalize
.force_encoding(encoding)
.codepoints
print "|"
my_enum.each{|cp| print "#{cp}|"}
print "\n"
}
#--
# ==================================================================
# Author: Jamis Buck (jamis@jamisbuck.org)
# Date: 2008-10-09
#
# This file is in the public domain. Usage, modification, and
# redistribution of this file are unrestricted.
# ==================================================================
#++
#!/usr/bin/env macruby
framework 'Foundation'
class BrowserDelegate
def initialize
@services_queue = Dispatch::Queue.new('service_access_queue')
@services = []
end
def netServiceBrowserWillSearch(browser)
diff --git a/re.cpp b/re.cpp
index dc7fbe7..3d800fe 100644
--- a/re.cpp
+++ b/re.cpp
@@ -9,6 +9,7 @@
#include "unicode/regex.h"
#include "unicode/unistr.h"
+#include "unicode/schriter.h"
#include "ruby/ruby.h"