macruby

Should I learn MacRuby or RubyCocoa

I am wanting to learn mac development with ruby but I'm not sure which one to go at. RubyCocoa has been around longer but I think MacRuby will beat it out in the long run.. Any suggestions?? ...

Install macruby to specific directory?

Normally macruby wants to install to /usr/local via 'rake install' I want it in another location. How do I do this? ...

NSBezierPath / Line Intersection / flatten

Hello, I'm currently porting my jruby/java2d Graph Drawing/Layouting application to macruby/cocoa. Therefore I need to get the intersection point of an open NSBezierPath with an closed NSBezierPath. In java2d I used the following trick. I flattened both paths and did a simple line intersection test for each segment. So is there a sim...

MacRuby, sheet error

I'm running with MacRuby 0.5 and I have a method: attr_accessor :bookmarkSheet, :mainWindow def createBookmark(sender) NSApp.beginSheet(bookmarkSheet, modalForWindow:mainWindow, modalDelegate:self, didEndSelector:nil, contextInfo:nil) end which is supposed to open up a sheet panel on the main window. However, wh...

Pointers for data returned by delegate methods in MacRuby

I'm working on a small MacRuby project, using 0.5b1, which is implementing the delegate methods required for Growl (the app is using Growl for notifications). I would like to be able to respond to the Growl callbacks when the notification is clicked, however when you register the Growl delegate with ::GrowlApplicationBridge.setGrowlDele...

Using Gems with MacRuby

How do you use gems from a MacRuby .5 application on Snow Leopard? Do I need to specify the gem path? If so, how do I do this? Best scenario is to package the gems inside the application so the user would not have to install them when the app is distributed. ...

Viability of Ruby for Cross-Platform Development With Native Toolkits?

Let's say that I was writing a closed sourced commercial piece of software which was to be deployed in the following situations: Windows Desktop App built on .Net, ActiveX control, Windows Netscape plugin, Mac Desktop App built on Cocoa, Mac Netscape plugin, Java applet hosted in browser. Would it be viable in terms of code sharing to wr...

MacRuby: objective-c runtime is same as ruby runtime

I have no formal education in computer science but I have been programming in Java, Ruby, jQuery for a long time. I was checking out macruby project. I keep running into statements which are similar to "In MacRuby objective-c runtime is same as ruby runtime". I understand what MRI is. I understand what ruby 1.9 is bringing to the table...

Getting the main window of an app via an NSRunningApplication instance

Hello all, I'm observing NSWorkspaceDidDeactivateApplicationNotification notification to get the application that has just lost focus. I'm ending up with an instance of NSRunningApplication which you get from the userInfo dictionary key - NSWorkspaceApplicationKey - of the notification object. I was thinking that I'd be able to get the...

Getting source HTML from a WebView in Cocoa

I'm working on a OS X program where the user does some light WYSIWYG HTML editing in a WebView. Being new to programming with Cocoa and WebKit, I have absolutely no idea how to get selected text from a WebView - the intention being to take what the user selected, add HTML code (like div's or span's) around the text, and replace the selec...

How To CustomToken - Cocoa with Objective-C or MacRuby

I try to build an Input which is able to show one or more Token at the beginning of line. You can see an example what I'm trying to receive in the image below. (screenshot shows google-macsearch) http://www.freeimagehosting.net/uploads/4a268855a0.jpg Cocoa provides the NSToken class, but I like to do it by myself and custom, but I don'...

When aiming to AOT compile a ruby script with MacRuby is there any restriction on the language?

I am looking into using MacRuby and am interested in it's ability to AOT compile ruby code down to an executable. I am wondering though whether this places a restriction on the code in any way? Is there a subset of ruby which is supported or can i go ahead and perform all the meta-magic i want and still have the code AOT compiled? ...

Can gems be used by ruby code compiled with macrubyc

MacRuby 0.5 includes a ruby compiler built on LLVM called macrubyc. Does anyone know if it would be possible to dynamically load gems from compiled code? Or compile the gems and link them in? Is this planned? Or how compiled code will be able to make use of gems in general. ...

catch system information using macruby or ruby cocoa

Hi, Could you tell me plz - how to catch system information like os version, installed apps versions, hardware details using macruby or ruby cocoa? ...

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}" end end The above code is in HelloApp.rb The problem is when I type something into the t...

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? ...

Binding the textDidChange event on a NSTextField to a MacRuby delegate

I have a NSTextField within a Window and I created a very simple MacRuby delegate: class ServerInputDelegate attr_accessor :parent def textDidChange(notification) NSLog notification.inspect parent.filter end end And I have tried setting the control's delegate: I have tried setting the Window and every o...

How to use Obj-C classes in MacRuby

I am trying to use an external Obj-C class in my MacRuby project, but I can't figure out how to import it. Specifically, I want to use ObjectiveResource inside a MacRuby 0.5 project (since ActiveResource doesn't work - yet). I have gotten as far as the 'framework' command in MacRuby, but it only seems to apply to actual frameworks. Qu...

What languages besides Objective-C will generate application code that works on an iPad?

I would like to write an app for the iPad but I can't stand Objective-C. Is there a language generator that would spit out Objective-C but let me write my iPad application in another language? I've heard a little about MacRuby and am curious whether it could be used this way. Any other similar projects in other languages? ...

Do I need RubyCocoaBridge or MacRuby or both to develop in Ruby for the iPad?

I've heard both MacRuby and Ruby CocoaBridge discussed in relation to iPhone/iPad development in Ruby. Do I need one or both of these? ...