Re: [MacRuby-devel] NSWorkspace.sharedWorkspace.recycleURLs:completionHandler doing nothing under macruby

2011-08-02 Thread Caio Chassot
On Tue, Aug 2, 2011 at 04:55, Caio Chassot wrote: > On Tue, Aug 2, 2011 at 04:26, Terry Moore wrote: >> Sounds like an asynchronous issue. Try adding a completion selector and >> calling nsrunloop. > Tried both, no dice. Side talk for the curious: http://tweetlib

Re: [MacRuby-devel] NSWorkspace.sharedWorkspace.recycleURLs:completionHandler doing nothing under macruby

2011-08-02 Thread Caio Chassot
On Tue, Aug 2, 2011 at 04:26, Terry Moore wrote: > Sounds like an asynchronous issue. Try adding a completion selector and > calling nsrunloop. Tried both, no dice. @jacknutting mostly nails it: > core problem is that AppKit classes are really meant for use in a full app > (w/ GUI). Foundatio

Re: [MacRuby-devel] NSWorkspace.sharedWorkspace.recycleURLs:completionHandler doing nothing under macruby

2011-08-02 Thread Caio Chassot
On Tue, Aug 2, 2011 at 03:24, Caio Chassot wrote: > At this point I'm sure this is not a MacRuby bug, just some Cocoa > weirdness. I'd love to understand exactly what the hell is going on, > if anyone knows… …and to back that, it fails in ObjC too, and adding a sleep

Re: [MacRuby-devel] NSWorkspace.sharedWorkspace.recycleURLs:completionHandler doing nothing under macruby

2011-08-02 Thread Caio Chassot
On Tue, Aug 2, 2011 at 03:01, Caio Chassot wrote: > Weird. So maybe there's something I don't understand about NSWorkspace? Some meh progress: adding sleep 0.1 before the puts sets things right. At this point I'm sure this is not a MacRuby bug, just some Cocoa weirdness. I&#x

Re: [MacRuby-devel] NSWorkspace.sharedWorkspace.recycleURLs:completionHandler doing nothing under macruby

2011-08-02 Thread Caio Chassot
> The equivalent code works fine in Nu. Oh, actually I went ahead and tested again in nu, this time both interactively under nush, and as a script with nush in the shebang line. Interactively it works, as shebang it fails silently, same as macruby/irb. Weird. So maybe there's something I don't un

[MacRuby-devel] NSWorkspace.sharedWorkspace.recycleURLs:completionHandler doing nothing under macruby

2011-08-02 Thread Caio Chassot
NSWorkspace.sharedWorkspace.recycleURLs:completionHandler: fails for me when run via normal macruby, yet works in macirb. Sample code: #!/usr/bin/env macruby framework 'Cocoa' path = "#{ENV['HOME']}/Desktop/Y-U-NO-TRASH-ME-MACRUBY.txt" system "touch #{path}" url = NSURL.fileU

Re: [MacRuby-devel] How do people deal with macgem overwriting MRI gem binaries?

2011-07-01 Thread Caio Chassot
On Fri, Jul 1, 2011 at 05:38, isaac kearse wrote: > --format-executable doesn't seem to work.  In fact its worse - it just > overwrites the MRI gem binary without giving a warning at all.  Thanks > for the idea though. Interesting. It should work: $ macirb >> require 'rubygems' >> Gem.default_ex

Re: [MacRuby-devel] How do people deal with macgem overwriting MRI gem binaries?

2011-06-30 Thread Caio Chassot
--format-executable may help, as it should prefix everything with mac-, then. You may even want to put that in your .gemrc for the install and update commands. On Fri, Jul 1, 2011 at 04:07, isaac kearse wrote: > At the moment macgem will prompt the user with this warning when > trying to install

Re: [MacRuby-devel] String#sub/gsub and text encodings

2011-05-16 Thread Caio Chassot
On 2011-05-16, at 00:37 , Laurent Sansonetti wrote: > Filling dups is always a good idea as it helps up prioritizing work. Oh Laurent, please let's not encourage this terrible dupes-as-voting-system practice; just add a +1 button to tickets. Filling proper tickets is hard work. Time shouldn't b

Re: [MacRuby-devel] String#sub/gsub and text encodings

2011-05-15 Thread Caio Chassot
Hi, Can you post some sample code? Thanks On Sun, May 15, 2011 at 11:50, Yasu Imao wrote: > Hi, > > I just wrote a simple script for text processing and encountered a problem > with String#sub/gsub. > > Original text: UTF-8 encoded ASCII character only text > Replacing text: UTF-8 encoded text

Re: [MacRuby-devel] Hash Table

2011-04-18 Thread Caio Chassot
On Mon, Apr 18, 2011 at 20:18, Joshua Ballanco wrote: > they aren't...quite... The issue is that if you need a string, sometimes an > NSString is sufficient and in those cases you'd want the NSString to report > itself as being the same as a String. In other cases, however, they are > different be

Re: [MacRuby-devel] NSString.to_data

2011-04-18 Thread Caio Chassot
On Mon, Apr 18, 2011 at 22:06, Robert Rice wrote: > But for consistency, you may want to add the .to_data method to the NSString See the recent thread "Hash Table", it explains the funny business going on. I also posted something to discuss this general matter a few months ago but don't really r

Re: [MacRuby-devel] Problem with latest macruby stable and unicode regexp

2011-04-03 Thread Caio Chassot
On 2011-03-27, at 13:05 , Glenn Gillen wrote: > regexp `[\u{80}-\u{D7FF}\u{E000}-\u{FFFD}\u{1}-\u{10}]' compilation > error: U_REGEX_BAD_ESCAPE_SEQUENCE (RegexpError) > > Any ideas what I can do apart from forking Sass and opting for the 1.8 > compatible regexp? MacRuby ditched Onigurum

Re: [MacRuby-devel] book idea - "making it look like Ruby"

2011-02-12 Thread Caio Chassot
Same here. And while I'm all too curious about the case conversion implementations, I'm in agreement it'd be a bad fit for the official distribution, and a major annoyance with clashing styles in shared code. Sent from my iPhone On 12 Feb 2011, at 23:06, Matt Aimonetti wrote: > It is not,

[MacRuby-devel] sprintf, String#%, stringWithFormat, NSLog and friends

2011-02-12 Thread Caio Chassot
So everything in ruby is an object, which means that when using format strings with Objective-C methods like String+stringWithFormat and NSLog, the only formatter that makes sense is "%@". Other formatters generally give unexpected results. E.g. "%d" will print the value of the pointer to the nu

Re: [MacRuby-devel] MacRuby classes delete/overwrite Objective-C classes?

2011-02-12 Thread Caio Chassot
On 2011-02-12, at 04:40 , Caio Chassot wrote: > > On 2011-02-12, at 01:59 , Robert Payne wrote: >> >> The behavior I'm expecting is to see "Hello world" in the console but it >> seems as if the entire Objective-C method was deleted. I don't have a me

Re: [MacRuby-devel] MacRuby classes delete/overwrite Objective-C classes?

2011-02-11 Thread Caio Chassot
On 2011-02-12, at 01:59 , Robert Payne wrote: > > The behavior I'm expecting is to see "Hello world" in the console but it > seems as if the entire Objective-C method was deleted. I don't have a method > in the Ruby class called helloWorld. There's likely something wrong somewhere else in your

Re: [MacRuby-devel] book idea - "making it look like Ruby"

2011-02-11 Thread Caio Chassot
On 2011-02-11, at 15:25 , Matt Aimonetti wrote: > > Magically converting a snake_case method call to a CamelCase method dispatch > is bad for peformance and documentation. I'm not suggesting that this be done as part of MacRuby, but should one want to go ahead on their on… Wouldn't it be possib

[MacRuby-devel] open('|foo') semantics not supported?

2011-02-09 Thread Caio Chassot
Quick test: $ ruby -e 'open("|pbcopy", "w") { |io| io << "test #{rand}" }; puts(`pbpaste`)' test 0.8639874244022235 $ macruby -e 'open("|pbcopy", "w") { |io| io << "test #{rand}" }; puts(`pbpaste`)' -e:1:in `': not opened for writing (IOError) Why the error with MacRuby? ___

Re: [MacRuby-devel] Note of warning about Xcode 4

2011-02-04 Thread Caio Chassot
On 2011-02-04, at 22:55 , Vincent Isambart wrote: > > IMPORTANT: If you are developing a MacRuby application you should wait before > installing it: Xcode 3 get upgraded to Xcode 4. However there is currently no > support for MacRuby in Xcode 4: But I can choose a custom path and everything wil

Re: [MacRuby-devel] MacRuby Book expectations

2011-02-04 Thread Caio Chassot
On 2011-02-04, at 07:30 , Jean-Denis Muys wrote: > > I am at the other end of the spectrum: I am an experienced Cocoa/Objective-C > programmer and a Ruby newbie. And I'm back at the ruby expert, cocoa newbie, yet… > I expect the book to address two facets of software development with MacRuby:

Re: [MacRuby-devel] book idea - "making it look like Ruby"

2011-02-04 Thread Caio Chassot
On 2011-02-04, at 01:26 , Rich Morin wrote: > > One of my concerns with both MacRuby and JRuby is > that the resulting code doesn't look much like Ruby. I'm sure the situation in JRuby land is worse, but generally, using Cocoa stuff from MacRuby feels enough like ruby, save for the HorridCamelCa

Re: [MacRuby-devel] Array and NSMutableArray mutability

2011-01-30 Thread Caio Chassot
On 2011-01-30, at 23:55 , Mark Rada wrote: > > Should both types of arrays work the same way? An instance of NSMutableArray > says its class is Array, so I thought that they would. There's something weird going on in there, I don't really know the details of it, but: A while back I had issues

Re: [MacRuby-devel] Gems again; signing records

2011-01-28 Thread Caio Chassot
On 2011-01-29, at 02:11 , Matt Aimonetti wrote: > > IMHO adding Bundler as a dependency would be a huge mistake. First, Bundler > code is overly complicated and tries to do way too much. (You forgot to mention slow.) I think I agree here. I just like the Gemfile format. Don't think we need to

Re: [MacRuby-devel] Gems again; signing records

2011-01-28 Thread Caio Chassot
On 2011-01-28, at 21:36 , Laurent Sansonetti wrote: > > I would rather avoid any dependency. I agree that keeping track of the gems > you need in a single place is a good idea, though. > > Maybe we should refactor the Xcode templates to do so, eventually. I'd classify Xcode as a dependency. Sim

Re: [MacRuby-devel] Gems again; signing records

2011-01-28 Thread Caio Chassot
On 2011-01-28, at 20:30 , Laurent Sansonetti wrote: > > As I suggested on IRC yesterday, I think we should add a --gem argument to > macruby_deploy, which would make sure the given gems and their dependencies > are unpacked inside the application bundle. It could be great if this involved a bit

Re: [MacRuby-devel] 0.9 release

2011-01-27 Thread Caio Chassot
On 2011-01-27, at 21:27 , Laurent Sansonetti wrote: > Hi guys, > > I think it's time to release trunk as 0.9. I expect to do it next week, if > possible. Are we gonna have 0.10, 0.11, etc, or is 1.0 the next target? ___ MacRuby-devel mailing list MacRu

Re: [MacRuby-devel] Setting properties on a dereferenced NSRangePointer has no effect

2011-01-26 Thread Caio Chassot
On 2011-01-26, at 20:22 , Laurent Sansonetti wrote: > > For 1.0, we should either document this or try to make > proposedSelRangePtr[0].location=42 work, as I suspect people will hit the > same problem. Could you file a ticket? We will continue the investigation > there. Ok, will get on to tha

[MacRuby-devel] Setting properties on a dereferenced NSRangePointer has no effect

2011-01-21 Thread Caio Chassot
Hi all, NSFormatter defines a method with the following selector: isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription: This is its signature: - (BOOL)isPartialStringValid:(NSString **)partialStringPtr proposedSelectedRange:(NS

Re: [MacRuby-devel] What's happened to Dispatch::Job?

2011-01-20 Thread Caio Chassot
> platform for Mac development. So I'm trying to wrap my head around why > people would use it (Ruby) instead of C/C++/Objective C or Python for that > matter. I guess we all have our reasons, but: Over Obj C: succinctness + ruby std libary Over Python: First class cocoa citizen, not a bridge

Re: [MacRuby-devel] macruby command in console

2011-01-19 Thread Caio Chassot
On 2011-01-19, at 21:43 , Robert Rice wrote: > > Hi Caio: > > Is macruby similar to macirb but without the prompts? It's not interactive. It just reads from stdin and executes that. And implementation-wise, macirb is a whole other beast. This is not particular to macruby. It's how standard rub

Re: [MacRuby-devel] macruby command in console

2011-01-19 Thread Caio Chassot
On 2011-01-19, at 20:55 , Robert Rice wrote: > > Entering macruby by mistake on the console command line instead of macirb > gets no reply. The user must type ctrl-C to abort it. > > Probably macruby should reply with usage information and exit. Not really. macruby is expecting input. If you ty

Re: [MacRuby-devel] is_a? method

2011-01-19 Thread Caio Chassot
On 2011-01-19, at 20:50 , Robert Rice wrote: > > You instantiated AnArray. Try this: > > class AnArray < Array; end > > AnArray.kind_of?( Array ) will return false Is this what you're looking for? $ macirb irb(main):001:0> class AnArray < Array; end => nil irb(main):002:0> AnArray <= Array

Re: [MacRuby-devel] Question on Hash performance

2011-01-13 Thread Caio Chassot
I'm not perfectly sure this applies to MacRuby, but I suspect it should since our Array is implemented on top of NSMutableArray: http://ridiculousfish.com/blog/archives/2005/12/23/array/ But the gist is CFArrays more or less switch to using hashes internally at some point. On 2011-01-14, at 0

Re: [MacRuby-devel] ->(){} lambda syntax support

2011-01-11 Thread Caio Chassot
On 2011-01-11, at 17:59 , Laurent Sansonetti wrote: > > Hi Caio, > > I think it's a macirb problem, and that it should work fine outside of it. > > Can you confirm? Yes, a ticket would be appreciated :) Indeed, macirb-only. https://www.macruby.org/trac/ticket/1110 _

[MacRuby-devel] ->(){} lambda syntax support

2011-01-11 Thread Caio Chassot
Hey all, It appears the ->{} syntax for lambdas is not supported. Known? Need ticket? $ irb irb(main):001:0> ->{} => # $ macirb irb(main):001:0> ->{} SyntaxError: compile error ___ MacRuby-devel mailing list MacRuby-devel@lis

Re: [MacRuby-devel] Custom URL scheme (again)

2011-01-11 Thread Caio Chassot
On 2011-01-11, at 14:30 , Martin Hawkins wrote: > sharedAEManager.setEventHandler(self, > andSelector: :"getURL:event:withReplyEvent:returnEvent", > forEventClass: KInternetEventClass, andEventID:KAEGetURL) > … > > def getURL(event, withReplyEvent:returnEvent) So the selector for that method d

Re: [MacRuby-devel] convert array into a string

2011-01-10 Thread Caio Chassot
On 2011-01-10, at 19:19 , Laurent Sansonetti wrote: > > Assuming your array contains ASCII fixnum representation of characters, > messaging #pack('c*') on it should give you a string object back. > > I dislike this method, but here I don't see a better choice. numbers = [65, 195, 169] s = numbe

Re: [MacRuby-devel] Custom url scheme

2011-01-10 Thread Caio Chassot
in):001:0> framework 'Foundation' > => true > irb(main):002:0> KInternetEventClass > NameError: uninitialized constant KInternetEventClass > > irb(main):003:0> framework 'Cocoa' > => true > irb(main):004:0> KInternetEventClass > NameError

Re: [MacRuby-devel] Custom url scheme

2011-01-10 Thread Caio Chassot
On 2011-01-10, at 16:47 , Martin Hawkins wrote: > > Excellent Caio - thanks. > Now I've gone full circle and am getting > 'AppDelegate::KInternetEventClass (NameError) > from /Users/martin/work/macruby/experimental/build/Debug/ > experimental.app/Contents/' Maybe that constant is not there

Re: [MacRuby-devel] Custom url scheme

2011-01-10 Thread Caio Chassot
On 2011-01-10, at 15:52 , Martin Hawkins wrote: > > Thanks Matt, I've got the book but missed that point. > Any suggestions re my second issue. i.e. translating the selector part You can pass a selector as a symbol or string: m.setEventHandler(self, andSelector: :"getURL:event:withReplyEvent:re

Re: [MacRuby-devel] C-level blocks (issue #712)?

2011-01-09 Thread Caio Chassot
So It seems to me the only change there is uninlining the lambda and assigning it to a throwaway variable. That feels like busywork. I suspect this has to do with keeping a reference so it doesn't get GC'd. Just a hunch. Am I getting there? Why is this needed? On 2011-01-09, at 17:10 , Matt A

Re: [MacRuby-devel] Getting a corrupt value reading an NSNumber unsignedLongLongValue

2010-12-21 Thread Caio Chassot
On 2010-12-20, at 19:22 , Laurent Sansonetti wrote: > > Excellent! In this snippet, n is a 64-bit bignum, so I suspect something is > going wrong in the converter I couldn't help but prod around in bignum.c but I'm in way over my head. How do you go about debugging this? I suppose I'd try to ru

Re: [MacRuby-devel] Getting a corrupt value reading an NSNumber unsignedLongLongValue

2010-12-21 Thread Caio Chassot
On 2010-12-20, at 19:22 , Laurent Sansonetti wrote: > > Excellent! In this snippet, n is a 64-bit bignum, so I suspect something is > going wrong in the converter. Could you file a ticket? We will get that fixed > for 1.0. https://www.macruby.org/trac/ticket/1068 I wonder if MRI ruby 1.9 is no

Re: [MacRuby-devel] Getting a corrupt value reading an NSNumber unsignedLongLongValue

2010-12-20 Thread Caio Chassot
On 2010-12-20, at 16:37 , Caio Chassot wrote: > > Could someone try to reduce this and take the notification center and iTunes > out of the picture and see if it's just a problem with NSNumber? Oh, that was easier than I thought. #!/usr/bin/env macruby n = 0x8C2CACEF

[MacRuby-devel] Getting a corrupt value reading an NSNumber unsignedLongLongValue

2010-12-20 Thread Caio Chassot
I was trying to get the PersistentID from iTunes tracks from both ScriptingBridge and the notifications iTunes posts to NSDistributedNotificationCenter. I noticed I was getting different results from each. The first byte from the number read from the notification is nearly always garbled (I su

Re: [MacRuby-devel] require [was: [ANN] The Flying Camera (game)]

2010-12-20 Thread Caio Chassot
On 2010-12-18, at 19:58 , russell muetzelfeldt wrote: > > then bar will be included twice since '../bar' does not match './lib/bar'. > what you should do is add the lib directory to $: and then change the require > lines in main.rb to I thought $" expanded the paths on its own. I'm stupidly laz

Re: [MacRuby-devel] Calling Block-based C APIs with Ruby Procs

2010-12-07 Thread Caio Chassot
On 2010-12-07, at 22:13 , Laurent Sansonetti wrote: > > Hi Saul, > > Did you install the BridgeSupport preview 1 release? Without it, C blocks > won't work in MacRuby. > > http://www.macruby.org/blog/2010/10/08/bridgesupport-preview.html Is this part of trunk, nightlies, and a future 0.8 by de

Re: [MacRuby-devel] Regular expression related performance

2010-12-02 Thread Caio Chassot
On 2010-12-01, at 20:15 , Laurent Sansonetti wrote: > > MacRuby is using ICU. I'm not aware of ICU's internals, but I suspect the > performance issue is probably elsewhere here, given the huge difference > against 1.8. > I know we've talked about this before and you found ICU and Oniguruma to

Re: [MacRuby-devel] converging for 1.0

2010-12-01 Thread Caio Chassot
On 2010-12-01, at 07:45 , denny trebbin wrote: > > GitHub or BitBucket (I love Mercurial, its pretty much easier then Git, IMO) > doesn't really matter but I think a switch to almost newer source control > system will stop by the use of Xcode. Because Xcode is crappy and supports > not distribu

Re: [MacRuby-devel] converging for 1.0

2010-11-30 Thread Caio Chassot
On 2010-11-30, at 14:36 , Rich Morin wrote: > > I'd like to know a bit more about the activities (and > required skills) for the Bug smash days. For example, > my C/C++/Objective-C skills are rather rusty and in any > case, I have no knowledge about MacRuby internals... I too would like to know

Re: [MacRuby-devel] Key Value Observing module

2010-11-29 Thread Caio Chassot
On 2010-11-29, at 14:50 , Alan Skipp wrote: > > There's a brief article here > http://www.oreillynet.com/ruby/blog/2006/01/ruby_design_patterns_observer.html > > The procedure for setting up observers is quite different to KVO and I > imagine it has different advantages/disadvantages to KVO, tho

Re: [MacRuby-devel] Weird behaviour for a weird line of code

2010-11-16 Thread Caio Chassot
On 2010-11-16, at 21:22 , Ryan Davis wrote: > > an assignment inside a conditional is > > do_something(x) if x = logical_statement I'm particularly fond of: x = logical_statement and do_something(x) Hate me now. ___ MacRuby-devel mailing list MacR

Re: [MacRuby-devel] rtf gem

2010-10-28 Thread Caio Chassot
On 2010-10-28, at 08:26 , Robert Rice wrote: > > Thanks David: > > But I still get the the LoadError and I don't know how to fix a gem. ParseDate has been removed from ruby 1.9, of which MacRuby is a fork. That github fork of the rtf gem fixes the dependency on parsedate: http://github.com/clbu

Re: [MacRuby-devel] Understanding Pointer objects

2010-10-24 Thread Caio Chassot
On 2010-10-24, at 05:06 , Matt Aimonetti wrote: Is there any difference if I do these instead: > pointer = Pointer.new_with_type("f") p = Pointer.new(:float) #<= new instead of new_with_type > pointer.assign(3.2) p[0] = 3.2 #<= #[]= instead of #assign I have used both successf

Re: [MacRuby-devel] Strings Differ between Ruby and MacRuby?

2010-10-11 Thread Caio Chassot
On 2010-10-11, at 16:07 , Shaun August wrote: > > The script works in ruby and I can get both the "\030" and the "\220" values > to test true When in MRI, are you testing in ruby 1.9? This reeks of encoding issues. > If I have to do a work around is there any way to tell what encodings are > b

Re: [MacRuby-devel] MacRuby solutions to the exercises in Aaron Hillegass's "Cocoa Programming for Mac OS X, 3rd edition"

2010-10-10 Thread Caio Chassot
On 2010-10-04, at 03:29 , Caio Chassot wrote: > > I wrote these today: http://github.com/kch/macruby-programming-cocoa Updated that. Now done up to chapter 19. ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.or

Re: [MacRuby-devel] Method calls with variable unnamed arguments after the pseudo-hash part of the selector

2010-10-10 Thread Caio Chassot
On 2010-10-10, at 17:23 , Laurent Sansonetti wrote: > > You seem to have found a bug in the parser :) It seems I'm getting good at it ;) > Could you file that as a ticket? https://www.macruby.org/trac/ticket/950 ___ MacRuby-devel mailing list MacRub

Re: [MacRuby-devel] Objective-C class +initialize in MacRuby

2010-10-10 Thread Caio Chassot
On 2010-10-10, at 17:24 , Laurent Sansonetti wrote: > > Indeed, +initialize won't be called for pure-Ruby classes. I recommend to use > the Ruby idiom here, it's simpler :) So, the problem I'm seeing is what I alluded to earlier: writing stuff in the class body is more like +load than +initiali

Re: [MacRuby-devel] Method calls with variable unnamed arguments after the pseudo-hash part of the selector

2010-10-10 Thread Caio Chassot
On 2010-10-10, at 15:53 , Caius Durling wrote: > >> Now, the interesting part here is the ", ..." at the end. It takes variable >> arguments at the end that work as formatting arguments for informativeText, >> eg. sprintf(informativeText, ...). > > Does it work if you pass an array in as the la

[MacRuby-devel] Method calls with variable unnamed arguments after the pseudo-hash part of the selector

2010-10-10 Thread Caio Chassot
I'm playing again with implementing the Hillegass book in MacRuby, and ran across this method: + (NSAlert *)alertWithMessageText:(NSString *)messageTitle defaultButton:(NSString *)defaultButtonTitle alternateButton:(NSString *)alternateButtonTitle

Re: [MacRuby-devel] Objective-C class +initialize in MacRuby

2010-10-10 Thread Caio Chassot
On 2010-10-10, at 15:15 , Matt Aimonetti wrote: > > The problem in your example is that in Ruby, the constructor is an instance > method, not a class method. > So your mistake was to define self.initialize instead of just initialize. I'm afraid you misunderstood my question. I'm not talking abou

Re: [MacRuby-devel] Editing MacRuby's website

2010-10-10 Thread Caio Chassot
On 2010-10-10, at 13:33 , Matt Aimonetti wrote: > > You might want to refresh your browser, One such page: http://www.macruby.org/contact-us.html > otherwise there is a section in the documentation explaining how to > contribute content for the website using a github repo. For lurkers and futu

[MacRuby-devel] Objective-C class +initialize in MacRuby

2010-10-10 Thread Caio Chassot
Hi, It looks like self.initialize is a no-go: class Foo def self.initialize NSLog("self.initialize is a sd panda") # <- never runs end end The ruby idiom for that would be just: class Foo NSLog("IM IN UR CLASS INITIALIZEEN FROM RUBY") end is that

[MacRuby-devel] Editing MacRuby's website

2010-10-10 Thread Caio Chassot
Hi, Is the MacRuby website on a public repo? I'm seeing a lot of pages still say "Current Version: 0.6". Other than that there's a bunch of outdated info. It would be great if the site were on, say, github, so everyone could submit fixes. Is it available anywhere? ___

Re: [MacRuby-devel] MacRuby Document-based Application template seems a bit broken

2010-10-05 Thread Caio Chassot
On 2010-10-05, at 18:20 , Laurent Sansonetti wrote: > > Hi Caio, > > Could you file a ticket and attach either a patch or a new copy of the > templates? (Also, make sure you do not use Xcode4 for this.) There: http://www.macruby.org/trac/ticket/932 Speaking of Trac, can we maybe change it to

Re: [MacRuby-devel] NSArray's count and Ruby Array#count

2010-10-05 Thread Caio Chassot
On 2010-10-05, at 18:15 , Laurent Sansonetti wrote: > > You found out an exception :) As you know, NSArray responds to -count which > simply return the number of elements it contains. But Ruby Array defines > #count which has different semantics. > > To not conflict with NSArray, the Ruby #coun

[MacRuby-devel] MacRuby solutions to the exercises in Aaron Hillegass's "Cocoa Programming for Mac OS X, 3rd edition"

2010-10-04 Thread Caio Chassot
I wrote these today: http://github.com/kch/macruby-programming-cocoa I strived for very idiomatic ruby. This code is 100% Objective-C-isms-free. • Each exercise has its own branch • Each commit in the branch is one completed stage in the book • Each commit message mentions the chapter for the pro

[MacRuby-devel] NSArray's count and Ruby Array#count

2010-10-04 Thread Caio Chassot
Hi all, Code first: cocoa_array = NSArray.new ruby_array = [] puts ruby_array.count # => 0 puts ruby_array.count { true } # => 0 puts ruby_array.count("whatever") # => 0 puts cocoa_array.count # => 0 puts cocoa_array.count { true }

[MacRuby-devel] MacRuby Document-based Application template seems a bit broken

2010-10-03 Thread Caio Chassot
I had to make the following changes to make it work: - Change File's Owner class to MyDocument - Connect File's Owner window to Window - Connect Window's deletage to File's Owner Makes sense? I'd submit a patch but OMG so much ugly XML. Is this the right way to do it? Edit it in Interface Buil

Re: [MacRuby-devel] Objective-C-style selectors and define_method

2010-09-16 Thread Caio Chassot
On 2010-09-16, at 22:43 , Laurent Sansonetti wrote: > > > Nope, seems good :) I would however pass :"foo:bar:" instead. I believe > MacRuby will add the trailing : for you but it's clearer to be explicit here. Oh, actually I tried that first, and it added a second :, and failed. ___

[MacRuby-devel] Objective-C-style selectors and define_method

2010-09-16 Thread Caio Chassot
Hi, Can I define Objective-style interspersed-selector methods dynamically with define_method? I did this: class Foo # def foo(a, bar:b); puts a, b end define_method :"foo:bar" do |a, b| puts a, b end end Foo.new.foo(0, bar:1) and it seems to work. Is that it, or di

Re: [MacRuby-devel] (Mac)?Gems in the same place

2010-09-15 Thread Caio Chassot
On 2010-09-15, at 19:30 , Iain Barnett wrote: > > On 15 Sep 2010, at 22:43, Ryan Davis wrote: >> >> rubygems and/or macruby should probably be patched to include RUBY_ENGINE >> somewhere in the gem path. > > That's a really good idea. Either that or just accept that macruby is a > separate thi

Re: [MacRuby-devel] New iOS developer agreement

2010-09-10 Thread Caio Chassot
On 2010-09-09, at 22:57 , Scott Ribe wrote: > > I sure as heck hope that Apple is planning on changing this, once they get > the RAM in these devices up to 1 o2 gb I'd bet on an iOS-tailored (maybe a subset of) MacRuby with reference counting before iOS gets GC. __

Re: [MacRuby-devel] New iOS developer agreement

2010-09-09 Thread Caio Chassot
On 2010-09-09, at 20:44 , Henry Maddocks wrote: > > Do the recent changes mean we can use MacRuby to write iPhone apps? No, MacRuby is garbage-collected, and there's no garbage collection in iOS. You can use Nu, tho. ___ MacRuby-devel mailing list Mac

Re: [MacRuby-devel] A question about OSX APIs.

2010-08-25 Thread Caio Chassot
On 2010-08-25, at 02:03 , Rob Gleeson wrote: > > > Thanks for the reply Caio, > > Yeah that application looks promising but it doesn't do what I want, exactly. > It's still nice and proof that it's most likely possible to do something like > this. So I guess you could ask the Witch author abo

Re: [MacRuby-devel] A question about OSX APIs.

2010-08-24 Thread Caio Chassot
On 2010-08-25, at 01:13 , Rob Gleeson wrote: > > Kind of :-) cmd+` seems to cycle focus between windows belonging to a single > application. > I'd like to group a random number of windows that don't belong to a single > application, and cycle > through those. > > It's quite possible my google f

[MacRuby-devel] Foundation tool OS X Service, Garbage Collection, MacRuby: why my NSRunLoop won’ t loop in acceptInputForMode:beforeDate:?

2010-08-19 Thread Caio Chassot
(repost from http://stackoverflow.com/questions/3519436 under recommendation from @lrz) I suspect this is not strictly a MacRuby issue since I can more or less cause it in pure Objective-C with GC. I observe the same NSRunLoop issue in Nu, in addition to crashing. Anyhoo: I'm writing an OS X