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
2
votes
2 answers

No input to NSTextField when running macruby

i have a simple macruby application and i want to get some user-input via a NSTextField, but when i run the application with '''macruby test.rb''' all the input on the focused text-field goes into the bash. is there something that i need to set, to…
phoet
  • 18,688
  • 4
  • 46
  • 74
2
votes
1 answer

How to get interface builder to recognise receiving action method in delegate

NEWBIE QUESTION ALERT! I have a brand new macruby application in Xcode 4.1. In my application delegate I add this method: def receiveSomeEventFromXib(sender) puts "receiveSomeEventFromXib" end In interface builder, I right click on the delegate…
user577814
  • 387
  • 1
  • 3
  • 6
2
votes
1 answer

Is it acceptable to call openssl within an app submitted to the Mac App Store?

I'm a bit unclear on what the rules are in terms of calling on processes outside of an application submitted to the App Store. I have read that if you want to use other libraries/frameworks aside from Cocoa and the OSX libraries you must include it…
Edwardr
  • 2,906
  • 3
  • 27
  • 30
2
votes
1 answer

How to set the defaults for an NSFontPanel?

I'm setting up the preferences window for my cool app, which displays some text. In preferences I've set up a button that opens an NSFontPanel. My app stores the user's preferred text color and font, and always opens with those settings so that the…
Ziggy
  • 21,845
  • 28
  • 75
  • 104
2
votes
1 answer

Quotation Mark in ruby regular expression misinterpreted as start of string

I have a macruby project in xcode, in which I want to replace all the left and right quotes in a string with ~@@~@@~" and "~@@~@@~, respectively. I tested the following code in rubular.com, and it works correctly. string.gsub!(/\B"/,…
V9801
  • 375
  • 2
  • 11
2
votes
1 answer

What is the easyest way to use gems in a macruby application, in XCode?

I need to include a rubygem in a simple macruby application i am creating in XCode. Using require 'rubygems' does not give an error, but the next line to require any other gems has a load error. I installed the gems using macgems. Thanks in advance.
V9801
  • 375
  • 2
  • 11
2
votes
5 answers

Weird EXC_BAD_ACCESS in a trivial PDFKit program

I have written this trivial action method associated to a textfield. Every time I enter text into a textfield a search in a PDF is performed and PDFView automatically scroll to selection: - (IBAction) search:(id)id { NSString *query =…
pierocampanelli
  • 960
  • 5
  • 19
2
votes
1 answer

MacRuby 0.10 HotCocoa unsupported file format which is not the architecture being linked (i386)

I've installed MacRuby (via rvm): $ ruby -v MacRuby 0.10 (ruby 1.9.2) [universal-darwin10.0, x86_64] And LLVM (via homebrew): $ llvmc --version Low Level Virtual Machine (http://llvm.org/): llvm version 2.9 Optimized build. Built Jun 3 2011…
Brian
  • 4,931
  • 3
  • 32
  • 55
2
votes
2 answers

Ruby: Breaking from an Inline Block

Update Ignore the following. It turned out to be a bug restricted to Macruby 0.10 and probably specific to my install. I'll leave the post in case anyone else hits the problem. I seemed to misunderstood something about ruby blocks. I wanted to use…
TechZen
  • 64,370
  • 15
  • 118
  • 145
2
votes
2 answers

Ruby Testing: Testing for the Absence of a Method

In rspec and similar testing frameworks, how does one test for the absence of a method? I've just started fiddling with rspec and bacon (a simplified version of rspec.) I wanted to define test that would confirm that a class only allows read access…
TechZen
  • 64,370
  • 15
  • 118
  • 145
2
votes
1 answer

Using macruby, how do I set up a completion block for a Core Animation transaction?

I'm using MacRuby to do Core Animation programming. I've tried all I can think of and searched all over (and maybe it can't be done in 'pure' macruby) but I can't figure out how to specify a block of MacRuby code as a completion block to be called…
Zhora
  • 549
  • 3
  • 11
2
votes
1 answer

Default NSDocument-based MacRuby application broken under XCode 4

I'm using MacRuby 0.10 and XCode 4 where I have created a default NSDocument-based application. When building and running the app, however, no window shows, and the usual menu commands are largely disabled. When creating a regular Cocoa-based…
Dan
  • 1,258
  • 1
  • 10
  • 22
2
votes
1 answer

Using Ruby on Mac OS X, how to programmatically click on the screen -- and mouse move, mouse down, and mouse up?

What are the best way(s) to do it? Can ffi, RubyCocoa, or MacRuby do it? It seems like CGEventCreateMouseEvent or CGPostMouseEvent (deprecated) can be used. Please give a working example. thanks. Update: the title of this question updated...
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
2
votes
1 answer

How can I use OS X's Accessibility API to write acceptance tests for my applications?

I'm writing a GUI application in Cocoa. I'd like to use Cucumber to write acceptance tests to continually verify that the application's features work. I'm already writing the application in MacRuby. Can I use the Accessibility API to click things…
Peeja
  • 13,683
  • 11
  • 58
  • 77
2
votes
1 answer

Interactive shell mechanism with MacRuby/XCode

I have the following noobie class: class CoreController < NSWindowController attr_accessor :consoleOutput, :consoleInput, :command, :parsedcommand def showInConsole_clicked(sender) x = `"#{@consoleInput.stringValue()}"` …
Shyam
  • 2,357
  • 8
  • 32
  • 44