Re: [MacRuby-devel] Advice for Total Tyro

2011-10-17 Thread Paul Howson
On 16/10/2011, at 10:12 AM, Bryan Harrison wrote:
 Objective-C is not without a certain homely charm, but Ruby is obviously the 
 more modern language.  So…
 
   • Does Xcode treat Ruby as family, or is it a stepchild toiling in the 
 ashes?  Are there other tools I'll need?
 
   • What's Apple's attitude toward Ruby applications?
 
   • Can Ruby take advantage of the (finally!) modern memory management 
 features released with iOS 5?
 
   • Will I end up have having learn Objective-C regardless?
 
 Basically, If you were me, what would you do, and what order might you do it 
 in?

Hi Bryan,

Your 5-10 year time frame is a key factor.

I started developing an app for the Mac circa 2003 in RealBasic. A couple of 
years ago I converted it to MacRuby (wrote a convertor in Ruby to do this then 
manually tweaked). This was after getting to know Ruby through Rails.

Despite (or perhaps because of) a background in C years ago, I've tried to 
avoid Objective-C, although I've read the Hillegass book and done some of the 
examples. I just prefer Ruby for various reasons. I'm using TextMate for 
editing the code and XCode for running it. I'm not trying to ship a product 
yet, so I can live with the occasional MacRuby teething problems. They will be 
fixed in time.

On OSX, MacRuby does do modern memory management, which is a big plus IMHO.

Paul Howson


Paul Howson
Warwick Qld Australia


___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] CVImageBufferRef vs __NSCFType

2010-08-24 Thread Paul Howson
On 24/08/2010, at 8:49 AM, Thibault Martin-Lagardette wrote:

 It is a problem in the QTKit bridgesupport, where 
 `captureOutput:didOutputVideoFrame:withSampleBuffer:fromConnection` is not 
 defined. 
 This means it's defintely not something you are doing wrong (and it's not 
 MacRuby's fault either – it has no way, without proper BridgeSupport support, 
 to know the actual type of the parameter)
 
 This has been fixed in BridgeSupport already, and should be released 
 soon(-ish).
 However, I don't think there is any workaround in the meantime, except 
 waiting for the BridgeSupport update.

Previous BridgeSupport errors and omissions have been fixed by manual editing 
of the BridgeSupport file pending an updated version. Can you supply a copy of 
the fix in this case?

Paul Howson

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Where are the rake tasks?

2010-07-14 Thread Paul Howson
This might be a dumb question, but I notice mention of various macruby-related 
rake tasks (e.g rake clean)

Is there a standard set of rake tasks supplied with macruby? Where are the rake 
files for these tasks? 


Paul Howson
Warwick Qld Australia
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] CFRange (Boxed) elements not accessible

2010-05-31 Thread Paul Howson
On 31/05/2010, at 6:12 PM, Laurent Sansonetti wrote:

 Any other suggestions for getting around this bug?
 
 It is possible to fix the problem by manually editing the file.
 
 /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Resources/BridgeSupport/CoreText.bridgesupport
 
 Then, locate the description of CTLineGetStringRange. It should be something 
 like:
 
 function name='CTLineGetStringRange'
 arg type='^{__CTLine=}'/
 retval type64='{?=qq}' type='{?=ii}'/
 /function
 
 And replace with:
 
 function name='CTLineGetStringRange'
 arg type='^{__CTLine=}'/
 retval type64='{_CFRange=qq}' type='{_CFRange=ii}'/
 /function
 
 I understand that editing the file manually is probably not an option if you 
 intend to ship the project later, but I think we can add a fix in trunk to 
 expose the fields. We can maybe find another workaround if needed.

Editing the file fixed the problem. By the time I'm ready to ship something, 
these changes will have percolated through the system I'm sure.

Thanks,
Paul.

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] CFRange (Boxed) elements not accessible

2010-05-30 Thread Paul Howson
On 31/05/2010, at 11:47 AM, Laurent Sansonetti wrote:

 Hi Paul,
 
 I believe that here the function is typed to return an anonymous struct 
 (likely a bug in the bridgesupport file), so MacRuby won't be able to 
 associate it as an NSRange. You may be able to access location using 
 string_range[0] and length using string_range[1].
 
 Laurent

Thanks Laurent.

That appears not to work:

   undefined method `[]' for #Boxed:0x2006947a0 (NoMethodError)

Is the bridgesupport file produced elsewhere within Apple? (i.e. out of your 
control)

Any other suggestions for getting around this bug?

Thanks,
Paul

-
Paul Howson
Warwick Qld Australia


___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #628: CTFramesetterCreateFrame doesn't like the CFRange type

2010-05-06 Thread Paul Howson
On 06/05/2010, at 1:18 PM, Laurent Sansonetti wrote:

 Hi Paul,
 
 On May 5, 2010, at 7:57 PM, Paul Howson wrote:
 
 On 26/04/2010, at 1:33 PM, MacRuby wrote:
 
 Hi Laurent,
 
 What would be a feasible workaround for this problem, given than I'm using 
 MacRuby 0.5 ?
 
 i.e. I'm also trying to call:
 
 CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, nil)
 
 The second argument is a range which produces the error.
 
 Can I edit the bridge support file? Or is there some other workaround? Can I 
 use a more recent built of MacRuby? Or are these too buggy compared to 0.5?
 
 Do you have any reason why you cannot use 0.6? It's much stabler than 0.5 :)
 
 http://www.macruby.org/blog/2010/04/30/macruby06.html
 
 Laurent

No reason other than I had not yet noticed the announcement of 0.6! I will 
upgrade.

Thanks.
Paul
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] How to set up and retrieve returned buffer from CTFrameGetLineOrigins?

2010-05-06 Thread Paul Howson
I need some help with this example which arises at the boundary between MacRuby 
and the C Core Text framework.

Consider the following Core Text function definition:

 void CTFrameGetLineOrigins( CTFrameRef frame, CFRange range, CGPoint 
origins[] )

The third argument is defined as:

origins
The buffer to which the origins are copied. The buffer must have at least as 
many elements as specified by range's length.

Clearly origins is a buffer and a series of CGPoint structures are copied into 
it.

How can this be handled in MacRuby? Specifically:

1. What kind of argument should be passed? Presumably something constructed 
using the Pointer.new_with_type() function? Documentation on this function is 
very hard to find.

2. How to access the individual CGPoints in the returned buffer? This is not an 
Objective-C / MacRuby array object. It is just an address to a buffer. Easy to 
do in C, but how to do in MacRuby?


Paul Howson
Warwick Qld Australia
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] How to set up and retrieve returned buffer from CTFrameGetLineOrigins?

2010-05-06 Thread Paul Howson
On 07/05/2010, at 1:08 PM, Matt Aimonetti wrote:

 Duly noted ;)

Actually Matt, could you perhaps consider a chapter on the subject of 
interfacing MacRuby to the various Core xxx C-language frameworks, which is 
not quite as straightforward as the seamless integration of MacRuby with Cocoa 
classes.

Paul Howson

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] How to set up and retrieve returned buffer from CTFrameGetLineOrigins?

2010-05-06 Thread Paul Howson
On 07/05/2010, at 1:03 PM, Laurent Sansonetti wrote:

 Hi Paul,
 
 You're right, the Pointer class must be used. Sorry about the lack of 
 documentation. Here is a snippet that might work:
 
 # n must be defined
 origins = Pointer.new(CGPoint.type, n) # this builds a pointer to n times 
 CGPoint
 CTFrameGetLineOrigins(frame, CFRange.new(0, n), origins)
 
 Using Pointer#[] you can simply dereference a given slot in the pointer, as 
 in C.
 
 n.times { |i| p origins[i] } # should print nth points
 
 Let me know if this works or not for you.
 
 Laurent

Thanks Laurent. I will try it out.

Paul

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Requirements for Interface Builder to correctly parse MacRuby files?

2010-02-01 Thread Paul Howson
Hello Laurent et al,

In an attempt to ease code management for a large document class, I split the 
code for my NSDocument subclass into a number of separate Ruby files. e.g. 
MyDocument-base.rb, MyDocument-commands.rb, and so on, reopening the Ruby class 
and adding more methods in each file.

When the class was in a single source file (eg. MyDocument.rb), Interface 
Builder would correctly parse this and recognise outlets and action methods.

Splitting the class into separate files had the effect of causing Interface 
Builder to no longer recognise outlets and action methods.

Can you please explain how and when IB parses Ruby source files and why 
splitting a class into separate files breaks the parsing?

Is this documented somewhere?

Any suggestions for a way around this?

Thanks,
Paul Howson
Queensland Australia
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Requirements for Interface Builder to correctly parse MacRuby files?

2010-02-01 Thread Paul Howson
On 02/02/2010, at 2:14 PM, Laurent Sansonetti wrote:

 Hi Paul,
 
 In theory, splitting files should not be an issue. Keep in mind that the IB 
 parser is very rudimentary at the moment (we are working on a much better 
 solution for a future release), so if you define classes into modules it may 
 not work.
 
 A good way to know exactly what IB will read is to call the parser by 
 yourself, manually, from the command line:
 
 $ /Developer/usr/bin/rb_nibtool -f MyController.rb
 
 You should see on the terminal a property list, basically an array of 
 dictionaries, each one being a class with outlets/actions sub-dictionaries.
 
 Laurent

Thanks Laurent. That flushed out the problem. When re-opening classes across 
multiple files, I was not declaring the superclass relationship again. e.g.

FILE 1:

class A  NSDocument
  …
end

FILE 2:

class A
  …
end

When the Ruby compiler sees FILE 2 it already knows A is a subclass of 
NSDocument. But the Interface Builder parser obviously treats files in 
isolation and needs to be told about that relationship in each file.

Problem solved.

Paul
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #499: Order declaring class hierarchy gets MacRuby confused about instance variables

2010-01-31 Thread Paul Howson
On 11/12/2009, at 11:53 AM, MacRuby wrote:

 #499: Order declaring class hierarchy gets MacRuby confused about instance
 variables
 --+-
 Reporter:  p...@…|   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  major |   Milestone:  MacRuby 0.5  
 Component:  MacRuby   |Keywords:   
 --+-
 
 Comment(by lsansone...@…):
 
 Definitely a bug... thanks for the report.

This bug has not been fixed in MacRuby 0.5. Will it automatically migrate to 
being a 0.6 milestone?

Paul Howson

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] How to test if you're running MacRuby vs. Ruby?

2009-12-18 Thread Paul Howson
On 17/12/2009, at 6:21 PM, Josh Ballanco wrote:

 def is_macruby?
  defined? RUBY_ENGINE  RUBY_ENGINE == 'macruby'
 end
 
 Cheers,
 Josh

Thanks Josh. However I note this works only if you write:

defined?(RUBY_ENGINE)  RUBY_ENGINE == 'macruby'

i.e. the argument to defined? must be put in parentheses else MacRuby crashes.

Paul Howson

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] How to test if you're running MacRuby vs. Ruby?

2009-12-17 Thread Paul Howson
Is there a way to test if code is running in MacRuby rather than Ruby? I'm 
developing and testing some code using plain old Ruby 1.8.7 in TextMate, then 
integrating it into an Xcode project, so I need to be able to comment out 
some lines which are Cocoa-dependent when testing in plain Ruby.

Paul Howson
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] String#getbyte not working?

2009-11-23 Thread Paul Howson
It appears the new String method called getbyte for Ruby 1.9 is not  
working? Results in an Abort trap message.


~/Dev $ macruby --version
MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]

~/Dev $ macruby -e ' abc.getbyte(0);'
Abort trap

Paul Howson
Warwick Qld Australia
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Do the nightly builds continue from the latest beta

2009-10-09 Thread Paul Howson
This might be an obvious question, but are the nightly builds (and the  
nightly build installers) an evolution from whatever is the latest  
beta? In other words, are the official betas just particular snapshots  
of the ongoing nightly build process?



Paul Howson
Warwick Qld Australia

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] not 32bit

2009-10-08 Thread Paul Howson

On 09/10/2009, at 4:56 AM, Laurent Sansonetti wrote:

Note that MacRuby is only known to work under a certain revision of  
LLVM trunk (which is documented in the README.rdoc file).


Does the MacRuby installer also install LLVM? If not, how is that kept  
up to date?


Paul Howson
Queensland, Australia.
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Setting Breakpoints/Debugger

2009-06-18 Thread Paul Howson

On 18/06/2009, at 5:47 PM, Matt Aimonetti wrote:

Not being able to use ruby debug in MacRuby is something that used  
to really bother me at first. I'm thinking about maybe hacking  
hotconsole so you could run it in the context of your app. That  
would obviously not be as nice a real debugger but that might be cool.


I'm not familiar with hotconsole. Would that be something like script/ 
console in Rails? That would be useful.


Also, thanks Eloy for your response. Good points.

Paul
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] MacRuby Document-based Application template in XCode?

2009-06-17 Thread Paul Howson

Hi,

When using Objective-C, XCode provides you with a template for a  
Cocoa Document-based Application.


For MacRuby we so far have in XCode only MacRuby Application and  
MacRuby Core Data Application.


Would it work to take a new MacRuby Application and copy across the  
relevant bits from a new Cocoa Document-based Application in order to  
make a MacRuby Document-based Application?


Is it that simple, or are there other gotchas I need to know about?

Paul Howson
Queensland Australia
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] A MacRuby-users group?

2009-05-24 Thread Paul Howson

On 23/05/2009, at 3:35 AM, Laurent Sansonetti wrote:

Any though? If most people agree to create a -users group I can ask  
for an official (macosforge.org) one.


If another list is created, could you please consider something a  
little more flexible than this kind of (old fashioned) mailing list?  
Something with an RSS feed would make it easier to integrate with  
other feed subscriptions. And maybe something with a better designed/ 
more modern web interface?


Paul Howson

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel