I installed BridgeSupport Preview 3 in order to resolve some issues related to errors looking up constant values. The new BridgeSupport worked fine and the application I have been working runs fine. I have 'embedded' MacRuby so that it can be distributed but here I come unstuck. When run on a computer that does not have the BridgeSupport upgrade, it crashes; it seems that, while the app makes no reference to the MacRuby framework, it does need the new version of BridgeSupport in order to run. This makes the notion of an embedding fragile - is there a way to embed the required BridgeSupport, or must I require that users upgrade their BrigeSupport before they install my app.?
Hi Martin, There is a way: if you copy the .bridgesupport files of your system inside your application's bundle, under the Resources/BridgeSupport directory, MacRuby should look at them in priority. Examples: Foo.app/Contents/Resources/BridgeSupport/Foundation.bridgesupport Foo.app/Contents/Resources/BridgeSupport/AppKit.bridgesupport etc. I think we should add an option to macruby_deploy to automate this. Could you file a ticket? Laurent On Feb 8, 2011, at 1:07 AM, Martin Hawkins wrote:
I installed BridgeSupport Preview 3 in order to resolve some issues related to errors looking up constant values. The new BridgeSupport worked fine and the application I have been working runs fine. I have 'embedded' MacRuby so that it can be distributed but here I come unstuck.
When run on a computer that does not have the BridgeSupport upgrade, it crashes; it seems that, while the app makes no reference to the MacRuby framework, it does need the new version of BridgeSupport in order to run.
This makes the notion of an embedding fragile - is there a way to embed the required BridgeSupport, or must I require that users upgrade their BrigeSupport before they install my app.? _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
If you specify a full path does Bridge Support behave this way? Such as load_bridge_support_file NSBundle.mainBundle.pathForResource("MyFramework", ofType:"bridgesupport") Robert On 8/02/2011, at 10:50 PM, Laurent Sansonetti wrote:
Hi Martin,
There is a way: if you copy the .bridgesupport files of your system inside your application's bundle, under the Resources/BridgeSupport directory, MacRuby should look at them in priority.
Examples:
Foo.app/Contents/Resources/BridgeSupport/Foundation.bridgesupport Foo.app/Contents/Resources/BridgeSupport/AppKit.bridgesupport etc.
I think we should add an option to macruby_deploy to automate this. Could you file a ticket?
Laurent
On Feb 8, 2011, at 1:07 AM, Martin Hawkins wrote:
I installed BridgeSupport Preview 3 in order to resolve some issues related to errors looking up constant values. The new BridgeSupport worked fine and the application I have been working runs fine. I have 'embedded' MacRuby so that it can be distributed but here I come unstuck.
When run on a computer that does not have the BridgeSupport upgrade, it crashes; it seems that, while the app makes no reference to the MacRuby framework, it does need the new version of BridgeSupport in order to run.
This makes the notion of an embedding fragile - is there a way to embed the required BridgeSupport, or must I require that users upgrade their BrigeSupport before they install my app.? _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Yep it does. But if you copy the BridgeSupport file under the "special" Resources/BridgeSupport directory of your .app bundle, you do not need to pass the full path nor use #load_bridge_support_file. You can just use #framework as before. Laurent On Feb 8, 2011, at 1:56 AM, Robert Payne wrote:
If you specify a full path does Bridge Support behave this way? Such as
load_bridge_support_file NSBundle.mainBundle.pathForResource("MyFramework", ofType:"bridgesupport")
Robert
On 8/02/2011, at 10:50 PM, Laurent Sansonetti wrote:
Hi Martin,
There is a way: if you copy the .bridgesupport files of your system inside your application's bundle, under the Resources/BridgeSupport directory, MacRuby should look at them in priority.
Examples:
Foo.app/Contents/Resources/BridgeSupport/Foundation.bridgesupport Foo.app/Contents/Resources/BridgeSupport/AppKit.bridgesupport etc.
I think we should add an option to macruby_deploy to automate this. Could you file a ticket?
Laurent
On Feb 8, 2011, at 1:07 AM, Martin Hawkins wrote:
I installed BridgeSupport Preview 3 in order to resolve some issues related to errors looking up constant values. The new BridgeSupport worked fine and the application I have been working runs fine. I have 'embedded' MacRuby so that it can be distributed but here I come unstuck.
When run on a computer that does not have the BridgeSupport upgrade, it crashes; it seems that, while the app makes no reference to the MacRuby framework, it does need the new version of BridgeSupport in order to run.
This makes the notion of an embedding fragile - is there a way to embed the required BridgeSupport, or must I require that users upgrade their BrigeSupport before they install my app.? _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Thank you for the replies.
On 8/02/2011, at 10:50 PM, Laurent Sansonetti wrote:
Hi Martin,
There is a way: if you copy the .bridgesupport files of your system inside your application's bundle, under the Resources/BridgeSupport directory, MacRuby should look at them in priority.
Examples:
Foo.app/Contents/Resources/BridgeSupport/Foundation.bridgesupport Foo.app/Contents/Resources/BridgeSupport/AppKit.bridgesupport etc.
Just to confirm - I have added a folder under Resources in Xcode called BridgeSupport into which I have copied AppKit.bridgesupport CoreServices.bridgesupport Cocoa.bridgesupport and Foundation.bridgesupport When I build now, I see the Contents/Resources/BridgeSupport directory containing the .bridgesupport files, so it seems to have had the desired effect. I'll be able to get it tested soon and I'll let you know if there are any further problems.
I think we should add an option to macruby_deploy to automate this. Could you file a ticket?
Will file a ticket now.
Laurent
On Feb 8, 2011, at 5:30 AM, Martin Hawkins wrote:
Thank you for the replies.
On 8/02/2011, at 10:50 PM, Laurent Sansonetti wrote:
Hi Martin,
There is a way: if you copy the .bridgesupport files of your system inside your application's bundle, under the Resources/BridgeSupport directory, MacRuby should look at them in priority.
Examples:
Foo.app/Contents/Resources/BridgeSupport/Foundation.bridgesupport Foo.app/Contents/Resources/BridgeSupport/AppKit.bridgesupport etc.
Just to confirm - I have added a folder under Resources in Xcode called BridgeSupport into which I have copied AppKit.bridgesupport CoreServices.bridgesupport Cocoa.bridgesupport and Foundation.bridgesupport
When I build now, I see the Contents/Resources/BridgeSupport directory containing the .bridgesupport files, so it seems to have had the desired effect. I'll be able to get it tested soon and I'll let you know if there are any further problems.
Seems good! Let us know if it does not work.
I think we should add an option to macruby_deploy to automate this. Could you file a ticket?
Will file a ticket now.
Thanks. I added the 0.9-blocker keyword, as I think it should go with the --gem option too. Laurent
Laurent, Your suggestion didn't work. We've taken to defining the constants locally (it's KInternetEventClass KAEGetURL for NSAppleEventManager that are causing all this). I'm having difficulty testing this because I'm relying on a third party to do so - I had to upgrade both my iMac and Powerbook to BridgeSupport Preview 3, so unless I can roll back on one of them (which you said was difficult) it's going to be hard to fix this. regards Martin On Feb 8, 10:54 pm, Laurent Sansonetti <lsansone...@apple.com> wrote:
Seems good! Let us know if it does not work.
I think we should add an option to macruby_deploy to automate this. Could you file a ticket?
Will file a ticket now.
Thanks. I added the 0.9-blocker keyword, as I think it should go with the --gem option too.
Laurent
_______________________________________________ MacRuby-devel mailing list MacRuby-de...@lists.macosforge.orghttp://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi, I'm not sure if this is technically supposed to work in MacRuby but it definitely works in objective-c. class MyClass < NSWindowController attr_accessor :someTextField def name() return @name end def setName(value) @name = value end def windowDidLoad() @name = "Robert" self.someTextField.bind("value", toObject:self, withKeyPath:"name", options:nil) end end I also tried binding the text field's value directly via interface builder but it doesn't work there either. Interestingly if you set the "name" on the class inside MacRuby it'll update the text field but updating the text field via the GUI doesn't bring the new value back down into MacRuby. Are bindings something that have to be done with Cocoa controllers? Thanks, Robert Payne
I think if you define an accessor for 'name' with attr_accessor as you have done with someTextField, then this should work. You can then remove the accessor methods you have created for the 'name' instance var. On 9 Feb 2011, at 08:51, Robert Payne <robertpayne@me.com> wrote:
Hi,
I'm not sure if this is technically supposed to work in MacRuby but it definitely works in objective-c.
class MyClass < NSWindowController
attr_accessor :someTextField
def name() return @name end
def setName(value) @name = value end
def windowDidLoad() @name = "Robert" self.someTextField.bind("value", toObject:self, withKeyPath:"name", options:nil) end
end
I also tried binding the text field's value directly via interface builder but it doesn't work there either. Interestingly if you set the "name" on the class inside MacRuby it'll update the text field but updating the text field via the GUI doesn't bring the new value back down into MacRuby.
Are bindings something that have to be done with Cocoa controllers?
Thanks, Robert Payne _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
I actually solved this. It turns out I did not set the flag "Continuously Update Value" on the binding so it would only update if you actually pressed enter. The name/setName methods I only defined to test if they were getting called and attr_accessor actually generates these for you. -Robert On 9/02/2011, at 10:48 PM, Alan Skipp wrote:
I think if you define an accessor for 'name' with attr_accessor as you have done with someTextField, then this should work. You can then remove the accessor methods you have created for the 'name' instance var.
On 9 Feb 2011, at 08:51, Robert Payne <robertpayne@me.com> wrote:
Hi,
I'm not sure if this is technically supposed to work in MacRuby but it definitely works in objective-c.
class MyClass < NSWindowController
attr_accessor :someTextField
def name() return @name end
def setName(value) @name = value end
def windowDidLoad() @name = "Robert" self.someTextField.bind("value", toObject:self, withKeyPath:"name", options:nil) end
end
I also tried binding the text field's value directly via interface builder but it doesn't work there either. Interestingly if you set the "name" on the class inside MacRuby it'll update the text field but updating the text field via the GUI doesn't bring the new value back down into MacRuby.
Are bindings something that have to be done with Cocoa controllers?
Thanks, Robert Payne _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi Martin, Are you sure you embedded the BridgeSupport file defining the kInternetEventClass constant? Looking on my system, it's in the HIServices.bridgesupport file. You need to embed all BridgeSupport file dependencies, not only Cocoa or Foundation. Here is a command snippet that will embed *all* of them: $ find /System/Library/Frameworks -name "*.bridgesupport" -exec cp {} /path/to/MyApp.app/Contents/Resources/BridgeSupport \; That is going to increase your app bundle of about 7MB. You can remove the frameworks files you don't use after,. The solution we will implement in macruby_deploy might be a bit smarter by only embedding the files you need. Laurent On Feb 9, 2011, at 12:24 AM, Martin Hawkins wrote:
Laurent, Your suggestion didn't work. We've taken to defining the constants locally (it's KInternetEventClass KAEGetURL for NSAppleEventManager that are causing all this). I'm having difficulty testing this because I'm relying on a third party to do so - I had to upgrade both my iMac and Powerbook to BridgeSupport Preview 3, so unless I can roll back on one of them (which you said was difficult) it's going to be hard to fix this.
regards Martin
On Feb 8, 10:54 pm, Laurent Sansonetti <lsansone...@apple.com> wrote:
Seems good! Let us know if it does not work.
I think we should add an option to macruby_deploy to automate this. Could you file a ticket?
Will file a ticket now.
Thanks. I added the 0.9-blocker keyword, as I think it should go with the --gem option too.
Laurent
_______________________________________________ MacRuby-devel mailing list MacRuby-de...@lists.macosforge.orghttp://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
You are right. I don't know what I was thinking - I included the .bridgesupport files for the frameworks I was using but the problem lay outside that - as you say, in HIServices. I'll amend the build and try again and let you know the result. Thanks for persisting :) On Feb 9, 10:21 am, Laurent Sansonetti <lsansone...@apple.com> wrote:
Hi Martin,
Are you sure you embedded the BridgeSupport file defining the kInternetEventClass constant?
Looking on my system, it's in the HIServices.bridgesupport file.
You need to embed all BridgeSupport file dependencies, not only Cocoa or Foundation. Here is a command snippet that will embed *all* of them:
$ find /System/Library/Frameworks -name "*.bridgesupport" -exec cp {} /path/to/MyApp.app/Contents/Resources/BridgeSupport \;
That is going to increase your app bundle of about 7MB. You can remove the frameworks files you don't use after,. The solution we will implement in macruby_deploy might be a bit smarter by only embedding the files you need.
Laurent
participants (4)
-
Alan Skipp
-
Laurent Sansonetti
-
Martin Hawkins
-
Robert Payne