[MacRuby-devel] WebScripting protocol

2010-06-07 Thread Michael Jackson
Hi,

I'm trying to create an object that conforms to the WebScripting
protocol, but the only method that is working is
invokeUndefinedMethodFromWebScript:withArguments:. Here's a sample of
my class so far. The puts statements are just there so I can see what
is actually being called.

For reference, the WebScripting protocol is defined here:
http://developer.apple.com/mac/library/documentation/Cocoa/Reference/WebKit/Protocols/WebScripting_Protocol/Reference/Reference.html


class HelloScriptObject

  def self.isKeyExcludedFromWebScript(key)
puts key.inspect
  end

  def self.webScriptNameForKey(key)
puts key.inspect
  end

  def self.isSelectorExcludedFromWebScript(sel)
puts sel.inspect
  end

  def self.webScriptNameForSelector(sel)
puts sel.inspect
  end

  def invokeUndefinedMethodFromWebScript(name, withArguments:args)
puts name
puts args.inspect
  end

  def sayHi
puts 'hi'
  end

end


The sayHi method is the one that I'm calling via JavaScript, but every
time it just defaults to using
invokeUndefinedMethodFromWebScript:withArguments: instead of using
self.isSelectorExcludedFromWebScript: to first check if the selector
is valid or not. Is support for this implemented yet (in 0.6)? If so,
what am I missing?

Thanks,

Michael

--
Michael Jackson
http://mjijackson.com
@mjijackson
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] WebScripting protocol

2010-06-10 Thread Michael Jackson
Hi Thibault,

Yes, this seems to be the problem for me. Thanks for pointing me to
the ticket. Is the fix still slated for 0.7? The milestone field on
that particular ticket is blank.

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Mon, Jun 7, 2010 at 6:26 PM, Thibault Martin-Lagardette
 wrote:
> Hi!
> I believe you are hitting this bug: http://www.macruby.org/trac/ticket/594
> There is a workaround in the first
> comment: http://www.macruby.org/trac/ticket/594#comment:1
> Let me know if that's not it though! :-)
> --
> Thibault Martin-Lagardette
>
>
> On Jun 7, 2010, at 16:21, Michael Jackson wrote:
>
> Hi,
>
> I'm trying to create an object that conforms to the WebScripting
> protocol, but the only method that is working is
> invokeUndefinedMethodFromWebScript:withArguments:. Here's a sample of
> my class so far. The puts statements are just there so I can see what
> is actually being called.
>
> For reference, the WebScripting protocol is defined here:
> http://developer.apple.com/mac/library/documentation/Cocoa/Reference/WebKit/Protocols/WebScripting_Protocol/Reference/Reference.html
>
>
> class HelloScriptObject
>
>  def self.isKeyExcludedFromWebScript(key)
>    puts key.inspect
>  end
>
>  def self.webScriptNameForKey(key)
>    puts key.inspect
>  end
>
>  def self.isSelectorExcludedFromWebScript(sel)
>    puts sel.inspect
>  end
>
>  def self.webScriptNameForSelector(sel)
>    puts sel.inspect
>  end
>
>  def invokeUndefinedMethodFromWebScript(name, withArguments:args)
>    puts name
> puts args.inspect
>  end
>
>  def sayHi
>    puts 'hi'
>  end
>
> end
>
>
> The sayHi method is the one that I'm calling via JavaScript, but every
> time it just defaults to using
> invokeUndefinedMethodFromWebScript:withArguments: instead of using
> self.isSelectorExcludedFromWebScript: to first check if the selector
> is valid or not. Is support for this implemented yet (in 0.6)? If so,
> what am I missing?
>
> Thanks,
>
> Michael
>
> --
> Michael Jackson
> http://mjijackson.com
> @mjijackson
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] MacRuby PrefPane

2010-06-10 Thread Michael Jackson
Hi all,

I've been trying to set up a preference pane in MacRuby this
afternoon, but I'm not sure the right way to go about it. In Cocoa
it's easy because there's a "preference pane bundle" project type in
the new project dialog box in Xcode. So what I did was I created a new
preference pane project in Cocoa and a new MacRuby app and then tried
to make the MacRuby app look as much like the Cocoa prefpane as I
could (by editing the Info.plist file, adding the
PreferencePanes.framework to the project, etc.)

The one problem I have at this point (there are probably more than
one, but...) is that I don't have a prefpane bundle under my targets.
I just have the App, Unit Tests, Compile, and Embed targets. I don't
know what to do at this point. I have a feeling that there should be
an easier way to do all of this, but I don't know how.

Any suggestions would be greatly appreciated. Perhaps someone has a
MacRuby prefpane bundle they're willing to share?

Thanks,

Michael

--
Michael Jackson
http://mjijackson.com
@mjijackson
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby PrefPane

2010-06-11 Thread Michael Jackson
Thank you! And don't worry about the delay for the World Cup. I'll be
glued to the TV as well, so I won't be getting much work done either.
;)

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Thu, Jun 10, 2010 at 11:33 PM, Matt Aimonetti
 wrote:
> Hi MJ,
>
> I'll try to get that done for you ASAP, but with the world cup starting
> tomorrow, ASAP might mean a few days from now ;)
>
> - Matt
>
>
> On Thu, Jun 10, 2010 at 5:22 PM, Michael Jackson 
> wrote:
>>
>> Hi all,
>>
>> I've been trying to set up a preference pane in MacRuby this
>> afternoon, but I'm not sure the right way to go about it. In Cocoa
>> it's easy because there's a "preference pane bundle" project type in
>> the new project dialog box in Xcode. So what I did was I created a new
>> preference pane project in Cocoa and a new MacRuby app and then tried
>> to make the MacRuby app look as much like the Cocoa prefpane as I
>> could (by editing the Info.plist file, adding the
>> PreferencePanes.framework to the project, etc.)
>>
>> The one problem I have at this point (there are probably more than
>> one, but...) is that I don't have a prefpane bundle under my targets.
>> I just have the App, Unit Tests, Compile, and Embed targets. I don't
>> know what to do at this point. I have a feeling that there should be
>> an easier way to do all of this, but I don't know how.
>>
>> Any suggestions would be greatly appreciated. Perhaps someone has a
>> MacRuby prefpane bundle they're willing to share?
>>
>> Thanks,
>>
>> Michael
>>
>> --
>> Michael Jackson
>> http://mjijackson.com
>> @mjijackson
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby PrefPane

2010-06-12 Thread Michael Jackson
Looks great. Thanks again. I'll give it a shot this weekend.

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Sat, Jun 12, 2010 at 12:55 AM, Matt Aimonetti
 wrote:
> I added to trunk the PrefPane template we worked on but I did take the time
> to update the nightly installer. In the meantime, please give:
> http://dl.dropbox.com/u/163257/MacRuby%20PrefPane%20Template.pkg  a try.
>
> Or you can clone the git repo and copy the template to your Xcode templates.
>
> Let me know if something doesn't work for you.
>
> - Matt
>
> On Fri, Jun 11, 2010 at 7:32 AM, Michael Jackson 
> wrote:
>>
>> Thank you! And don't worry about the delay for the World Cup. I'll be
>> glued to the TV as well, so I won't be getting much work done either.
>> ;)
>>
>> --
>> Michael Jackson
>> http://mjijackson.com
>> @mjijackson
>>
>>
>>
>> On Thu, Jun 10, 2010 at 11:33 PM, Matt Aimonetti
>>  wrote:
>> > Hi MJ,
>> >
>> > I'll try to get that done for you ASAP, but with the world cup starting
>> > tomorrow, ASAP might mean a few days from now ;)
>> >
>> > - Matt
>> >
>> >
>> > On Thu, Jun 10, 2010 at 5:22 PM, Michael Jackson 
>> > wrote:
>> >>
>> >> Hi all,
>> >>
>> >> I've been trying to set up a preference pane in MacRuby this
>> >> afternoon, but I'm not sure the right way to go about it. In Cocoa
>> >> it's easy because there's a "preference pane bundle" project type in
>> >> the new project dialog box in Xcode. So what I did was I created a new
>> >> preference pane project in Cocoa and a new MacRuby app and then tried
>> >> to make the MacRuby app look as much like the Cocoa prefpane as I
>> >> could (by editing the Info.plist file, adding the
>> >> PreferencePanes.framework to the project, etc.)
>> >>
>> >> The one problem I have at this point (there are probably more than
>> >> one, but...) is that I don't have a prefpane bundle under my targets.
>> >> I just have the App, Unit Tests, Compile, and Embed targets. I don't
>> >> know what to do at this point. I have a feeling that there should be
>> >> an easier way to do all of this, but I don't know how.
>> >>
>> >> Any suggestions would be greatly appreciated. Perhaps someone has a
>> >> MacRuby prefpane bundle they're willing to share?
>> >>
>> >> Thanks,
>> >>
>> >> Michael
>> >>
>> >> --
>> >> Michael Jackson
>> >> http://mjijackson.com
>> >> @mjijackson
>> >> ___
>> >> MacRuby-devel mailing list
>> >> [email protected]
>> >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> >
>> >
>> > ___
>> > MacRuby-devel mailing list
>> > [email protected]
>> > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> >
>> >
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Building Cocoa Apps with MacRuby

2010-06-17 Thread Michael Jackson
The way I'm currently doing it is with two separate apps as well. I
keep the Xcode GDB window open for building and debug output and I
have MacVim open for editing the code. Of course, I have to open up
the main project window if I want to add some files to the project,
but I find that having Xcode open anyways is a good idea because I
need to consult the documentation quite often (I'm new to Cocoa).

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Thu, Jun 17, 2010 at 11:52 AM, dan sinclair  wrote:
> I tried using TextMate with XCode for a while but I didn't like having to 
> switch back and forth between the two all the time. It felt clunky to develop 
> in TextMate and build and see the debug output in XCode. Having to run XCode 
> just to be able to build the application felt heavy. That was part of the 
> reason why I switched to a pure Rakefile method.
>
> dan
>
>
>
> On 2010-06-17, at 1:43 PM, Rich Morin wrote:
>
>> Xcode has some scripting capability.  Might you be able to
>> hack up some scripts to automate away some of the hassle?
>>
>> -r
>> --
>> http://www.cfcl.com/rdm            Rich Morin
>> http://www.cfcl.com/rdm/resume     [email protected]
>> http://www.cfcl.com/rdm/weblog     +1 650-873-7841
>>
>> Technical editing and writing, programming, system design
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] OS version support

2010-07-01 Thread Michael Jackson
Which versions of Mac OSX are able to run MacRuby Cocoa apps? Right
now I'm using MacRuby 0.6 in Xcode 3.

--
Michael Jackson
http://mjijackson.com
@mjijackson
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Using the SystemConfiguration framework

2010-07-02 Thread Michael Jackson
How exactly does one go about using the SystemConfiguration framework
in MacRuby?

http://developer.apple.com/mac/library/documentation/Networking/Reference/SysConfig/index.html

When I try "framework 'SystemConfiguration'" it returns true, but none
of the inline C functions are available. From the reading I've done,
it seems that static C libraries like SystemConfiguration should be
loaded via a BridgeSupport file, but I have no idea how to generate
one in this case.

--
Michael Jackson
http://mjijackson.com
@mjijackson
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Using the SystemConfiguration framework

2010-07-02 Thread Michael Jackson
It's complaining that there aren't any inline functions in the
SystemConfiguration framework. This is the command I ran and the
output I received:

$ gen_bridge_metadata -f
/System/Library/Frameworks/SystemConfiguration.framework -F dylib -o
SystemConfiguration.dylib
No inline functions in the given framework/library, no need to generate a dylib.

However, this doesn't make any sense to me. The documentation clearly
lists lots of inline functions. C isn't my best language, so maybe I'm
misunderstanding something...

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Fri, Jul 2, 2010 at 4:23 PM, Thibault Martin-Lagardette
 wrote:
> To use inline C function you need to generate a dylib using 
> gen_bridge_metatada.
> If you do `man gen_bridge_metadata`, you'll see:
>
>> If the custom framework has inline functions and you want to be able to call 
>> them, here is how you can generate a ``dylib'' file:
>>     gen_bridge_metadata -f /Path/To/YourFramework.framework -F dylib -o 
>> /Path/To/YourFramework.framework/Resources/BridgeSupport/YourFramework.dylib
>
> Then you just need to require the generated dylib :-)
>
> It looks like this corresponds to what you want to do? :-)
>
> --
> Thibault Martin-Lagardette
>
>
>
> On Jul 2, 2010, at 14:49, Michael Jackson wrote:
>
>> How exactly does one go about using the SystemConfiguration framework
>> in MacRuby?
>>
>> http://developer.apple.com/mac/library/documentation/Networking/Reference/SysConfig/index.html
>>
>> When I try "framework 'SystemConfiguration'" it returns true, but none
>> of the inline C functions are available. From the reading I've done,
>> it seems that static C libraries like SystemConfiguration should be
>> loaded via a BridgeSupport file, but I have no idea how to generate
>> one in this case.
>>
>> --
>> Michael Jackson
>> http://mjijackson.com
>> @mjijackson
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Using the SystemConfiguration framework

2010-07-02 Thread Michael Jackson
Not sure yet. The whole framework is a bit of a mess from my point of
view. I need to be able to tinker a bit in order to figure out how to
use it. ;)

I'd probably start with the SCNetworkConfiguration and SCDynamicStore API's.

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Fri, Jul 2, 2010 at 5:09 PM, Thibault Martin-Lagardette
 wrote:
> Which specific inline function are you trying to use?
>
> --
> Thibault Martin-Lagardette
>
>
>
> On Jul 2, 2010, at 15:44, Michael Jackson wrote:
>
>> It's complaining that there aren't any inline functions in the
>> SystemConfiguration framework. This is the command I ran and the
>> output I received:
>>
>> $ gen_bridge_metadata -f
>> /System/Library/Frameworks/SystemConfiguration.framework -F dylib -o
>> SystemConfiguration.dylib
>> No inline functions in the given framework/library, no need to generate a 
>> dylib.
>>
>> However, this doesn't make any sense to me. The documentation clearly
>> lists lots of inline functions. C isn't my best language, so maybe I'm
>> misunderstanding something...
>>
>> --
>> Michael Jackson
>> http://mjijackson.com
>> @mjijackson
>>
>>
>>
>> On Fri, Jul 2, 2010 at 4:23 PM, Thibault Martin-Lagardette
>>  wrote:
>>> To use inline C function you need to generate a dylib using 
>>> gen_bridge_metatada.
>>> If you do `man gen_bridge_metadata`, you'll see:
>>>
>>>> If the custom framework has inline functions and you want to be able to 
>>>> call them, here is how you can generate a ``dylib'' file:
>>>>     gen_bridge_metadata -f /Path/To/YourFramework.framework -F dylib -o 
>>>> /Path/To/YourFramework.framework/Resources/BridgeSupport/YourFramework.dylib
>>>
>>> Then you just need to require the generated dylib :-)
>>>
>>> It looks like this corresponds to what you want to do? :-)
>>>
>>> --
>>> Thibault Martin-Lagardette
>>>
>>>
>>>
>>> On Jul 2, 2010, at 14:49, Michael Jackson wrote:
>>>
>>>> How exactly does one go about using the SystemConfiguration framework
>>>> in MacRuby?
>>>>
>>>> http://developer.apple.com/mac/library/documentation/Networking/Reference/SysConfig/index.html
>>>>
>>>> When I try "framework 'SystemConfiguration'" it returns true, but none
>>>> of the inline C functions are available. From the reading I've done,
>>>> it seems that static C libraries like SystemConfiguration should be
>>>> loaded via a BridgeSupport file, but I have no idea how to generate
>>>> one in this case.
>>>>
>>>> --
>>>> Michael Jackson
>>>> http://mjijackson.com
>>>> @mjijackson
>>>> ___
>>>> MacRuby-devel mailing list
>>>> [email protected]
>>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>>
>>> ___
>>> MacRuby-devel mailing list
>>> [email protected]
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>>
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Fullscreen sample app

2010-07-06 Thread Michael Jackson
Hi all,

I created a fullscreen sample app in MacRuby, and I thought someone
else might be able to get some use out of it.

http://mjijackson.com/2010/07/fullscreen-macruby
http://github.com/mjijackson/Fullscreen

It's basically a port of someone else's Objective-C code, but it uses
NSApp's presentation options to control automatic hiding/showing of
the menu bar and dock instead of doing it manually. If anyone has any
feedback for me, I'd love to hear it.

Enjoy,

Michael

--
Michael Jackson
http://mjijackson.com
@mjijackson
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Fullscreen sample app

2010-07-06 Thread Michael Jackson
Of course, that's fine with me. ;) Would you like a patch or are you
going to merge it in yourself?

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Tue, Jul 6, 2010 at 6:21 PM, Laurent Sansonetti
 wrote:
> Hi Michael,
>
> Thanks for porting it :) Would you mind if we bundle your sample as part of 
> the MacRuby sample code? If you agree, would you also be willing to license 
> the code under the Ruby license? (which is the default license for everything 
> in MacRuby, so no need to mention it).
>
> Laurent
>
> On Jul 6, 2010, at 4:48 PM, Michael Jackson wrote:
>
>> Hi all,
>>
>> I created a fullscreen sample app in MacRuby, and I thought someone
>> else might be able to get some use out of it.
>>
>> http://mjijackson.com/2010/07/fullscreen-macruby
>> http://github.com/mjijackson/Fullscreen
>>
>> It's basically a port of someone else's Objective-C code, but it uses
>> NSApp's presentation options to control automatic hiding/showing of
>> the menu bar and dock instead of doing it manually. If anyone has any
>> feedback for me, I'd love to hear it.
>>
>> Enjoy,
>>
>> Michael
>>
>> --
>> Michael Jackson
>> http://mjijackson.com
>> @mjijackson
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Fullscreen sample app

2010-07-07 Thread Michael Jackson
I was going for the second approach (i.e. resize the window to the
size of the screen but don't "take it over") because I like to keep
the cmd-tab functionality. I've actually enhanced the example today to
work with windows that have toolbars. I'll update it when I get the
chance (may not be for a week because I'm on vacation for the next few
days!).

Thanks,

Michael

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Wed, Jul 7, 2010 at 3:51 PM, Eloy Duran  wrote:
> For completeness sake; I just read this difference explanation in the
> article [1] that the code was based on:
>
> “There are two basic types of fullscreen on the Mac:
>
>        • Screen takeover — where one view gains exclusive control of the
> screen.
>        • Basic fullscreen window — where a regular window occupies the whole
> screen without occlusions.
>
> The first is normally recommended for games where you never want the window
> to be interrupted. For an example of this type of window, see my earlier
> post An Asteroids-Style Game in Core Animation: Part 1.
>
> The second option has the advantage that it can be interrupted by other
> windows. For example: Exposé, Command-Tab and notification windows will
> continue to function. This is the approach that I will detail in this post.”
>
> [1]
> http://cocoawithlove.com/2009/08/animating-window-to-fullscreen-on-mac.html
>
> On 7 jul 2010, at 22:50, Matt Aimonetti wrote:
>
>> +1 for enterFullScreenMode:withOptions:   MacRuby won't run on anything <
>> 10.5 anyway.
>>
>> - Matt
>>
>> On Wed, Jul 7, 2010 at 10:44 AM, Eloy Duran 
>> wrote:
>> Hey Michael,
>>
>> You might also want to consider NSView's enterFullScreenMode:withOptions:
>> [1]
>> It's available from 10.5 and higher only, but with MacRuby that should not
>> be a problem.
>>
>> Cheers,
>> Eloy
>>
>> [1]
>> http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/Reference/NSView.html#//apple_ref/doc/uid/2014-SW5
>>
>>
>> On 7 jul 2010, at 01:48, Michael Jackson wrote:
>>
>> Hi all,
>>
>> I created a fullscreen sample app in MacRuby, and I thought someone
>> else might be able to get some use out of it.
>>
>> http://mjijackson.com/2010/07/fullscreen-macruby
>> http://github.com/mjijackson/Fullscreen
>>
>> It's basically a port of someone else's Objective-C code, but it uses
>> NSApp's presentation options to control automatic hiding/showing of
>> the menu bar and dock instead of doing it manually. If anyone has any
>> feedback for me, I'd love to hear it.
>>
>> Enjoy,
>>
>> Michael
>>
>> --
>> Michael Jackson
>> http://mjijackson.com
>> @mjijackson
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] When is a String not an NSString?

2010-07-13 Thread Michael Jackson
This sounds like a bug to me. Have you filed a ticket?

http://trac.macosforge.org/projects/ruby/newticket

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Mon, Jul 12, 2010 at 6:02 PM, Henry Maddocks
 wrote:
> With respect to the following code
>
>     1  require 'test/unit'
>     2
>     3  class String
>     4      def my_method
>     5          "My Method " + self
>     6      end
>     7  end
>     8
>     9  class Test_Tumblr < Test::Unit::TestCase
>    10
>    11    def test_strings
>    12      cocoa_string = NSString::stringWithString("blah")
>    13      ruby_string = "Ruby String"
>    14
>    15      assert_equal String, cocoa_string.class
>    16      assert_equal String, ruby_string.class
>    17      assert_equal cocoa_string.class, ruby_string.class
>    18
>    19      assert ruby_string.respond_to?(:my_method), 
> "ruby_string.respond_to?"
>    20      assert cocoa_string.respond_to?(:my_method), 
> "cocoa_string.respond_to?"
>    21    end
>    22
>    23  end
>
>
> What is the expected result of line 20?
>
> On the one hand cocoa_string is an NSString so the monkey patch shouldn't 
> have any effect, but on the other cocoa_string is claiming to be a ruby 
> String.
>
> Henry
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Presenting on MacRuby this evening

2010-07-13 Thread Michael Jackson
I'll be giving a presentation on MacRuby tonight at the Utah Ruby
User's Group. It's a pretty good group and has some very capable
Rubyists, so it should be a fun time. If you're in the area, you might
want to check it out.

http://groups.google.com/group/urug/browse_thread/thread/292609271853115b#

The main reason I'm posting to this list is to see if there's a good
base of information to work from that has already been published
elsewhere (for example, a recent presentation that someone else gave
on MacRuby 0.6). Of course, I would be more than happy to give credit
for any data/slides that I glean from other sources. I'll be sure to
share whatever I come up with, perhaps on my GitHub account, so that
it will be usable by others as well. I imagine there are others that
are proselyting MacRuby that could benefit from such a resource.

Thanks,

Michael

--
Michael Jackson
http://mjijackson.com
@mjijackson
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] malloc error: GC operation on unregistered thread

2010-07-27 Thread Michael Jackson
Hi all,

I'm getting a malloc error every time I run my app. Here's what I'm
getting in the console:

Running…
Bottlefly(45475,0x116a2) malloc: *** auto malloc[45475]: error: GC
operation on unregistered thread. Thread registered implicitly. Break
on auto_zone_thread_registration_error() to debug.

Being a Ruby developer and not familiar with C debugging techniques,
I'm a bit lost as to what to do to track down this bug. I noticed
there's another thread going on right now, but with a slightly
different error. Does this seem like something that may be fixed in
trunk?

--
Michael Jackson
http://mjijackson.com
@mjijackson
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] An easy way to add .rb files to Xcode build automatically?

2010-07-27 Thread Michael Jackson
I usually write all of my Ruby code in Vim, but I'm using Xcode to
keep my project organized and to build/debug/etc. Whenever I create a
new file in Vim I have to go into my Xcode project and add the files
to the "Classes" group manually. Is there a good way to set up a
folder reference in Xcode that will automatically keep track of my new
.rb files and copy them to the project root when I build? Or do I
always have to add them manually?

I tried adding a folder to the root of my project called "Classes" in
which I put all of my Ruby code. I then added that folder reference to
the project. However, when I build the project the files are copied to
a "Classes" folder in the build instead of to the project root where
they can be found by main.rb.

--
Michael Jackson
http://mjijackson.com
@mjijackson
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] malloc error: GC operation on unregistered thread

2010-07-27 Thread Michael Jackson
Hi Laurent,

The only framework I'm using up to this point is WebKit, and it
appears that is the problem. Here's the result I get when I set the
breakpoint:

(gdb) bt
#0  0x7fff881d6c64 in auto_zone_thread_registration_error ()
#1  0x7fff881d69aa in Auto::Zone::registered_thread ()
#2  0x7fff881cfdf0 in auto_zone_allocate_object ()
#3  0x7fff837d1dc5 in _CFRuntimeCreateInstance ()
#4  0x7fff837d410f in __CFStringCreateImmutableFunnel3 ()
#5  0x7fff837d8ef6 in CFStringCreateWithCharacters ()
#6  0x7fff85e54663 in WebCore::fileSystemRepresentation ()
#7  0x7fff85e544da in WebCore::makeAllDirectories ()
#8  0x7fff85e542f0 in WebCore::IconDatabase::iconDatabaseSyncThread ()
#9  0x7fff841bb456 in _pthread_start ()
#10 0x7fff841bb309 in thread_start ()

Is there any way around this? Perhaps I could use a later version of
WebKit? I'm not sure what version I'm using now (and not sure how to
find out either).

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Tue, Jul 27, 2010 at 1:41 PM, Laurent Sansonetti
 wrote:
> Hi Michael,
>
> It's likely not a problem in your code neither in MacRubyi (I hope!), but in 
> a framework you use. This warning typically happen when a native thread makes 
> use of the GC without being registered. Do you use any 3rd party framework in 
> your app?
>
> In any case, try setting a breakpoint on auto_zone_thread_registration_error 
> in Xcode, run your app, and once it breaks type "bt". It should tell you 
> where exactly the problem is.
>
> Laurent
>
> On Jul 27, 2010, at 9:08 AM, Michael Jackson wrote:
>
>> Hi all,
>>
>> I'm getting a malloc error every time I run my app. Here's what I'm
>> getting in the console:
>>
>> Running…
>> Bottlefly(45475,0x116a2) malloc: *** auto malloc[45475]: error: GC
>> operation on unregistered thread. Thread registered implicitly. Break
>> on auto_zone_thread_registration_error() to debug.
>>
>> Being a Ruby developer and not familiar with C debugging techniques,
>> I'm a bit lost as to what to do to track down this bug. I noticed
>> there's another thread going on right now, but with a slightly
>> different error. Does this seem like something that may be fixed in
>> trunk?
>>
>> --
>> Michael Jackson
>> http://mjijackson.com
>> @mjijackson
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] An easy way to add .rb files to Xcode build automatically?

2010-07-29 Thread Michael Jackson
I've tried both. With the yellow icon (a "group") I need to manually
add .rb files to the project when I create them in Vim. However, the
upside is that the files are copied to the correct place in the build
(the project root), so they are correctly found by rb_main.rb at
runtime.

With the blue icon (the "folder reference") the files are
automatically added to the project when I create them in Vim, but the
entire folder is actually copied to the build which means that
rb_main.rb doesn't find them when it tries to include everything.

Ideally, what I'd like to do is use a folder reference and then just
set up some build script that will copy everything to the project root
when I build.

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Wed, Jul 28, 2010 at 5:03 PM, Nick Ludlam  wrote:
> On 27 Jul 2010, at 18:25, Michael Jackson wrote:
>
>> I tried adding a folder to the root of my project called "Classes" in
>> which I put all of my Ruby code. I then added that folder reference to
>> the project. However, when I build the project the files are copied to
>> a "Classes" folder in the build instead of to the project root where
>> they can be found by main.rb.
>
>
> Hi Michael,
> In the XCode project tree, does your 'Classes' folder have a blue or yellow 
> icon? There are two types of folders that you can add to the source tree. 
> Blue folders (folder references) are 'physical' in the sense that the 
> structure will be preserved when copied to the Resources folder of your 
> application's bundle.
>
> Yellow folders (groups) are more like logical folders for partitioning your 
> project files within XCode. They don't strictly enforce or correspond to any 
> structure on disk unless you specifically set it up that way, and anything 
> under these folders will become flattened into the final Resources 
> destination folder.
>
> Within my current MacRuby project, I only use the blue folder references for 
> any packaged gems that I want to include. All normal ruby project files are 
> in yellow group folders.
>
> There's a good post about it at 
> http://iphonedevelopertips.com/xcode/xcode-folders-and-the-file-system-part-1.html
>
> Nick
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] An easy way to add .rb files to Xcode build automatically?

2010-07-29 Thread Michael Jackson
> I was planning on having a gem structured project with your above setup and 
> then adjust LOAD_PATH accordingly from rb_main to include the build dir's 
> lib. I guess I missed the second step of the reference to the folder in the 
> project or something.

Yeah, the folder reference will keep the files in sync automatically.
But it seems that even with a folder reference I'm still going to need
to add the "Classes" directory to my LOAD_PATH unless I can figure out
a way to set up the build to do it automatically.

--
Michael Jackson
http://mjijackson.com
@mjijackson
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby in the Mac App Store

2010-11-24 Thread Michael Jackson
Matt,

I missed you at RubyConf, but I was wondering if you wouldn't mind
expounding a bit upon what you have learned about MacRuby apps in the
Mac app store. I've read in your slides and on your blog
(http://merbist.com/2010/11/12/rubyconf-2010-macruby-talk/) that the
Mac app store is definitely possible for MacRuby apps. Have you heard
this directly from Apple?

Thanks,

Michael

On Mon, Oct 25, 2010 at 10:29 AM, Matt Aimonetti
 wrote:
> Scott, I think the discussion is about the OS X app store. And as far as I
> know, there is no official word from Apple about that.
>
> - Matt
>
> On Mon, Oct 25, 2010 at 7:25 AM, Scott Ribe 
> wrote:
>>
>> MacRuby does not work on iOS.
>>
>> On Oct 25, 2010, at 7:55 AM, Jason Guiditta wrote:
>>
>> > Is anyone actively using macruby to build apps there
>>
>>
>> --
>> Scott Ribe
>> [email protected]
>> http://www.elevated-dev.com/
>> (303) 722-0567 voice
>>
>>
>>
>>
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] converging for 1.0

2010-11-30 Thread Michael Jackson
+1 for using GitHub. Also, it would be great to have some sort of wiki
entry on how to contribute to the project.

On Tue, Nov 30, 2010 at 8:05 PM, Arthur Gunn  wrote:
> Hi,
>
> I'd like to help out with the bugmash on saturday.
> I'm wondering, what will the workflow look like?
> Will it be possible to use github and it's systems? I think it would lower
> the barriers for mac rubyists (like myself) to become involved. Github has
> some pretty handy features like its pull request system too.
>
> Also, some visible guidelines for prospective contributors could be a good
> thing.
> https://www.macruby.org/trac/wiki/MacRubyDevelopment just says "Please file
> a ticket" and is buried (5 clicks by my count) from the homepage.
>
> Let me know what I can do to help.
>
> Thanks,
>
>
> -Arthur
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel