Questions tagged [macruby]

MacRuby is an implementation of the Ruby 1.9 programming language in ObjC for Mac OSX

MacRuby is an implementation of Ruby 1.9 directly on top of Mac OS X core technologies such as the Objective-C runtime and garbage collector, the LLVM compiler infrastructure and the Foundation and ICU frameworks. It is the goal of MacRuby to enable the creation of full-fledged Mac OS X applications which do not sacrifice performance in order to enjoy the benefits of using Ruby.

http://macruby.org/

221 questions
0
votes
1 answer

how to SCNetworkReachabilityCreateWithName with macruby

i really don't know how to convert the example provided by apple into macruby code, since address is a char pointer, irghhh: SCNetworkReachabilityRef target; SCNetworkConnectionFlags flags = 0; Boolean ok; target =…
phoet
  • 18,688
  • 4
  • 46
  • 74
0
votes
2 answers

In a MacRuby app for distribution, how can you launch an NSTask that invokes a Ruby script with macruby?

I have a MacRuby app, and after the app launches, I would like to launch a second process using an NSTask. The second process is a Ruby script bundled with the app. I would like to launch it using the MacRuby macruby interpreter that gets compiled…
dan
  • 43,914
  • 47
  • 153
  • 254
0
votes
2 answers

When a cocoa method wants a selector as a parameter, how do I express this in ruby?

In this tutorial for sheet programming in cocoa, I am told to invoke the following method: [[alert beginSheetModalForWindow:[searchField window] modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) …
Ziggy
  • 21,845
  • 28
  • 75
  • 104
0
votes
1 answer

MacRuby: EXC_BAD_ACCESS on file dialog

I have been using MacRuby and running through the book MacRuby:The Definitive Guide by Matt Aimonetti. On the Movies CoreData app example, I've got this code: def add_image(sender) movie = movies.selectedObjects.lastObject return unless…
zorz
  • 75
  • 8
0
votes
1 answer

How do you write a gemspec for a gem that targets MacRuby?

I'm starting to write a gem for the MacRuby platform. What is the platform you're supposed to specify in the Gem::Specification?
dan
  • 43,914
  • 47
  • 153
  • 254
0
votes
1 answer

MacRuby: Restrict NSTextField to Integers

I'm just picking up the basics of Cocoa and Interface Builder -- using IB version 3.2.6. I'm looking to learn how to use MacRuby for native OS X apps. I have an NSTextField that I would like to only accept integer values. I used NSNumberFormatter…
Andrew
  • 42,517
  • 51
  • 181
  • 281
0
votes
1 answer

Dynamic refresh in a view - xcode 4 / interface builder

I'm new to xcode so please bear with me. I have a label that I have set to blank, and after a user clicks 'go' I generate a random word or number and use: self.label.stringValue = "some_word" to update the view. (I am using MacRuby btw) However, I…
A4J
  • 879
  • 10
  • 24
0
votes
1 answer

Calling MacRuby via JavaScript with the windowScriptObject and WebKit

I have a new MacRuby application. I'm trying to call a MacRuby method from JavaScript loaded in a webView within the application. The Calling Objective-C Methods From JavaScript tutorial shows how to add a key to the webScriptObject that's value is…
jpoz
  • 2,257
  • 1
  • 23
  • 29
0
votes
1 answer

EXC BAD ACCESS from CoreGraphics API in NSOperation

I'm trying to do some CoreGraphics/CoreImage manipulation inside an NSOperation, using MacRuby. I have a few API calls that read a source file into CG and set up a CGImageDestination. If I put the following code into an NSOperation.init, everything…
Ben K.
  • 1,779
  • 5
  • 18
  • 21
0
votes
1 answer

Menu click (or right click) on a image and add black border in Mac OSX (Snow Leopard)

I wrote a MacRuby script to apply some border to image. But I can't figure out how to make something like a menu-click (right click) on a image and run the script to apply the effect to the image. Where/what do I need to RTFM? Or has anybody got…
Teo Choong Ping
  • 12,512
  • 18
  • 64
  • 91
0
votes
1 answer

MacRuby custom initializers

Just discovered MacRuby this afternoon; man is that ever COOL! However, I've run into some difficulties while attempting to extend an old project with some MacRuby-fu. Here's the deal: So I have a superclass in Objective-C that looks like…
Grimless
  • 1,268
  • 1
  • 15
  • 30
0
votes
1 answer

forKeyPath troubles with Quartz Composer and MacRuby

I am having some issues with setting values using MacRuby and Cocoa. I have the inserted the QCView and the QCPatchController into the XIB and loaded the composition into the QCPatchController. Everything is running but I cannot access the published…
tsugua
  • 197
  • 1
  • 13
0
votes
1 answer

Where is that modified version rails3 running on macruby?

http://www.macruby.org/blog/2010/04/30/macruby06.html In MacRuby blog. They said that: This release also passes about 85% of RubySpecs, is able to run a modified version of Rails 3, and implements better support for Ruby 1.9 encodings. How can I…
colder
  • 644
  • 7
  • 12
0
votes
1 answer

How to get the url which the browser is current visiting?

I want to implement a tiny app that can save the current url opening in the browser to delicious. So the first thing to do is get the url. So what function/class can we use to get the curl in the browser?
Roc Yu
  • 93
  • 2
  • 8
0
votes
1 answer

MacRuby xcode label not working

class HelloApp attr_accessor :label, :text_field, :button def clickedButton(sender) # implementation your_name = self.text_field.stringValue self.label.stringValue = "Hello, #{your_name}" …
lotsofsloths
  • 121
  • 1
  • 3
  • 8