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

Use simple & useful ruby methods such as basename in RubyMotion

RubyMotion does not support require in code (only in RakeFile). Is there a way to use useful classes built into Ruby but not into RubyMotion ? For instance, I'd like to be able to do a name=Pathname.new("/path/to/some/file").basename rather…
MichaelC
  • 357
  • 2
  • 12
1
vote
1 answer

FFI from MacRuby?

I need to use a gem from MacRuby (ruby-keychain), and this gem uses FFI. But it looks like FFI is not working from MacRuby. Using the irb console, it works fine : cobalt:~ charbon$ irb irb(main):001:0> require 'ffi' => true irb(main):002:0> module…
MichaelC
  • 357
  • 2
  • 12
1
vote
2 answers

How to Create a FileMaker Pro Record with scripting bridge

I am working on a Ruby Script (using MacRuby with Scripting Bridge) to do some processing on a FileMaker Pro database (FMP Advanced 10.) I am able to read databases, tables, and records by creating a FileMakerProAdvancedApplication object: framework…
jars
  • 145
  • 2
  • 8
1
vote
3 answers

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, …
Lukas
  • 3,175
  • 2
  • 25
  • 34
1
vote
2 answers

MacRuby Accessing/Updating Text Fields

I'm fairly new to Ruby/MacRuby. I followed the stopwatch example on the MacRuby website and i used that example to try and make a simple app which takes 6 small text fields and then displays the input in another larger text field. I found a couple…
pattmorter
  • 991
  • 9
  • 21
1
vote
1 answer

How do you construct "whose name is X" style statements in macruby/scriptingbridge?

In applescript: set allItems to every item whose name is "foo" In rb-appscript: all_items = items[its.name.eq "Foo"] Is there a way to construct a similar search/predicate/what-have-you in MacRuby/ScriptingBridge?
Jan-Yves
  • 11
  • 1
1
vote
2 answers

Uninitialized constant NSJSONSerialization

How can I get NSJSONSerialization to be recognized in macruby? framework 'foundation' puts NSXMLDocument #=> NSXMLDocument puts NSJSONSerialization #=> /Users/home/Desktop/Dropbox/script.rb:3:in `
': uninitialized constant…
Josh Voigts
  • 4,114
  • 1
  • 18
  • 43
1
vote
1 answer

Runtime error trying to use CoreGraphics with MacRuby

I'm trying to build a MacRuby 0.12 project on OSX 10.8. The problem appears to be that this line: @context = NSGraphicsContext.currentContext.graphicsPort throws this error: unrecognized runtime type `{CGContext=}' (TypeError) I can dereference…
Adrian Petrescu
  • 16,629
  • 6
  • 56
  • 82
1
vote
2 answers

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?
Daniel Huckstep
  • 5,368
  • 10
  • 40
  • 56
1
vote
2 answers

Accessing an external file from MacRuby

I have done several small scripting/automation projects before but this is my first time using MacRuby and I couldn't find out at all why my project is not working. This task would have been easy to fix if it was just a plain Ruby script. However,…
Noel Llevares
  • 15,018
  • 3
  • 57
  • 81
1
vote
1 answer

Creating an iTunes playlist and adding tracks in MacRuby

Why does this code result in an empty playlist, and how can I get that track into the playlist? #!/usr/local/bin/macruby framework 'Cocoa' framework 'ScriptingBridge' load_bridge_support_file 'iTunes.bridgesupport' iTunes =…
Chris Adams
  • 1,008
  • 1
  • 11
  • 22
1
vote
0 answers

MacRuby issue with checkbox

I want to check the status of a checkbox within my program. When I code an if statement to check what its current state is, it automatically "checks" the box and continues with the first option, even if it originally is false. Code below def execute…
1
vote
0 answers

Bonjour with Macruby

I understand using Dnssd within ruby but it seems that dnssd does not load in Macruby. I was curious if anyone knew of something like dnssd or could give an example way to browse bonjour on a network using macruby. Ive been told this is possible…
Frostburn
  • 31
  • 3
1
vote
1 answer

Converting images with MacRuby

Does anybody know how to convert images with MacRuby (or normal ruby)? I would imagine that the 'ScriptingBridge' framework would be able to handle it. In addition, I would prefer not to use ImageMagick or the like (something lighter would be fine,…
dejay
  • 758
  • 2
  • 6
  • 18
1
vote
1 answer

Running Sinatra within a MacRuby app

I'm new to MacRuby with Xcode but I have what I think (hope) is a simple question. I have a small Ruby Sinatra web app that I want to package as a Mac OS packaged application (.app). The application (however it is packaged) is used to read a…
James Pierce
  • 558
  • 2
  • 5
  • 16