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
1
vote
1 answer

Linking Controller to Window in Xcode with MacRuby

Using Xcode 4.3.2 and MacRuby .10, I start up a new MacRuby project and create a file called SetupWindowController.rb, which houses this code: class SetupWindowController < NSWindowController attr_accessor :window, :submit, :path_to_root def…
Chris
  • 11,819
  • 19
  • 91
  • 145
0
votes
1 answer

How to use C/Obj-C variadic function in MacRuby?

I declared a variadic function/method in a Obj-C class like this: @interface Foo + (void) print: (id) firstMessage, ...; @end @implementation + (void) print: (id) firstMessage, ...{ va_list ap va_start (ap, firstMessage) for (id message…
Xaree Lee
  • 3,188
  • 3
  • 34
  • 55
0
votes
1 answer

Is it possible to stub native methods using MacRuby and rspec?

I am trying to use rspec together with MacRuby to test a framework written in Objective-C. However it does not seem to be possible to stub certain selectors using this approach. For…
frankodwyer
  • 13,948
  • 9
  • 50
  • 70
0
votes
1 answer

Rewriting MacTypes::FileURL from appscript-ruby to MacRuby ScriptingBridge

I have a script that automatically attaches a given PDF to a publication in BibDesk. Using appscript-rb, the following snippet works perfectly: BibDesk = Appscript.app('BibDesk') selection = BibDesk.document.selection.get[0] f =…
Stian Håklev
  • 1,240
  • 2
  • 14
  • 26
0
votes
1 answer

How to read a global selection using MacRuby?

How can I read a global UI selection within MacRuby? For instance, of selected text in Preview. Having no experience in Ruby and Cocoa, I've decided to take a plunge and to write a small dictionary app to aid myself with translation. All the pieces…
0
votes
1 answer

Tell Mail.app to check for new mail with MacRuby

I want to use MacRuby to tell Mail.app to check for new email. But I cannot figure out how to go about this after I get an application reference using SBApplication. I have the following simple script: #!/usr/local/bin/macruby framework…
Diego Barros
  • 2,071
  • 2
  • 33
  • 45
0
votes
2 answers

MacRuby: How to create an app that can be configured from the outside?

I have a MacRuby app that is meant to be customized and distributed by other people. The app really only has a few things that can be customized, but I would like to figure out a way to package the application so that a person could run a script,…
Andrew
  • 227,796
  • 193
  • 515
  • 708
0
votes
1 answer

How to force WebView to open links in default browser?

I am writing a MacRuby (objective-c) application that is basically a web browser that opens a specific website (mine) by default. However, I don't want links to open in the WebView. I would rather they open in the user's default browser. Here is the…
Andrew
  • 227,796
  • 193
  • 515
  • 708
0
votes
1 answer

Loading in framework specific constants to MacRuby

I am writing a small MacRuby script to grab some ABRecords from a search query, but I am unsure how to gain access to enums declared in a specific header file for the AddressBook framework. I have this script and I am trying to have…
Callum Jones
  • 595
  • 4
  • 15
0
votes
0 answers

How can I create and display an NSMatrix using MacRuby?

From a new Xcode project, using MacRuby, what code needs to be added to applicationDidFinishLaunching to draw an NSMatrix in the main window? I've been trying to do this using various methods (Creating the NSMatrix manually, not using Interface…
Tronathan
  • 6,473
  • 5
  • 22
  • 24
0
votes
2 answers

Loading Growl in my Mac app: Unable to read symbols

I am trying to load Growl so I can use it in my Mac app, but I keep getting this error: warning: Unable to read symbols for @executable_path/../Frameworks/Growl.framework/Versions/A/Growl (file not found) warning: Unable to read symbols from "Growl"…
Andrew
  • 227,796
  • 193
  • 515
  • 708
0
votes
2 answers

MacRuby: How to write an app/script that generates native Mac apps?

So I'm basically trying to recreate what this app: Fluid, already does. I want to write a Ruby script, or MacRuby app that accepts a few parameters and can generate a simple native app. Since their code is not open-sourced, I can't see how they do…
Andrew
  • 227,796
  • 193
  • 515
  • 708
0
votes
3 answers

is interactive GUI-creation possible with MacRuby's macirb?

I'd like to live prototype GUIs with Macruby. Like creating a window, placing some views in it, etc.. Is that possible?
Phantrast
  • 639
  • 1
  • 9
  • 18
0
votes
1 answer

In macruby what does Module's method "__type__" do?

Module in macruby has many methods that it doesn't usually have. One of these is __type__ and I simply can't seem to figure out what it does. What does it do? Thanks! z.
Ziggy
  • 21,845
  • 28
  • 75
  • 104
0
votes
1 answer

How do I get hotcocoa to create a default project?

I followed these steps: Download MacRuby. Double-click on the zip file to extract it and double-click on the package inside the extracted directory to start the install. Just go with the defaults. You may want to kill off terminal.app if you have…
Jeremy Smith
  • 14,727
  • 19
  • 67
  • 114