From ruby-noreply at macosforge.org Sun Mar 1 01:33:36 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sun, 01 Mar 2009 09:33:36 -0000 Subject: [MacRuby-devel] [MacRuby] #225: regexp engine broken when a string contains non ascii characters Message-ID: <054.e9d7ab6864552baabe4fdca6e93ce11a@macosforge.org> #225: regexp engine broken when a string contains non ascii characters -------------------------------------+-------------------------------------- Reporter: mattaimonetti@? | Owner: lsansonetti@? Type: defect | Status: new Priority: critical | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: regexp, bug -------------------------------------+-------------------------------------- Here is a sample code to reproduce the problem: {{{ html = %{

jeanelietrujillo posted a photo:

Galgani D?coration

} html.scan(/ "http://farm3.static.flickr.com/2262/2211862262_2f08c343a3_m.jpg" }}} macruby returns: {{{ => "ttp://farm3.static.flickr.com/2262/2211862262_2f08c343a3_m.jpg\"" }}} Now let's try to remove the ? and replace it by a e: {{{ html = %{

jeanelietrujillo posted a photo:

Galgani D?coration

} html.scan(/ "http://farm3.static.flickr.com/2262/2211862262_2f08c343a3_m.jpg" }}} My guess is that the unicode characters mess up the the count to extract the matched string resulting in a substring starting one character too early. To prove my hypothesis here is another sample, this time with 2 "?" characters: {{{ html = %{

jeanelietrujilloa post? une photo:

Galgani D?coration

} html.scan(/ "tp://farm3.static.flickr.com/2262/2211862262_2f08c343a3_m.jpg\" " }}} -- Ticket URL: MacRuby From gdeciantis at gmail.com Sun Mar 1 07:15:37 2009 From: gdeciantis at gmail.com (Giampiero De Ciantis) Date: Sun, 1 Mar 2009 10:15:37 -0500 Subject: [MacRuby-devel] Project status, goals, and other In-Reply-To: References: Message-ID: <97586746-9FB8-4A29-805A-5BBC8BDAD6B3@gmail.com> Laurent, Thanks for getting back. I can definitely help with reorganizing the project and would like to participate there. Let me know where you need the most help. -Gp On 28-Feb-09, at 12:58 AM, Laurent Sansonetti wrote: > Hi Tim and Giampiero, > > The roadmap is still pretty well what we would like to achieve, the > only problem is that 0.4 should have been released a few months > ago :-( I changed the wiki page and in theory 0.4 should be out > soon, I will start working on this this week-end. > > We need to reorganize the project's organization too. I have been > recently neglecting the maintenance of it as well as failing to give > status updates. Once 0.4 is released I really want to fix that and > if people want to help they are greatly welcomed. > > On the list of organizational changes, we should have an official > repository on github (we will also keep the SVN repository in sync), > hoping that it will be easier for the community to contribute > changes. Also we will have a new website that should be more > community-friendly, featuring a more active blog and short articles > (or recipes). > > We will also start working on 0.5, which will be a very big release. > I will merge some preliminary work that I have done and we will make > a list of things that should be completed for that release. > > If you have any idea or proposition please do not hesitate to drop > them also. > > Laurent > > On Feb 27, 2009, at 1:28 PM, Tim Rand wrote: > >> >> The macruby website has a timeline for project goals. Here is the >> link >> http://www.macruby.org/trac/wiki/MacRubyRoadmap >> >> I am very excited that the IO rewrite is on the chopping block for >> 0.5. >> Tim >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby-noreply at macosforge.org Sun Mar 1 13:08:10 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sun, 01 Mar 2009 21:08:10 -0000 Subject: [MacRuby-devel] [MacRuby] #136: NSProgressIndicator freezes application In-Reply-To: <051.c5b8db1f9c62c60437c0cfc6842c9b5e@macosforge.org> References: <051.c5b8db1f9c62c60437c0cfc6842c9b5e@macosforge.org> Message-ID: <060.2e9d44e91f7eba430ac5c0391633bea6@macosforge.org> #136: NSProgressIndicator freezes application ----------------------------------+----------------------------------------- Reporter: masterkain@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by mattaimonetti@?): check the new hotcocoa mapping for the progress indicator. Everything works fine for me. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sun Mar 1 13:09:48 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sun, 01 Mar 2009 21:09:48 -0000 Subject: [MacRuby-devel] [MacRuby] #225: regexp engine broken when a string contains non ascii characters In-Reply-To: <054.e9d7ab6864552baabe4fdca6e93ce11a@macosforge.org> References: <054.e9d7ab6864552baabe4fdca6e93ce11a@macosforge.org> Message-ID: <063.23a0fd7fb9e75d97e8658da80de9f597@macosforge.org> #225: regexp engine broken when a string contains non ascii characters -------------------------------------+-------------------------------------- Reporter: mattaimonetti@? | Owner: lsansonetti@? Type: defect | Status: new Priority: critical | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: regexp, bug -------------------------------------+-------------------------------------- Comment(by mattaimonetti@?): looks like a duplicate of http://www.macruby.org/trac/ticket/94 -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sun Mar 1 14:01:12 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sun, 01 Mar 2009 22:01:12 -0000 Subject: [MacRuby-devel] [MacRuby] #137: running any modal window freezes the application In-Reply-To: <051.9a6c2ff5beae538e9aea89eb6732664e@macosforge.org> References: <051.9a6c2ff5beae538e9aea89eb6732664e@macosforge.org> Message-ID: <060.77dee42b1575f715c50f0475b60e95ec@macosforge.org> #137: running any modal window freezes the application ----------------------------------+----------------------------------------- Reporter: masterkain@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@?): * status: new => closed * resolution: => fixed Comment: The problem has been fixed since, since FlickrDemo.app runs fine with MacRuby trunk (as of r825). Closing. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sun Mar 1 14:41:09 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sun, 01 Mar 2009 22:41:09 -0000 Subject: [MacRuby-devel] [MacRuby] #180: -[MacRuby evaluateFileAtPath:] doesn't set __FILE__ In-Reply-To: <050.625e33f4ae60bce4fd645eef9141dbbb@macosforge.org> References: <050.625e33f4ae60bce4fd645eef9141dbbb@macosforge.org> Message-ID: <059.948929a0b9bb692170536ed2571634b0@macosforge.org> #180: -[MacRuby evaluateFileAtPath:] doesn't set __FILE__ -----------------------------------------+---------------------------------- Reporter: dognotdog@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: critical | Milestone: MacRuby 0.4 Component: MacRuby | Resolution: fixed Keywords: __FILE__ evaluateFileAtPath | -----------------------------------------+---------------------------------- Changes (by lsansonetti@?): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.4 Comment: Fixed in r826/trunk, thanks for reporting. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sun Mar 1 14:47:45 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sun, 01 Mar 2009 22:47:45 -0000 Subject: [MacRuby-devel] [MacRuby] #192: String#length and String#size do not work correctly In-Reply-To: <057.cdf53bbc20ef11b39994ea4ebe28fbba@macosforge.org> References: <057.cdf53bbc20ef11b39994ea4ebe28fbba@macosforge.org> Message-ID: <066.dbbcdc6b990b49d7e5391bf67ce8077e@macosforge.org> #192: String#length and String#size do not work correctly ----------------------------------------+----------------------------------- Reporter: vincent.isambart@? | Owner: lsansonetti@? Type: defect | Status: new Priority: critical | Milestone: Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- Comment(by lsansonetti@?): As of r827 {{{ $ macruby foo.rb 1 3 3 }}} Better, but still not perfect yet :-) -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sun Mar 1 14:52:08 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sun, 01 Mar 2009 22:52:08 -0000 Subject: [MacRuby-devel] [MacRuby] #202: Implement Numeric methods on NSNumber In-Reply-To: <054.680750dde58a20613751adcf517ca997@macosforge.org> References: <054.680750dde58a20613751adcf517ca997@macosforge.org> Message-ID: <063.bb2650127b680e9d041277f7b82dbf9d@macosforge.org> #202: Implement Numeric methods on NSNumber -------------------------------------+-------------------------------------- Reporter: eloy.de.enige@? | Owner: eloy.de.enige@? Type: enhancement | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -------------------------------------+-------------------------------------- Comment(by lsansonetti@?): Eloy, any progress on this? It would be great to apply this patch for 0.4. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sun Mar 1 14:53:59 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sun, 01 Mar 2009 22:53:59 -0000 Subject: [MacRuby-devel] [MacRuby] #214: hotcocoa timer mapping could have default :target => self In-Reply-To: <054.9f873a3ddd0eae6617f1884b03d2bb3a@macosforge.org> References: <054.9f873a3ddd0eae6617f1884b03d2bb3a@macosforge.org> Message-ID: <063.39e74763ffab95696f6096f7499331a2@macosforge.org> #214: hotcocoa timer mapping could have default :target => self -------------------------------------+-------------------------------------- Reporter: drnicwilliams@? | Owner: lsansonetti@? Type: enhancement | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: hotcocoa -------------------------------------+-------------------------------------- Comment(by lsansonetti@?): Rich, could you comment this bug? (For a strange reason trac doesn't allow me to reassign the bug to you, you're not in the combo list.) -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sun Mar 1 21:02:21 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 02 Mar 2009 05:02:21 -0000 Subject: [MacRuby-devel] [MacRuby] #223: net/http in macruby 0.3 (ruby 1.9) has fatal bug In-Reply-To: <054.c487b30a5f15d2aa3caa4e77b8042bbf@macosforge.org> References: <054.c487b30a5f15d2aa3caa4e77b8042bbf@macosforge.org> Message-ID: <063.283ff04b6369fd3ae2ec822dea67b47b@macosforge.org> #223: net/http in macruby 0.3 (ruby 1.9) has fatal bug -------------------------------------+-------------------------------------- Reporter: eugene@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------------+-------------------------------------- Changes (by lsansonetti@?): * status: new => closed * resolution: => fixed Comment: Rich just merged the stdlib from 1.9.1 and this bug is now addressed. Change is r829. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sun Mar 1 21:06:47 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 02 Mar 2009 05:06:47 -0000 Subject: [MacRuby-devel] [MacRuby] #214: hotcocoa timer mapping could have default :target => self In-Reply-To: <054.9f873a3ddd0eae6617f1884b03d2bb3a@macosforge.org> References: <054.9f873a3ddd0eae6617f1884b03d2bb3a@macosforge.org> Message-ID: <063.ecbd45c2c9e6bc474a05586a8d15b185@macosforge.org> #214: hotcocoa timer mapping could have default :target => self -------------------------------------+-------------------------------------- Reporter: drnicwilliams@? | Owner: lsansonetti@? Type: enhancement | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: hotcocoa -------------------------------------+-------------------------------------- Comment(by rich@?): :target => self would not work because its the caller of the method you are trying to get a reference to. Using :target => self would point the target at the self when the defaults were created, which is not the caller. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sun Mar 1 21:11:55 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 02 Mar 2009 05:11:55 -0000 Subject: [MacRuby-devel] [MacRuby] #214: hotcocoa timer mapping could have default :target => self In-Reply-To: <054.9f873a3ddd0eae6617f1884b03d2bb3a@macosforge.org> References: <054.9f873a3ddd0eae6617f1884b03d2bb3a@macosforge.org> Message-ID: <063.aee9f4e79185d88c74983b834fa237f0@macosforge.org> #214: hotcocoa timer mapping could have default :target => self -------------------------------------+-------------------------------------- Reporter: drnicwilliams@? | Owner: lsansonetti@? Type: enhancement | Status: closed Priority: minor | Milestone: Component: MacRuby | Resolution: wontfix Keywords: hotcocoa | -------------------------------------+-------------------------------------- Changes (by lsansonetti@?): * status: new => closed * resolution: => wontfix Comment: Closing. -- Ticket URL: MacRuby From scott at vaderpi.com Mon Mar 2 19:00:23 2009 From: scott at vaderpi.com (M. Scott Ford) Date: Mon, 2 Mar 2009 22:00:23 -0500 Subject: [MacRuby-devel] Recent changes cause gem statement to fail Message-ID: <801E25AC-0361-4E20-AF30-A995BE7A17CC@vaderpi.com> Hello, I just grabbed the latest from trunk (r831), and the following section from my rakefile causes the macruby process to hang. It seems to be the gem call that is causing the problem. Commenting that line out allows execution to proceed. I will keep investigating, but wanted to report this early. I would really like to see this fixed before 0.4 is released. Thanks, -Scott ENV['GEM_PATH']=File.expand_path("#{File.dirname(__FILE__)}/vendor/ gems") require "rubygems" Gem.clear_paths gem_paths = [ File.expand_path("#{File.dirname(__FILE__)}/vendor/gems") ] Gem.send :set_paths, gem_paths.join(":") gem 'cucumber' From scott at vaderpi.com Mon Mar 2 19:15:28 2009 From: scott at vaderpi.com (M. Scott Ford) Date: Mon, 2 Mar 2009 22:15:28 -0500 Subject: [MacRuby-devel] Recent changes cause gem statement to fail In-Reply-To: <801E25AC-0361-4E20-AF30-A995BE7A17CC@vaderpi.com> References: <801E25AC-0361-4E20-AF30-A995BE7A17CC@vaderpi.com> Message-ID: Hello, The breaking change was introduced in r829. -Scott On Mar 2, 2009, at 10:00 PM, M. Scott Ford wrote: > Hello, > > I just grabbed the latest from trunk (r831), and the following > section from my rakefile causes the macruby process to hang. It > seems to be the gem call that is causing the problem. Commenting > that line out allows execution to proceed. I will keep > investigating, but wanted to report this early. I would really like > to see this fixed before 0.4 is released. > > Thanks, > -Scott > > ENV['GEM_PATH']=File.expand_path("#{File.dirname(__FILE__)}/vendor/ > gems") > require "rubygems" > Gem.clear_paths > gem_paths = [ > File.expand_path("#{File.dirname(__FILE__)}/vendor/gems") > ] > Gem.send :set_paths, gem_paths.join(":") > > gem 'cucumber' > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From rich at infoether.com Mon Mar 2 19:55:53 2009 From: rich at infoether.com (Richard Kilmer) Date: Mon, 2 Mar 2009 22:55:53 -0500 Subject: [MacRuby-devel] Recent changes cause gem statement to fail In-Reply-To: <801E25AC-0361-4E20-AF30-A995BE7A17CC@vaderpi.com> References: <801E25AC-0361-4E20-AF30-A995BE7A17CC@vaderpi.com> Message-ID: Scott, We merged in the lib directory from 1.9.1_0 tag (there were over 250 changes since last time Laurent merged). We are now going through and validating things (including RubyGems). For the next few days trunk will (thus) be a tad unstable. Best, Rich On Mar 2, 2009, at 10:00 PM, M. Scott Ford wrote: > Hello, > > I just grabbed the latest from trunk (r831), and the following > section from my rakefile causes the macruby process to hang. It > seems to be the gem call that is causing the problem. Commenting > that line out allows execution to proceed. I will keep > investigating, but wanted to report this early. I would really like > to see this fixed before 0.4 is released. > > Thanks, > -Scott > > ENV['GEM_PATH']=File.expand_path("#{File.dirname(__FILE__)}/vendor/ > gems") > require "rubygems" > Gem.clear_paths > gem_paths = [ > File.expand_path("#{File.dirname(__FILE__)}/vendor/gems") > ] > Gem.send :set_paths, gem_paths.join(":") > > gem 'cucumber' > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From rwschaaf at comcast.net Tue Mar 3 03:37:39 2009 From: rwschaaf at comcast.net (Robert Schaaf) Date: Tue, 3 Mar 2009 06:37:39 -0500 Subject: [MacRuby-devel] Scanning Unicode strings for non-ascii characters Message-ID: <503F81E6-CB39-4E8D-AD9D-9B596427EC5A@comcast.net> Hello all, This may be obvious, but in a Unicode world it's driving me nuts. Given an arbitrary string, which may contain unicode characters, how do I replace all characters not in the range 0x20..0x7e with spaces? Thanks for any guidance, Bob Schaaf AIU Holdings From manfred at gmail.com Tue Mar 3 03:45:49 2009 From: manfred at gmail.com (Manfred Stienstra) Date: Tue, 3 Mar 2009 12:45:49 +0100 Subject: [MacRuby-devel] Scanning Unicode strings for non-ascii characters In-Reply-To: <503F81E6-CB39-4E8D-AD9D-9B596427EC5A@comcast.net> References: <503F81E6-CB39-4E8D-AD9D-9B596427EC5A@comcast.net> Message-ID: <5CCF567D-8FFE-471E-86EB-539AA3029552@gmail.com> On Mar 3, 2009, at 12:37 PM, Robert Schaaf wrote: > This may be obvious, but in a Unicode world it's driving me nuts. > Given an arbitrary string, which may contain unicode characters, how > do I replace all characters not in the range 0x20..0x7e with spaces? This isn't really a MacRuby related question, but here you go (: string.unpack('U*').select { |c| (0x20..0x7e).include? (c) }.pack('U*') There are probably 200 other solutions, but this seems to be the easiest one. Remember that this not very fast and you probably want to use Iconv or something if your processing large pieces of text. Manfred From rdm at cfcl.com Tue Mar 3 07:18:44 2009 From: rdm at cfcl.com (Rich Morin) Date: Tue, 3 Mar 2009 07:18:44 -0800 Subject: [MacRuby-devel] Scanning Unicode strings for non-ascii characters In-Reply-To: <5CCF567D-8FFE-471E-86EB-539AA3029552@gmail.com> References: <503F81E6-CB39-4E8D-AD9D-9B596427EC5A@comcast.net> <5CCF567D-8FFE-471E-86EB-539AA3029552@gmail.com> Message-ID: At 12:45 +0100 3/3/09, Manfred Stienstra wrote: > On Mar 3, 2009, at 12:37 PM, Robert Schaaf wrote: >> string.unpack('U*'). >> select { |c| (0x20..0x7e).include? (c) }. >> pack('U*') It looks to me like this is a solution for a different problem; that is, discarding characters outside of the specified range. Also, do we want to map newlines, etc? Anyway, irb sez: >> a = "abc\x0adef" => "abc\ndef" >> a.gsub(/[^\x20-\x7e]/, ' ') => "abc def" >> a.gsub(/[^\x00-\x7e]/, ' ') => "abc\ndef" -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From manfred at gmail.com Tue Mar 3 07:34:05 2009 From: manfred at gmail.com (Manfred Stienstra) Date: Tue, 3 Mar 2009 16:34:05 +0100 Subject: [MacRuby-devel] Scanning Unicode strings for non-ascii characters In-Reply-To: References: <503F81E6-CB39-4E8D-AD9D-9B596427EC5A@comcast.net> <5CCF567D-8FFE-471E-86EB-539AA3029552@gmail.com> Message-ID: <749C9934-7BDC-4BE3-899C-B3A3AA7F4F57@gmail.com> On Mar 3, 2009, at 4:18 PM, Rich Morin wrote: > It looks to me like this is a solution for a different problem; > that is, discarding characters outside of the specified range. > Also, do we want to map newlines, etc? Anyway, irb sez: Oops, I misread that. Yeah, gsub is probably faster. string.unpack('U*').map { |c| (0x20..0x7e).include?(c) ? c : 32 }.pack('U*') Anyway, just throwing out characters doesn't seem like a likely use- case anyway. Manfred From rwschaaf at comcast.net Tue Mar 3 18:30:09 2009 From: rwschaaf at comcast.net (Robert Schaaf) Date: Tue, 3 Mar 2009 21:30:09 -0500 Subject: [MacRuby-devel] Scanning Unicode strings for non-ascii characters In-Reply-To: <749C9934-7BDC-4BE3-899C-B3A3AA7F4F57@gmail.com> References: <503F81E6-CB39-4E8D-AD9D-9B596427EC5A@comcast.net> <5CCF567D-8FFE-471E-86EB-539AA3029552@gmail.com> <749C9934-7BDC-4BE3-899C-B3A3AA7F4F57@gmail.com> Message-ID: Well, my medication has finally worn off, and I came up with this: a_string.tr('^ -~', ' ') Any comments on efficiency? God bless ascii for being contiguous. All this is to clean up imperfectly mapped EBCDIC (eeeww!) Thanks for the suggestions. Bob Schaaf On Mar 3, 2009, at 10:34 AM, Manfred Stienstra wrote: > On Mar 3, 2009, at 4:18 PM, Rich Morin wrote: > >> It looks to me like this is a solution for a different problem; >> that is, discarding characters outside of the specified range. >> Also, do we want to map newlines, etc? Anyway, irb sez: > > Oops, I misread that. Yeah, gsub is probably faster. > > string.unpack('U*').map { |c| (0x20..0x7e).include?(c) ? c : > 32 }.pack('U*') > > Anyway, just throwing out characters doesn't seem like a likely use- > case anyway. > > Manfred > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdm at cfcl.com Tue Mar 3 21:44:30 2009 From: rdm at cfcl.com (Rich Morin) Date: Tue, 3 Mar 2009 21:44:30 -0800 Subject: [MacRuby-devel] Scanning Unicode strings for non-ascii characters In-Reply-To: References: <503F81E6-CB39-4E8D-AD9D-9B596427EC5A@comcast.net> <5CCF567D-8FFE-471E-86EB-539AA3029552@gmail.com> <749C9934-7BDC-4BE3-899C-B3A3AA7F4F57@gmail.com> Message-ID: At 21:30 -0500 3/3/09, Robert Schaaf wrote: > a_string.tr('^ -~', ' ') Any comments on efficiency? That's pretty much equivalent to this code: a.gsub(/[^\x20-\x7e]/, ' ') It may or may not be faster, more to your taste, etc. Before using it, be sure that you don't want to preserve characters such as tabs and/or newlines... -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From chapbr at gmail.com Fri Mar 6 11:54:32 2009 From: chapbr at gmail.com (Brian Chapados) Date: Fri, 6 Mar 2009 11:54:32 -0800 Subject: [MacRuby-devel] Porting Cocoa OpenGL sample code In-Reply-To: <5C029CFF-3CCA-4D7B-9C4B-166D0F97B95F@gmail.com> References: <37DE0672-BF3A-47CB-82E5-5D0C4CF5A7D0@collectapply.jp> <5C029CFF-3CCA-4D7B-9C4B-166D0F97B95F@gmail.com> Message-ID: I'm not sure what's happening with the pointer to an array of longs in the first case. It looks like the Pointer is being created, but there is no way to assign/retrieve values? p = Pointer.new_with_type('^L') p.assign([1,2,3]) p[0][1] # => 2 I think the reason that this works is that rb_objc_rval_to_ocval seems to only handle assigning a ruby array to an ObjC pointer type ("^"). I guess you could just go with it, but if the function you are passing to will write to that address, then you need to ensure that the space has been allocated (see below). When you call assign with an array, it's like writing something like this in C: unsigned long *p[1]; unsigned long array[3] = {1,2,3}; *p = array; // same as p[0] = array; *p[1]; // => 2 Ideally you just want a real C array: unsigned long[10]; or the dynamically allocated equivalent. The issue here is that CGGetActiveDisplayList is going to write data to the pointer you pass it, and it is your responsibility to make sure that you own that memory. If you tell MacRuby that you want a pointer to "^L", it reserves space for the pointer, but not space to hold the data. When you assign a ruby array to the pointer, the Pointer class dynamically allocates space for each element in the array, so if you're going to use that method, I think you might need to assign a blank array of the proper size before you pass the pointer to function: p = Pointer.new_with_type('^L') p.assign(Array.new(count,0)) count_p = Pointer.new_with_type("L") CGGetActiveDisplayList(count, p[0], count_p) This is my understanding from reading through objc.m, someone please correct me if I'm wrong about this. Brian On Fri, Feb 27, 2009 at 8:57 AM, Julien Jassaud wrote: > Brian, > Thanks for the very detailed answer. This tremendously helps. I am now > having problems with arrays, though. I try to make a pointer to an array of > 32 longs, like this : >>> p = Pointer.new_with_type('[32L]') > => # >>> p[0] > ArgumentError: can't convert C/Objective-C value `0x80052ae40' of type > `[32i]' to Ruby object > from (irb):49:in `[]' > from (irb):49 > from /usr/local/bin/macirb:12:in `
' > Am I not getting the syntax explained in the documentation page you > mentioned ? > Also, something is puzzling me. In C, arrays are pointers so I thought I > could solve the problem (and it works) by doing : >>> p=Pointer.new_with_type('^L') > => # >>> p.assign([1,2,3]) > => [1, 2, 3] >>> p[0][1] > => 2 > Great ! I have a pointer to something that looks like an array of longs (and > it seems to satisfy the?CGGetActiveDisplayList?function). But how is it > possible?when everything here is an object and not a series of neatly > aligned bytes ? > Anyway, you are right. The part of Cocoa OpenGL I am porting now probably > doesn't need to and should be wrapped in an Objective-C object. > Thanks, > Julien Jassaud > Le 26 f?vr. 09 ? 05:43, Brian Chapados a ?crit : > > Can you explain: "^{_CGLRendererInfoObject=}"? is that some secret > > incantation only known by the MacRuby/Obj overlords? > > Yes, it is actually a 7th level spell: 'Encode Structure'. ?To learn > it, you must study the ancient tome: > http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/chapter_7_section_1.html#//apple_ref/doc/uid/TP40008048-CH100-SW1 > > If it makes you feel better, I usually need to look it up (or just > run the Obj-C code sample), unless it is something simple (like '@'). > I don't keep this spell in memory, as it is only required in special > situations. > > Seriously though, that is actually how you encode a pointer to a > struct. ?If you use the @encode(type) directive, the compiler will > return the runtime encoding for 'type'. ?It's a bit cryptic, but not > too bad once you know the syntax: > > '^type' encodes a pointer to type. > '{name=...}' > encodes a struct with N fields. > > To break it down using 2 examples: > > (from the docs) > typedef struct example { > ???id ??anObject; // encoding = @ > ???char *aString; // encoding = c > ???int ?anInt; // enoding = i > } Example; > > @encode(Example) = "^{example=@ci}" > > CGLRendererInfoObj is a pointer to an opaque struct (we don't know > anything about the fields) named _CGLRendererInfoObject. All we know > is: > typedef struct _CGLRendererInfoObject *CGLRendererInfoObj; > > so it's just "^{_CGLRendererInfoObject=}" > > In practice (unless you're working with CoreFoundation C APIs) you > usually just need a pointer to an object. ?The most common usage I run > across is to retrieve NSError objects. ?The CoreFoundation C API uses > pass-by-reference extensively. ?To use these functions with MacRuby, > you need to create lots of pointer objects. In general, this is an > area where interfacing ruby with C is just fugly. ?I'd personally > avoid doing this in MacRuby. ?If you find yourself needing to use lots > Pointer objects, it's probably better and less error-prone to write > that code in C and expose it to MacRuby through an Objective-C > interface. > > That said, for common things, I've used something like this extension > to the Pointer class: > > ---- > class Pointer > ?def self.ptr > ???new_with_type("@") > ?end > > ?def self.to(type = :object) > ???case type > ?????when :object > ???????new_with_type('@') > ?????when :int > ???????new_with_type('i') > ?????when :char > ?????when :bool > ?????when :BOOL > ???????new_with_type('c') > ?????when :unsigned > ???????new_with_type('I') > ???end > ?end > > ?def value > ???self[0] > ?end > end > > ---- > > Need a pointer to an ObjC object? > p = Pointer.ptr > > To a BOOL? > p = Pointer.to(:BOOL) > > Need the value? > p.value > > Those are the most common types I've needed. > > On Wed, Feb 25, 2009 at 11:11 AM, Matt Aimonetti > wrote: > > Brian, what's up with this syntax:?info = > > Pointer.new_with_type("^{_CGLRendererInfoObject=}") > > Can you explain:?"^{_CGLRendererInfoObject=}"? is that some secret > > incantation only known by the MacRuby/Obj overlords? > > Thanks, > > - Matt > > On Wed, Feb 25, 2009 at 10:13 AM, Brian Chapados wrote: > > CGLRendererInfo is a pointer to a struct: > > ? ?typedef struct _CGLRendererInfoObject *CGLRendererInfoObj; > > try creating a pointer to void or to the struct: > > info = Pointer.new_with_type("^v") ?# void *info; > > or > > info = Pointer.new_with_type("^{_CGLRendererInfoObject=}") # > > CGLRendererInfo *info > > I think the second one is effectively the same as what you were trying > > to do with: > > info = Pointer.new_with_type("CGLRendererInfoObj") > > except that the runtime doesn't know what to do with > > "CGLRendererInfo". ?The argument to Pointer.new_with_type must be a > > valid Objective-C type encoding[1]. > > [1]: > > http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/chapter_7_section_1.html#//apple_ref/doc/uid/TP40008048-CH100-SW1 > > If you are ever in doubt about what encoding to use, you can always > > compile a small Objective-C program that prints out the output of > > @encode(). ?For example: > > #import > > #import > > int main(int argc, char *argv[]) > > { > > ? ?char *encoding = @encode(CGLRendererInfoObj); > > ? ?printf("\nencoding => %s\n\n", encoding); > > ? ?return 0; > > } > > compile with: > > gcc -Wall -o encode encode.m -framework Foundation -framework OpenGL > > then run: > > ./encode > > Maybe there is an easier way to obtain the output of @encode(). I'm not > > sure. > > Brian > > On Wed, Feb 25, 2009 at 1:42 AM, Julien Jassaud > > wrote: > > Hello, > > I am trying to port the Cocoa OpenGL sample to MacRuby and encountered a > > few > > problems. > > First, I can't access some constants defined in an enum in GLTypes.h. Do > > I > > need to port those constants to ruby by hand ? Is that related > > to?gen_bridge_metadata ? > > Second, I need to use?CGLQueryRendererInfo > > and?CGLDescribeRenderer?functions. The first one requires a pointer to > > a?CGLRendererInfoObj?structure but the second requires the object to be > > passed directly. I tried some C style pointer arithmetic : > > info = Pointer.new_with_type("CGLRendererInfoObj") > > count = Pointer.new_with_type("l") > > CGLQueryRendererInfo(caps[:cgl_display_mask],?info,?count) <- works > > fine, > > but?CGLRendererInfoObj?is opaque so I can't check it in irb. > > CGLDescribeRenderer(info[0],?0,?kCGLRPRendererCount,?count)?<- I naively > > tried to dereference the pointer, but it doesn't work. > > CGLDescribeRenderer(info,?0,?kCGLRPRendererCount,?count)?<- No > > complaints, > > but the value for count[0] is not consistent (100468704 renderers). > > I see in MacIRB that there is a?CGLRendererInfoObj class but I > > can't?instantiate?it. > > This is all new to me and I may be overlooking something obvious. If > > anyone > > has an idea, please help. > > Thanks, > > Julien Jassaud > > _______________________________________________ > > MacRuby-devel mailing list > > MacRuby-devel at lists.macosforge.org > > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > _______________________________________________ > > MacRuby-devel mailing list > > MacRuby-devel at lists.macosforge.org > > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > _______________________________________________ > > MacRuby-devel mailing list > > MacRuby-devel at lists.macosforge.org > > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > From lsansonetti at apple.com Fri Mar 6 15:59:07 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Fri, 06 Mar 2009 15:59:07 -0800 Subject: [MacRuby-devel] Recent changes cause gem statement to fail In-Reply-To: References: <801E25AC-0361-4E20-AF30-A995BE7A17CC@vaderpi.com> Message-ID: <7E10B376-FAAD-45DE-8F77-4694555014EC@apple.com> Hi Scott / Rich, I fixed a few things in trunk and now the new stdlib should be working as before. RubyGems should even be better than before, I was able to install a few basic gems and require them from macirb (but not able to install a gem with a dependency, though). I tested miniunit and rake. I also verified that all samples are working as before and that our tests are running too. So 0.4 is not far now! Laurent On Mar 2, 2009, at 7:55 PM, Richard Kilmer wrote: > Scott, > > We merged in the lib directory from 1.9.1_0 tag (there were over 250 > changes since last time Laurent merged). We are now going through > and validating things (including RubyGems). > > For the next few days trunk will (thus) be a tad unstable. > > Best, > > Rich > > On Mar 2, 2009, at 10:00 PM, M. Scott Ford wrote: > >> Hello, >> >> I just grabbed the latest from trunk (r831), and the following >> section from my rakefile causes the macruby process to hang. It >> seems to be the gem call that is causing the problem. Commenting >> that line out allows execution to proceed. I will keep >> investigating, but wanted to report this early. I would really like >> to see this fixed before 0.4 is released. >> >> Thanks, >> -Scott >> >> ENV['GEM_PATH']=File.expand_path("#{File.dirname(__FILE__)}/vendor/ >> gems") >> require "rubygems" >> Gem.clear_paths >> gem_paths = [ >> File.expand_path("#{File.dirname(__FILE__)}/vendor/gems") >> ] >> Gem.send :set_paths, gem_paths.join(":") >> >> gem 'cucumber' >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From ruby-noreply at macosforge.org Fri Mar 6 17:02:11 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 07 Mar 2009 01:02:11 -0000 Subject: [MacRuby-devel] [MacRuby] #161: `macgem install` fails for the "wirble" gem In-Reply-To: <059.72a6aa7fb39c85a0b6f84958cb529c0b@macosforge.org> References: <059.72a6aa7fb39c85a0b6f84958cb529c0b@macosforge.org> Message-ID: <068.53a054ae0da1e2cf74c16f80b1390581@macosforge.org> #161: `macgem install` fails for the "wirble" gem ------------------------------------------+--------------------------------- Reporter: macruby.org@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: minor | Milestone: MacRuby 0.4 Component: MacRuby | Resolution: fixed Keywords: | ------------------------------------------+--------------------------------- Changes (by lsansonetti@?): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.4 Comment: {{{ $ sudo macgem install wirble --no-ri --no-rdoc Successfully installed wirble-0.1.2 1 gem installed $ macirb >> gem 'wirble' => true >> MACRUBY_REVISION => "svn revision 835 from http://svn.macosforge.org/repository/ruby/MacRuby/trunk" >> }}} -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Fri Mar 6 17:32:34 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 07 Mar 2009 01:32:34 -0000 Subject: [MacRuby-devel] [MacRuby] #202: Implement Numeric methods on NSNumber In-Reply-To: <054.680750dde58a20613751adcf517ca997@macosforge.org> References: <054.680750dde58a20613751adcf517ca997@macosforge.org> Message-ID: <063.06f1306133ebd56db8e00cb8dce6ca06@macosforge.org> #202: Implement Numeric methods on NSNumber -------------------------------------+-------------------------------------- Reporter: eloy.de.enige@? | Owner: eloy.de.enige@? Type: enhancement | Status: closed Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------------+-------------------------------------- Changes (by lsansonetti@?): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.4 Comment: Merged as r837. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Fri Mar 6 21:36:29 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 07 Mar 2009 05:36:29 -0000 Subject: [MacRuby-devel] [MacRuby] #226: rake fails with stringio (LoadError) Message-ID: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> #226: rake fails with stringio (LoadError) -------------------------------+-------------------------------------------- Reporter: adam@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: building rake stringio -------------------------------+-------------------------------------------- I cannot build the trunk since rel 829. I get the following error: {{{ (in /Users/adam/Code/MacRuby/MacRuby-trunk) ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ext/extmk.rb --make="/usr/bin/make" --dest-dir="" --extout=".ext" --mflags="" --make- flags="" --extension --extstatic -- clean /Users/adam/Code/MacRuby/MacRuby-trunk/lib/yaml.rb:9:in `require': no such file to load -- stringio (LoadError) from /Users/adam/Code/MacRuby/MacRuby-trunk/lib/yaml.rb:9:in `' from /Users/adam/Code/MacRuby/MacRuby- trunk/lib/rubygems/config_file.rb:7:in `require' from /Users/adam/Code/MacRuby/MacRuby- trunk/lib/rubygems/config_file.rb:7:in `' from /Users/adam/Code/MacRuby/MacRuby-trunk/lib/rubygems.rb:883:in `require' from /Users/adam/Code/MacRuby/MacRuby-trunk/lib/rubygems.rb:883:in `' from /Users/adam/Code/MacRuby/MacRuby-trunk/lib/ubygems.rb:10:in `require' from /Users/adam/Code/MacRuby/MacRuby-trunk/lib/ubygems.rb:10:in `' from :0:in `require:' rake aborted! Command failed with status (1): [./miniruby -I./lib -I.ext/common -I./- -r....] /Users/adam/Code/MacRuby/MacRuby-trunk/rakefile:644 (See full trace by running task with --trace) }}} Any ideas? -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Fri Mar 6 21:46:16 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 07 Mar 2009 05:46:16 -0000 Subject: [MacRuby-devel] [MacRuby] #226: rake fails with stringio (LoadError) In-Reply-To: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> References: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> Message-ID: <057.8cde1fa0864e821897b00e883e94a6f5@macosforge.org> #226: rake fails with stringio (LoadError) -------------------------------+-------------------------------------------- Reporter: adam@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: building rake stringio -------------------------------+-------------------------------------------- Changes (by lsansonetti@?): * milestone: MacRuby 0.4 => Comment: Could you retry from a fresh/clean repository? -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Fri Mar 6 21:59:24 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 07 Mar 2009 05:59:24 -0000 Subject: [MacRuby-devel] [MacRuby] #226: rake fails with stringio (LoadError) In-Reply-To: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> References: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> Message-ID: <057.293a31467419f38f45f66f4cd0e7fb1c@macosforge.org> #226: rake fails with stringio (LoadError) -------------------------------+-------------------------------------------- Reporter: adam@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: building rake stringio -------------------------------+-------------------------------------------- Comment(by adam@?): Replying to [comment:1 lsansonetti@?]: > Could you retry from a fresh/clean repository? Same error, here's the build log from a fresh checkout: {{{ (in /Users/adam/Code/MacRuby/MacRuby-trunk) mkdir -p .ext/include/universal-darwin9.0/ruby cp include/ruby/config.h .ext/include/universal-darwin9.0/ruby /usr/sbin/dtrace -h -s dtrace.d -o new_dtrace.h mv new_dtrace.h dtrace.h /usr/bin/ruby tool/compile_prelude.rb prelude.rb miniprelude.c.new mv miniprelude.c.new miniprelude.c touch prelude.c /usr/bin/bison -o y.tab.c parse.y /usr/bin/sed -f ./tool/ytab.sed -e "/^#/s!y.tab.c!parse.c!" y.tab.c > parse.c.new mv parse.c.new parse.c rm -f parse.o cp lex.c.blt lex.c /usr/bin/ruby -Ks tool/insns2vm.rb opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc vmtc.inc vm.inc /usr/bin/ruby -n tool/node_name.rb include/ruby/node.h > node_name.inc /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c array.c -o array.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c bignum.c -o bignum.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c class.c -o class.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c compar.c -o compar.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c complex.c -o complex.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c dir.c -o dir.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c enum.c -o enum.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c enumerator.c -o enumerator.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c error.c -o error.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c eval.c -o eval.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c load.c -o load.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c proc.c -o proc.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c file.c -o file.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c gc.c -o gc.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c hash.c -o hash.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c inits.c -o inits.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c io.c -o io.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c marshal.c -o marshal.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c math.c -o math.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c numeric.c -o numeric.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c object.c -o object.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c pack.c -o pack.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c parse.c -o parse.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c process.c -o process.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c prec.c -o prec.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c random.c -o random.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c range.c -o range.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c rational.c -o rational.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c re.c -o re.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c regcomp.c -o regcomp.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c regenc.c -o regenc.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c regerror.c -o regerror.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c regexec.c -o regexec.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c regparse.c -o regparse.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c regsyntax.c -o regsyntax.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c ruby.c -o ruby.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c set.c -o set.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c signal.c -o signal.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c sprintf.c -o sprintf.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c st.c -o st.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c string.c -o string.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c struct.c -o struct.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c time.c -o time.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c transcode.c -o transcode.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c util.c -o util.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c variable.c -o variable.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c version.c -o version.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c blockinlining.c -o blockinlining.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c compile.c -o compile.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c debug.c -o debug.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c iseq.c -o iseq.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c vm.c -o vm.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c vm_dump.c -o vm_dump.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c thread.c -o thread.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c cont.c -o cont.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c id.c -o id.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -fobjc-gc-only -c objc.m -o objc.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c bs.c -o bs.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c encoding.c -o encoding.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c main.c -o main.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c dln.c -o dln.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c dmyext.c -o dmyext.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c enc/ascii.c -o enc/ascii.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c missing/lgamma_r.c -o missing/lgamma_r.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c prelude.c -o prelude.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c miniprelude.c -o miniprelude.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -fobjc-gc-only -c gc-stub.m -o gc-stub.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror array.o bignum.o class.o compar.o complex.o dir.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o set.o signal.o sprintf.o st.o string.o struct.o time.o transcode.o util.o variable.o version.o blockinlining.o compile.o debug.o iseq.o vm.o vm_dump.o thread.o cont.o id.o objc.o bs.o encoding.o main.o dln.o dmyext.o enc/ascii.o missing/lgamma_r.o miniprelude.o gc-stub.o -lpthread -ldl -lxml2 -lobjc -lffi -lauto -framework Foundation -o miniruby ./miniruby -I. -I./lib -rrbconfig tool/compile_prelude.rb prelude.rb gem_prelude.rb prelude.c.new mv prelude.c.new prelude.c /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror -c prelude.c -o prelude.o /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror array.o bignum.o class.o compar.o complex.o dir.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o set.o signal.o sprintf.o st.o string.o struct.o time.o transcode.o util.o variable.o version.o blockinlining.o compile.o debug.o iseq.o vm.o vm_dump.o thread.o cont.o id.o objc.o bs.o encoding.o dln.o dmyext.o enc/ascii.o missing/lgamma_r.o prelude.o -lpthread -ldl -lxml2 -lobjc -lffi -lauto -framework Foundation -dynamiclib -undefined suppress -flat_namespace -install_name /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/libmacruby.dylib -current_version 0.4 -compatibility_version 0.4 -o libmacruby.1.9.0.dylib rm -f libmacruby.1.9.dylib ln -s libmacruby.1.9.0.dylib libmacruby.1.9.dylib rm -f libmacruby.dylib ln -s libmacruby.1.9.0.dylib libmacruby.dylib /usr/bin/gcc -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated- declarations -Werror main.o gc-stub.o -L. -lmacruby -lobjc -o macruby rm -f libmacruby-static.a /usr/bin/ar rcu libmacruby-static.a array.o bignum.o class.o compar.o complex.o dir.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o set.o signal.o sprintf.o st.o string.o struct.o time.o transcode.o util.o variable.o version.o blockinlining.o compile.o debug.o iseq.o vm.o vm_dump.o thread.o cont.o id.o objc.o bs.o encoding.o dln.o dmyext.o enc/ascii.o missing/lgamma_r.o prelude.o /usr/bin/ranlib libmacruby-static.a GC_DISABLE=1 ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ext/extmk.rb --make="/usr/bin/make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --extension --extstatic /Users/adam/Code/MacRuby/MacRuby-trunk/lib/yaml.rb:9:in `require': no such file to load -- stringio (LoadError) from /Users/adam/Code/MacRuby/MacRuby-trunk/lib/yaml.rb:9:in `' from /Users/adam/Code/MacRuby/MacRuby- trunk/lib/rubygems/config_file.rb:7:in `require' from /Users/adam/Code/MacRuby/MacRuby- trunk/lib/rubygems/config_file.rb:7:in `' from /Users/adam/Code/MacRuby/MacRuby-trunk/lib/rubygems.rb:883:in `require' from /Users/adam/Code/MacRuby/MacRuby-trunk/lib/rubygems.rb:883:in `' from /Users/adam/Code/MacRuby/MacRuby-trunk/lib/ubygems.rb:10:in `require' from /Users/adam/Code/MacRuby/MacRuby-trunk/lib/ubygems.rb:10:in `' from :0:in `require:' rake aborted! Command failed with status (1): [GC_DISABLE=1 ./miniruby -I./lib -I.ext/com...] /Users/adam/Code/MacRuby/MacRuby-trunk/rakefile:587 (See full trace by running task with --trace) }}} -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sat Mar 7 00:49:12 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 07 Mar 2009 08:49:12 -0000 Subject: [MacRuby-devel] [MacRuby] #226: rake fails with stringio (LoadError) In-Reply-To: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> References: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> Message-ID: <057.ec09e9f1ff9d73f28c9ccc55fd6c3ede@macosforge.org> #226: rake fails with stringio (LoadError) -------------------------------+-------------------------------------------- Reporter: adam@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: building rake stringio -------------------------------+-------------------------------------------- Comment(by lsansonetti@?): I'm afraid I cannot reproduce it. I removed /Library/Frameworks/MacRuby.framework, then got a fresh checkout of trunk and was able to do "rake" and "sudo rake install" inside it. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sat Mar 7 04:02:55 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 07 Mar 2009 12:02:55 -0000 Subject: [MacRuby-devel] [MacRuby] #226: rake fails with stringio (LoadError) In-Reply-To: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> References: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> Message-ID: <057.16c5d694c9a7f52b166042d597da81bf@macosforge.org> #226: rake fails with stringio (LoadError) -------------------------------+-------------------------------------------- Reporter: adam@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: building rake stringio -------------------------------+-------------------------------------------- Comment(by adam@?): 've tracked down the error to my environment: {{{ export LC_CTYPE=en_US.UTF-8 export RUBYOPT=-rubygems }}} was causing the problem, I'm not exactly why that would cause the problem, but maybe this will help someone else. Thanks for your help! -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sat Mar 7 09:46:02 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 07 Mar 2009 17:46:02 -0000 Subject: [MacRuby-devel] [MacRuby] #226: rake fails with stringio (LoadError) In-Reply-To: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> References: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> Message-ID: <057.413dac1a1ecd46d7ec9f6982d7f059d5@macosforge.org> #226: rake fails with stringio (LoadError) -------------------------------+-------------------------------------------- Reporter: adam@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: building rake stringio -------------------------------+-------------------------------------------- Comment(by johnl@?): Just to second Adam's message -- I, too, had build problems when RUBYOPT was defined. I've seen this before with other projects, so it's not unique to MacRuby, but it is confusing unless you know what to do. I build by using the command line "RUBYOPT= rake" (that's a space after "="). -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sat Mar 7 12:07:31 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 07 Mar 2009 20:07:31 -0000 Subject: [MacRuby-devel] [MacRuby] #226: rake fails with stringio (LoadError) In-Reply-To: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> References: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> Message-ID: <057.3eade41ae01ebe19f036251365e22e6a@macosforge.org> #226: rake fails with stringio (LoadError) ------------------------------------+--------------------------------------- Reporter: adam@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: worksforme Keywords: building rake stringio | ------------------------------------+--------------------------------------- Changes (by lsansonetti@?): * status: new => closed * resolution: => worksforme Comment: Good catch! I will try to do something with the build system, to either ignore RUBYOPT or print a warning. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Sat Mar 7 12:18:34 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 07 Mar 2009 20:18:34 -0000 Subject: [MacRuby-devel] [MacRuby] #226: rake fails with stringio (LoadError) In-Reply-To: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> References: <048.317ad5ca6efaeb05ad8c96f4f12ffe94@macosforge.org> Message-ID: <057.8696d4166cfbbf4b39868c417b1bf8d8@macosforge.org> #226: rake fails with stringio (LoadError) ------------------------------------+--------------------------------------- Reporter: adam@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Resolution: worksforme Keywords: building rake stringio | ------------------------------------+--------------------------------------- Changes (by lsansonetti@?): * milestone: => MacRuby 0.4 Comment: Added a warning in r848. -- Ticket URL: MacRuby From laurent.sansonetti at gmail.com Sun Mar 8 23:52:53 2009 From: laurent.sansonetti at gmail.com (Laurent Sansonetti) Date: Sun, 8 Mar 2009 23:52:53 -0700 Subject: [MacRuby-devel] [ANN] MacRuby 0.4 Message-ID: <1be7247c0903082352l513614ebpd5a35d7d8449d39d@mail.gmail.com> Hi, After several months of development and some slight delays, MacRuby 0.4 is now available. Get it here while it's still hot! MacRuby is a version of Ruby 1.9, ported to run directly on top of Mac OS X core technologies such as the Objective-C common runtime and garbage collector, and the CoreFoundation framework. While still a work in progress, it is the goal of MacRuby to enable the creation of full-fledged Mac OS X applications which do not sacrifice performance in order to enjoy the benefits of using Ruby. You can learn more about MacRuby, and download a binary installer, from the website: http://ruby.macosforge.org Or about this release more specifically, on our blog: http://www.macruby.org/post/macruby-04 Enjoy, Laurent From ruby-noreply at macosforge.org Mon Mar 9 00:23:39 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 09 Mar 2009 07:23:39 -0000 Subject: [MacRuby-devel] [MacRuby] #227: Using a block's binding causes segfault Message-ID: <053.bb47cb25755c370d07e3943fb6d7438b@macosforge.org> #227: Using a block's binding causes segfault ------------------------------------+--------------------------------------- Reporter: charles.nutter@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Under all version of Ruby, you can use the binding associated with a block for further evals. This appears to segfault MacRuby 0.4: {{{ ~/projects/jruby ? macruby -e "def foo(&b); eval 'a = 2', b.binding; end; a = 1; foo {}; puts a" -e:1: [BUG] Bus Error MacRuby version 0.4 (ruby 1.9.1) [universal-darwin9.5, i386] -- stack frame ------------ 0000 (0x30030): 00000004 0001 (0x30034): 00000000 0002 (0x30038): 00000004 0003 (0x3003c): 00000000 0004 (0x30040): 00000003 0005 (0x30044): 00000004 0006 (0x30048): 01018a80 0007 (0x3004c): 00000004 0008 (0x30050): 010183a0 0009 (0x30054): 00000004 0010 (0x30058): 01018370 0011 (0x3005c): 00000004 0012 (0x30060): 01048730 0013 (0x30064): 010183a0 0014 (0x30068): 00000004 0015 (0x3006c): 00000000 <- lfp <- dfp -- control frame ---------- c:0005 p:---- s:0016 b:0016 l:000015 d:000015 CFUNC :binding c:0004 p:0011 s:0013 b:0011 l:000010 d:000010 METHOD -e:1 c:0003 p:0016 s:0007 b:0007 l:000fe8 d:000fe8 TOP -e:1 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited: c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP --------------------------- DBG> : "-e:1:in `binding'" DBG> : "-e:1:in `foo'" DBG> : "-e:1:in `
'" -- backtrace of native function call (Use addr2line) -- 0x2f1f66 0x2069dc 0x206a1b 0x2a27db 0x9715f2bb 0xffffffff 0x2ed63f 0x2ddbaf 0x2e822b 0x2e84be 0x209ec9 0x20d050 0x1e8f 0x1df6 ------------------------------------------------------- Abort trap }}} -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Mon Mar 9 02:40:15 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 09 Mar 2009 09:40:15 -0000 Subject: [MacRuby-devel] [MacRuby] #228: Crash in my NSOutlineView data source Message-ID: <049.1b74afa21c8d318fbd0b1e4048c6c730@macosforge.org> #228: Crash in my NSOutlineView data source --------------------------------+------------------------------------------- Reporter: cyberfox@? | Owner: lsansonetti@? Type: defect | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: crash --------------------------------+------------------------------------------- Greetings, I am at a loss; I've thrown away two days trying to figure out what it might be in my code, and countless variations on the theme of 'what data will this allow?' I've tried a deep hash, recursive arrays, and now a custom Pair structure, and it always blows up at a certain point _eventually_, and not in a nice Ruby way. :) I've figured out so much, but I'm fully stymied on getting NSOutlineView working with in my app. Specifically, it appears that some data is being corrupted in memory, and when it's being referenced, it's crashing to gdb. My application is at http://github.com/cyberfox/fallout3 and is my first attempt at a MacRuby app. I don't really know Cocoa either, although I was able to figure out a lot. If you run it, and paste the following data: {{{ #1234 #4321 #1245 #2143 #5432 #3412 }}} into the TextView, then click 'Analyze', then try to open up some of the entries in the OutlineView on the right. You'll see the crash after one or two levels. I tried 0.3, I tried trunk, and then 0.4 was released, and I jumped on that. Nothing works. It's entirely possible I'm doing something wrong; I figured out how to write a NSOutlineView data source by the seat of my pants, and it's obviously possible I'm getting it wrong. But I can't imagine that I'm getting it wrong in a way that's letting me stomp on memory from Ruby... Please help me understand this; I really believe it shouldn't be crashing to GDB, even if I've really screwed up my algorithm. When debugging an earlier version (it used array pairs and .first and .last), I found it died at ruby.h:1149 which was a reference to *(Class *)obj == (Class)rb_cFixnum and it was blowing up because obj was 0xffffffff, obviously bad. I believe that something is getting stomped on; and my program is showing it consistently. It is likely my fault, but it shouldn't be _possible_... Please try it and let me know what is going on... -- Morgan Schweers -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Mon Mar 9 02:41:46 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 09 Mar 2009 09:41:46 -0000 Subject: [MacRuby-devel] [MacRuby] #228: Crash in my NSOutlineView data source In-Reply-To: <049.1b74afa21c8d318fbd0b1e4048c6c730@macosforge.org> References: <049.1b74afa21c8d318fbd0b1e4048c6c730@macosforge.org> Message-ID: <058.00fcbbf26451132e3e5a0d4f02ce49b7@macosforge.org> #228: Crash in my NSOutlineView data source --------------------------------+------------------------------------------- Reporter: cyberfox@? | Owner: lsansonetti@? Type: defect | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: crash --------------------------------+------------------------------------------- Comment(by cyberfox@?): Current backtrace failure from 0.4 as just downloaded. {{{ #0 0x002bf09b in ivar_get () #1 0x002edc16 in vm_call_method () #2 0x002ddbaf in vm_eval () #3 0x002e822b in vm_eval_body () #4 0x002e9714 in vm_call0 () #5 0x0030271b in rb_ruby_to_objc_closure_handler_main () #6 0x00302978 in rb_ruby_to_objc_closure_handler () #7 0x94283424 in ffi_closure_SYSV () #8 0x9155bdee in -[NSOutlineView _dataSourceValueForColumn:row:] () #9 0x9155ba18 in -[NSTableView preparedCellAtColumn:row:] () #10 0x9155b87c in -[NSTableView _drawContentsAtRow:column:withCellFrame:] () #11 0x9155b7ea in -[NSOutlineView _drawContentsAtRow:column:withCellFrame:] () #12 0x9155adb2 in -[NSTableView drawRow:clipRect:] () #13 0x915001a0 in -[NSTableView drawRowIndexes:clipRect:] () #14 0x9150002a in -[NSOutlineView drawRowIndexes:clipRect:] () #15 0x914fec84 in -[NSTableView drawRect:] () #16 0x9158f29c in -[NSView _drawRect:clip:] () #17 0x9158cb0d in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #18 0x9158d543 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #19 0x9158d543 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #20 0x9158d543 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #21 0x9158d543 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #22 0x9158c02b in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #23 0x91588b4f in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] () #24 0x914c9523 in -[NSView displayIfNeeded] () #25 0x914c90d1 in -[NSWindow displayIfNeeded] () #26 0x914c8ef4 in _handleWindowNeedsDisplay () #27 0x95ae79a2 in __CFRunLoopDoObservers () #28 0x95ae8cfc in CFRunLoopRunSpecific () #29 0x95ae9cd8 in CFRunLoopRunInMode () #30 0x95cef2c0 in RunCurrentEventLoopInMode () #31 0x95cef012 in ReceiveNextEventCommon () #32 0x95ceef4d in BlockUntilNextEventMatchingListInMode () #33 0x914c6d7d in _DPSNextEvent () #34 0x914c6630 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () #35 0x91597ee3 in -[NSWindow nextEventMatchingMask:] () #36 0x916a9877 in -[NSMouseTracker trackWithEvent:inView:withDelegate:] () #37 0x915ee58c in -[NSOutlineView mouseDown:] () #38 0x915951a3 in -[NSWindow sendEvent:] () #39 0x91561d49 in -[NSApplication sendEvent:] () #40 0x914bf69f in -[NSApplication run] () #41 0x9148c8a4 in NSApplicationMain () #42 0x942831dd in .LCFI1 () #43 0x94283771 in ffi_call () #44 0x00303330 in rb_bsfunc_call () #45 0x002ed45e in vm_call_method () #46 0x002ddbaf in vm_eval () #47 0x002e822b in vm_eval_body () #48 0x002e84be in rb_iseq_eval () #49 0x00209ec9 in ruby_exec_node () #50 0x0020d050 in ruby_run_node () #51 0x002fb175 in macruby_main () #52 0x00001fed in main (argc=1, argv=0xbffff664) at /Users/mrs/Documents/Fallout 3 Hackers Helper/main.m:13 }}} -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Mon Mar 9 03:22:00 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 09 Mar 2009 10:22:00 -0000 Subject: [MacRuby-devel] [MacRuby] #171: [trunk/#762] build fails in ripper extension In-Reply-To: <050.4fe72c72199435605bc11390bd50c0a2@macosforge.org> References: <050.4fe72c72199435605bc11390bd50c0a2@macosforge.org> Message-ID: <059.2a796bac816f9cb6acc53c21c480209b@macosforge.org> #171: [trunk/#762] build fails in ripper extension ---------------------------------+------------------------------------------ Reporter: roberto@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: bison, ripper ---------------------------------+------------------------------------------ Comment(by chris@?): I got this too, there are two workrounds, either deactivate the bison port, or manually edit the ripper makefile to use /usr/bin/bison. Ideally the makefile should specify the bison it needs -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Mon Mar 9 03:27:17 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 09 Mar 2009 10:27:17 -0000 Subject: [MacRuby-devel] [MacRuby] #229: macirb crash Message-ID: <060.22310c8a9298a569066129fbf0b684fa@macosforge.org> #229: macirb crash -------------------------------------------+-------------------------------- Reporter: francois.stephany@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: macirb 0.4 -------------------------------------------+-------------------------------- Just installed macruby 0.4 from http://www.macruby.org/files/ Installation goes fine but I get this error when lauching macirb: {{{ kikoolol:~ fstephany$ macirb /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/locale.rb:45:in `rescue in initialize': uninitialized constant Encoding::ASCII_8BIT (NameError) from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/locale.rb:45:in `initialize' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/init.rb:114:in `new' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/init.rb:114:in `init_config' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/init.rb:16:in `setup' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb.rb:53:in `start' from /usr/local/bin/macirb:12:in `
' }}} I'm running on 10.5.6 -- Ticket URL: MacRuby From drnicwilliams at gmail.com Mon Mar 9 03:36:54 2009 From: drnicwilliams at gmail.com (Dr Nic Williams) Date: Mon, 9 Mar 2009 18:36:54 +0800 Subject: [MacRuby-devel] [ANN] MacRuby 0.4 In-Reply-To: <1be7247c0903082352l513614ebpd5a35d7d8449d39d@mail.gmail.com> References: <1be7247c0903082352l513614ebpd5a35d7d8449d39d@mail.gmail.com> Message-ID: <44b555bb0903090336m3619e944p4456bf025328a78a@mail.gmail.com> Yay for 0.4!! Thanks for an awesome project. Nic On Mon, Mar 9, 2009 at 2:52 PM, Laurent Sansonetti wrote: > Hi, > > After several months of development and some slight delays, MacRuby > 0.4 is now available. Get it here while it's still hot! > > MacRuby is a version of Ruby 1.9, ported to run directly on top of Mac > OS X core technologies such as the Objective-C common runtime and > garbage collector, and the CoreFoundation framework. While still a > work in progress, it is the goal of MacRuby to enable the creation of > full-fledged Mac OS X applications which do not sacrifice performance > in order to enjoy the benefits of using Ruby. > > You can learn more about MacRuby, and download a binary installer, > from the website: > > http://ruby.macosforge.org > > Or about this release more specifically, on our blog: > > http://www.macruby.org/post/macruby-04 > > Enjoy, > > Laurent > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -- Dr Nic Williams iPhone and Rails consultants - http://mocra.com Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com * Surf Report for iPhone - http://mocra.com/projects/surfreport/ * From rdm at cfcl.com Mon Mar 9 12:05:15 2009 From: rdm at cfcl.com (Rich Morin) Date: Mon, 9 Mar 2009 11:05:15 -0800 Subject: [MacRuby-devel] [ANN] MacRuby 0.4 In-Reply-To: <44b555bb0903090336m3619e944p4456bf025328a78a@mail.gmail.com> References: <1be7247c0903082352l513614ebpd5a35d7d8449d39d@mail.gmail.com> <44b555bb0903090336m3619e944p4456bf025328a78a@mail.gmail.com> Message-ID: On Mon, Mar 9, 2009 at 2:52 PM, Laurent Sansonetti > You can learn more about MacRuby, and download a binary installer, > from the website: > > http://ruby.macosforge.org > > Or about this release more specifically, on our blog: > > http://www.macruby.org/post/macruby-04 Neither the posting, the web site, nor the blog mentions the fact that the binary installer for the new release doesn't include support for PowerPC machines: $ file /usr/local/bin/macruby /usr/local/bin/macruby: Mach-O universal binary with 2 architectures /usr/local/bin/macruby (for architecture i386): Mach-O executable i386 /usr/local/bin/macruby (for architecture x86_64): Mach-O 64-bit executable x86_64 I downloaded the sources $ svn co http://svn.macosforge.org/repository/ruby/MacRuby/tags/0.4 \ MacRuby-0.4 and attempted to follow the build instructions on http://www.macruby.org/trac/wiki/InstallingMacRuby $ cd MacRuby MacRuby: No such file or directory. Sigh. $ ls MacRuby-0.4 $ cd MacRuby-0.4 $ rake (in /Local/_Private/Homes/rdm/Private/Work/MacRuby/MacRuby-0.4) Warning: your appear to use a PowerPC machine. MacRuby's PPC support is very basic and may be dropped in a near future. Supported architectures are Intel 32-bit and 64-bit (i386 and x86_64). ... compiling readline gcc -I. -I../../.ext/include/universal-darwin9.0 -I..//.././include -I..//.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" -fno-common -fno-common -pipe -O2 -g -Wall -Wno-parentheses -arch ppc -o readline.o -c readline.c readline.c: In function 'filename_completion_proc_call': readline.c:683: warning: implicit declaration of function 'completion_matches' readline.c:684: error: 'filename_completion_function' undeclared (first use in this function) readline.c:684: error: (Each undeclared identifier is reported only once readline.c:684: error: for each function it appears in.) readline.c:684: warning: assignment makes pointer from integer without a cast readline.c: In function 'username_completion_proc_call': readline.c:709: error: 'username_completion_function' undeclared (first use in this function) readline.c:709: warning: assignment makes pointer from integer without a cast make: *** [readline.o] Error 1 rake aborted! Command failed with status (1): [GC_DISABLE=1 ./miniruby -I./lib -I.ext/com...] .../MacRuby-0.4/rakefile:591 (See full trace by running task with --trace) I think this falls a bit below "very basic support". :-/ I have no argument with Laurent or Apple about their current priorities: making MacRuby build and run on PowerPC is a burden that Laurent does not need at this point in the development process. Nor do I have the chops or time to dig into the sources and try to make the build work. However, it's possible that some other folks might be motivated to follow along behind Laurent and produce the occasional PowerPC build. Any takers? Meanwhile, I updated http://www.macruby.org/trac/wiki/InstallingMacRuby to reflect the new reality. The blog does not allow comments, so I was unable to post a caveat there. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From ruby-noreply at macosforge.org Mon Mar 9 12:59:46 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 09 Mar 2009 19:59:46 -0000 Subject: [MacRuby-devel] [MacRuby] #229: macirb crash In-Reply-To: <060.22310c8a9298a569066129fbf0b684fa@macosforge.org> References: <060.22310c8a9298a569066129fbf0b684fa@macosforge.org> Message-ID: <069.746ef92a56847d600eefbffcfa06b7ee@macosforge.org> #229: macirb crash -------------------------------------------+-------------------------------- Reporter: francois.stephany@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: macirb 0.4 -------------------------------------------+-------------------------------- Comment(by lsansonetti@?): I was able to reproduce it by setting the LANG environment variable to something. {{{ $ LANG=fr macirb /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/locale.rb:45:in `rescue in initialize': uninitialized constant Encoding::ASCII_8BIT (NameError) from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/locale.rb:45:in `initialize' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/init.rb:114:in `new' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/init.rb:114:in `init_config' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb/init.rb:16:in `setup' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/irb.rb:53:in `start' from /usr/local/bin/macirb:12:in `
' }}} As a workaround, undefining the LANG environment variable makes macirb work again. -- Ticket URL: MacRuby From dognotdog at gmail.com Mon Mar 9 13:58:17 2009 From: dognotdog at gmail.com (=?UTF-8?B?RMO2bcO2dMO2ciBHdWx5w6Fz?=) Date: Mon, 9 Mar 2009 21:58:17 +0100 Subject: [MacRuby-devel] [ANN] MacRuby 0.4 In-Reply-To: References: <1be7247c0903082352l513614ebpd5a35d7d8449d39d@mail.gmail.com> <44b555bb0903090336m3619e944p4456bf025328a78a@mail.gmail.com> Message-ID: <63e729760903091358p6e547db6i5c914e061869d3d0@mail.gmail.com> I've been successfully building the MacRuby framework as a 32bit PPC/i386 UB, from trunk, with following command: RC_ARCHS="ppc i386" rake macruby For some reason, the order in which the archs are specified matters. I am not sure how well it actually runs, as I don't have any reports from PPC users for my app, and it doesn't work in Rosetta. 2009/3/9 Rich Morin : > On Mon, Mar 9, 2009 at 2:52 PM, Laurent Sansonetti >> You can learn more about MacRuby, and download a binary installer, >> from the website: >> >> http://ruby.macosforge.org >> >> Or about this release more specifically, on our blog: >> >> http://www.macruby.org/post/macruby-04 > > Neither the posting, the web site, nor the blog mentions the fact > that the binary installer for the new release doesn't include > support for PowerPC machines: > > ?$ file /usr/local/bin/macruby > ?/usr/local/bin/macruby: > ? ?Mach-O universal binary with 2 architectures > ? ?/usr/local/bin/macruby (for architecture i386): > ? ? ?Mach-O executable i386 > ? ?/usr/local/bin/macruby (for architecture x86_64): > ? ? ?Mach-O 64-bit executable x86_64 > > I downloaded the sources > > ?$ svn co http://svn.macosforge.org/repository/ruby/MacRuby/tags/0.4 \ > ? ?MacRuby-0.4 > > and attempted to follow the build instructions on > > ?http://www.macruby.org/trac/wiki/InstallingMacRuby > > ?$ cd MacRuby > ?MacRuby: No such file or directory. > > Sigh. > > ?$ ls > ?MacRuby-0.4 > > ?$ cd MacRuby-0.4 > > ?$ rake > ?(in /Local/_Private/Homes/rdm/Private/Work/MacRuby/MacRuby-0.4) > ?Warning: your appear to use a PowerPC machine. ?MacRuby's PPC support > ?is very basic and may be dropped in a near future. ?Supported > ?architectures are Intel 32-bit and 64-bit (i386 and x86_64). > ?... > ?compiling readline > ?gcc -I. -I../../.ext/include/universal-darwin9.0 -I..//.././include > ? ?-I..//.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" ?-fno-common > ? ?-fno-common -pipe -O2 -g -Wall -Wno-parentheses -arch ppc -o readline.o > ? ?-c readline.c > ?readline.c: In function 'filename_completion_proc_call': > ?readline.c:683: warning: implicit declaration of function > 'completion_matches' > ?readline.c:684: error: 'filename_completion_function' undeclared > ? ?(first use in this function) > ?readline.c:684: error: (Each undeclared identifier is reported only once > ?readline.c:684: error: for each function it appears in.) > ?readline.c:684: warning: assignment makes pointer from integer without a > cast > ?readline.c: In function 'username_completion_proc_call': > ?readline.c:709: error: 'username_completion_function' undeclared > ? ?(first use in this function) > ?readline.c:709: warning: assignment makes pointer from integer without a > cast > ?make: *** [readline.o] Error 1 > ?rake aborted! > ?Command failed with status (1): [GC_DISABLE=1 ./miniruby -I./lib > -I.ext/com...] > ?.../MacRuby-0.4/rakefile:591 > ?(See full trace by running task with --trace) > > > I think this falls a bit below "very basic support". ?:-/ > > > I have no argument with Laurent or Apple about their current priorities: > making MacRuby build and run on PowerPC is a burden that Laurent does not > need at this point in the development process. ?Nor do I have the chops > or time to dig into the sources and try to make the build work. > > However, it's possible that some other folks might be motivated to follow > along behind Laurent and produce the occasional PowerPC build. ?Any takers? > > > Meanwhile, I updated http://www.macruby.org/trac/wiki/InstallingMacRuby to > reflect the new reality. ?The blog does not allow comments, so I was unable > to post a caveat there. > > -r > -- > http://www.cfcl.com/rdm ? ? ? ? ? ?Rich Morin > http://www.cfcl.com/rdm/resume ? ? rdm at cfcl.com > http://www.cfcl.com/rdm/weblog ? ? +1 650-873-7841 > > Technical editing and writing, programming, and web development > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > From mattaimonetti at gmail.com Mon Mar 9 14:13:55 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 9 Mar 2009 14:13:55 -0700 Subject: [MacRuby-devel] ruby gems just for MacRuby Message-ID: Hey Guys, I worked on a JSON lib for MacRuby which uses a dynlib. I'm thinking about making it in a gem but it would only be compatible with MacRuby. I feel like we should discuss this as a group and try to come up with a standard way of dealing with this challenge. - Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdm at cfcl.com Mon Mar 9 15:22:47 2009 From: rdm at cfcl.com (Rich Morin) Date: Mon, 9 Mar 2009 14:22:47 -0800 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: Message-ID: At 14:13 -0700 3/9/09, Matt Aimonetti wrote: > I worked on a JSON lib for MacRuby which uses a dynlib. I'm > thinking about making it in a gem but it would only be > compatible with MacRuby. I feel like we should discuss this > as a group and try to come up with a standard way of dealing > with this challenge. Please try to ensure that the solution works across multiple processor types. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From mattaimonetti at gmail.com Mon Mar 9 14:32:23 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 9 Mar 2009 14:32:23 -0700 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: Message-ID: Sorry Rich, but I personally only target intel processors. I don't think MacRuby will ever officially support non-intel machines. I know that sucks but I really don't think it's worth my time. (if you have any arguments that might convince me otherwise, I'd be happy to hear them) - Matt On Mon, Mar 9, 2009 at 3:22 PM, Rich Morin wrote: > At 14:13 -0700 3/9/09, Matt Aimonetti wrote: > > I worked on a JSON lib for MacRuby which uses a dynlib. I'm > > thinking about making it in a gem but it would only be > > compatible with MacRuby. I feel like we should discuss this > > as a group and try to come up with a standard way of dealing > > with this challenge. > > Please try to ensure that the solution works across multiple > processor types. > > -r > -- > http://www.cfcl.com/rdm Rich Morin > http://www.cfcl.com/rdm/resume rdm at cfcl.com > http://www.cfcl.com/rdm/weblog +1 650-873-7841 > > Technical editing and writing, programming, and web development > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby-noreply at macosforge.org Mon Mar 9 14:35:50 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 09 Mar 2009 21:35:50 -0000 Subject: [MacRuby-devel] [MacRuby] #229: macirb crash In-Reply-To: <060.22310c8a9298a569066129fbf0b684fa@macosforge.org> References: <060.22310c8a9298a569066129fbf0b684fa@macosforge.org> Message-ID: <069.072c261c2d66229e2bac74a5eb600cb4@macosforge.org> #229: macirb crash -------------------------------------------+-------------------------------- Reporter: francois.stephany@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Resolution: fixed Keywords: macirb 0.4 | -------------------------------------------+-------------------------------- Changes (by lsansonetti@?): * status: new => closed * resolution: => fixed Comment: Fixed in r862 - new installer uploaded. -- Ticket URL: MacRuby From chapbr at gmail.com Mon Mar 9 14:43:07 2009 From: chapbr at gmail.com (Brian Chapados) Date: Mon, 9 Mar 2009 14:43:07 -0700 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: Message-ID: Unless there is an issue in the library code, usually building for at least ppc/x86 only involves choosing from a drop down in xcode or a few compiler flags on the command line. It shouldn't take much time and is only a few extra bytes. On Mon, Mar 9, 2009 at 2:32 PM, Matt Aimonetti wrote: > Sorry Rich, but I personally only target intel processors. I don't think > MacRuby will ever officially support non-intel machines. > > I know that sucks but I really don't think it's worth my time. (if you have > any arguments that might convince me otherwise, I'd be happy to hear them) > > - Matt > > On Mon, Mar 9, 2009 at 3:22 PM, Rich Morin wrote: >> >> At 14:13 -0700 3/9/09, Matt Aimonetti wrote: >> > I worked on a JSON lib for MacRuby which uses a dynlib. ?I'm >> > thinking about making it in a gem but it would only be >> > compatible with MacRuby. ?I feel like we should discuss this >> > as a group and try to come up with a standard way of dealing >> > with this challenge. >> >> Please try to ensure that the solution works across multiple >> processor types. >> >> -r >> -- >> http://www.cfcl.com/rdm ? ? ? ? ? ?Rich Morin >> http://www.cfcl.com/rdm/resume ? ? rdm at cfcl.com >> http://www.cfcl.com/rdm/weblog ? ? +1 650-873-7841 >> >> Technical editing and writing, programming, and web development >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > From lsansonetti at apple.com Mon Mar 9 14:47:09 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Mon, 09 Mar 2009 14:47:09 -0700 Subject: [MacRuby-devel] [ANN] MacRuby 0.4 In-Reply-To: References: <1be7247c0903082352l513614ebpd5a35d7d8449d39d@mail.gmail.com> <44b555bb0903090336m3619e944p4456bf025328a78a@mail.gmail.com> Message-ID: <23EE5F84-6463-4E8B-AA64-C5B775CBE714@apple.com> Hi Rich, I forgot to mention that the installer wouldn't work on non-Intel machines. We cannot support PPC anymore due to lack of resources, however as stayed in the Rakefile warning, it should still work. The build error you're getting is about the readline extension, it has nothing to do with PPC (if you look at the tracker you should see a report and how to fix the problem). Laurent On Mar 9, 2009, at 12:05 PM, Rich Morin wrote: > On Mon, Mar 9, 2009 at 2:52 PM, Laurent Sansonetti >> You can learn more about MacRuby, and download a binary installer, >> from the website: >> >> http://ruby.macosforge.org >> >> Or about this release more specifically, on our blog: >> >> http://www.macruby.org/post/macruby-04 > > Neither the posting, the web site, nor the blog mentions the fact > that the binary installer for the new release doesn't include > support for PowerPC machines: > > $ file /usr/local/bin/macruby > /usr/local/bin/macruby: > Mach-O universal binary with 2 architectures > /usr/local/bin/macruby (for architecture i386): > Mach-O executable i386 > /usr/local/bin/macruby (for architecture x86_64): > Mach-O 64-bit executable x86_64 > > I downloaded the sources > > $ svn co http://svn.macosforge.org/repository/ruby/MacRuby/tags/0.4 \ > MacRuby-0.4 > > and attempted to follow the build instructions on > > http://www.macruby.org/trac/wiki/InstallingMacRuby > > $ cd MacRuby > MacRuby: No such file or directory. > > Sigh. > > $ ls > MacRuby-0.4 > > $ cd MacRuby-0.4 > > $ rake > (in /Local/_Private/Homes/rdm/Private/Work/MacRuby/MacRuby-0.4) > Warning: your appear to use a PowerPC machine. MacRuby's PPC support > is very basic and may be dropped in a near future. Supported > architectures are Intel 32-bit and 64-bit (i386 and x86_64). > ... > compiling readline > gcc -I. -I../../.ext/include/universal-darwin9.0 -I..//.././include > -I..//.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" -fno-common > -fno-common -pipe -O2 -g -Wall -Wno-parentheses -arch ppc -o > readline.o > -c readline.c > readline.c: In function 'filename_completion_proc_call': > readline.c:683: warning: implicit declaration of function > 'completion_matches' > readline.c:684: error: 'filename_completion_function' undeclared > (first use in this function) > readline.c:684: error: (Each undeclared identifier is reported only > once > readline.c:684: error: for each function it appears in.) > readline.c:684: warning: assignment makes pointer from integer > without a > cast > readline.c: In function 'username_completion_proc_call': > readline.c:709: error: 'username_completion_function' undeclared > (first use in this function) > readline.c:709: warning: assignment makes pointer from integer > without a > cast > make: *** [readline.o] Error 1 > rake aborted! > Command failed with status (1): [GC_DISABLE=1 ./miniruby -I./lib > -I.ext/com...] > .../MacRuby-0.4/rakefile:591 > (See full trace by running task with --trace) > > > I think this falls a bit below "very basic support". :-/ > > > I have no argument with Laurent or Apple about their current > priorities: > making MacRuby build and run on PowerPC is a burden that Laurent > does not > need at this point in the development process. Nor do I have the > chops > or time to dig into the sources and try to make the build work. > > However, it's possible that some other folks might be motivated to > follow > along behind Laurent and produce the occasional PowerPC build. Any > takers? > > > Meanwhile, I updated http://www.macruby.org/trac/wiki/InstallingMacRuby > to > reflect the new reality. The blog does not allow comments, so I was > unable > to post a caveat there. > > -r > -- > http://www.cfcl.com/rdm Rich Morin > http://www.cfcl.com/rdm/resume rdm at cfcl.com > http://www.cfcl.com/rdm/weblog +1 650-873-7841 > > Technical editing and writing, programming, and web development > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From mattaimonetti at gmail.com Mon Mar 9 14:47:18 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 9 Mar 2009 14:47:18 -0700 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: Message-ID: I did compile for ppc/x86, but it's not tested against ppc and I won't support the platform. - Matt On Mon, Mar 9, 2009 at 2:43 PM, Brian Chapados wrote: > Unless there is an issue in the library code, usually building for at > least ppc/x86 only involves choosing from a drop down in xcode or a > few compiler flags on the command line. It shouldn't take much time > and is only a few extra bytes. > > On Mon, Mar 9, 2009 at 2:32 PM, Matt Aimonetti > wrote: > > Sorry Rich, but I personally only target intel processors. I don't think > > MacRuby will ever officially support non-intel machines. > > > > I know that sucks but I really don't think it's worth my time. (if you > have > > any arguments that might convince me otherwise, I'd be happy to hear > them) > > > > - Matt > > > > On Mon, Mar 9, 2009 at 3:22 PM, Rich Morin wrote: > >> > >> At 14:13 -0700 3/9/09, Matt Aimonetti wrote: > >> > I worked on a JSON lib for MacRuby which uses a dynlib. I'm > >> > thinking about making it in a gem but it would only be > >> > compatible with MacRuby. I feel like we should discuss this > >> > as a group and try to come up with a standard way of dealing > >> > with this challenge. > >> > >> Please try to ensure that the solution works across multiple > >> processor types. > >> > >> -r > >> -- > >> http://www.cfcl.com/rdm Rich Morin > >> http://www.cfcl.com/rdm/resume rdm at cfcl.com > >> http://www.cfcl.com/rdm/weblog +1 650-873-7841 > >> > >> Technical editing and writing, programming, and web development > >> _______________________________________________ > >> MacRuby-devel mailing list > >> MacRuby-devel at lists.macosforge.org > >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > > > > _______________________________________________ > > MacRuby-devel mailing list > > MacRuby-devel at lists.macosforge.org > > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eloy.de.enige at gmail.com Mon Mar 9 14:58:59 2009 From: eloy.de.enige at gmail.com (Eloy Duran) Date: Mon, 9 Mar 2009 22:58:59 +0100 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: Message-ID: <2A0BA69A-9671-471E-B885-3EDA22B515AC@gmail.com> Hey Matt, I think a gem is fine. You can always choose to vendor it when you deploy. (Something which Rucola for instance does.) Taking on the responsibility of a dependency framework is a bit too far away from where the current focus of MacRuby should lie imho. Eloy On 9 mrt 2009, at 22:13, Matt Aimonetti wrote: > Hey Guys, > > I worked on a JSON lib for MacRuby which uses a dynlib. I'm > thinking about making it in a gem but it would only be compatible > with MacRuby. I feel like we should discuss this as a group and try > to come up with a standard way of dealing with this challenge. > > - Matt > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From mattaimonetti at gmail.com Mon Mar 9 15:06:16 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 9 Mar 2009 15:06:16 -0700 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: <2A0BA69A-9671-471E-B885-3EDA22B515AC@gmail.com> References: <2A0BA69A-9671-471E-B885-3EDA22B515AC@gmail.com> Message-ID: I was not thinking about a dependency framework, just a clean way to mark gems are MacRuby only. RubyGems already has something builtin: spec.platform = Gem::Platform::Win32 I'm just not sure what to use for MacRuby and how to deal with this issue cleanly. - Matt On Mon, Mar 9, 2009 at 2:58 PM, Eloy Duran wrote: > Hey Matt, > > I think a gem is fine. You can always choose to vendor it when you deploy. > (Something which Rucola for instance does.) > > Taking on the responsibility of a dependency framework is a bit too far > away from where the current focus of MacRuby should lie imho. > > Eloy > > > On 9 mrt 2009, at 22:13, Matt Aimonetti wrote: > > Hey Guys, >> >> I worked on a JSON lib for MacRuby which uses a dynlib. I'm thinking >> about making it in a gem but it would only be compatible with MacRuby. I >> feel like we should discuss this as a group and try to come up with a >> standard way of dealing with this challenge. >> >> - Matt >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattaimonetti at gmail.com Mon Mar 9 15:13:27 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 9 Mar 2009 15:13:27 -0700 Subject: [MacRuby-devel] do not upgrade CouchDB until I push a new release of CouchRest Message-ID: Today a new syntax change was introduced and if you upgrade couch, it will break the current apps. I have a patch ready and I'll push it tonight or so. You will need to upgrade couch after I do that and bundle the gems, but I'll let you know. - Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattaimonetti at gmail.com Mon Mar 9 15:29:54 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 9 Mar 2009 15:29:54 -0700 Subject: [MacRuby-devel] do not upgrade CouchDB until I push a new release of CouchRest In-Reply-To: References: Message-ID: oops wrong email address... sorry guys :( - Matt On Mon, Mar 9, 2009 at 3:13 PM, Matt Aimonetti wrote: > Today a new syntax change was introduced and if you upgrade couch, it will > break the current apps. I have a patch ready and I'll push it tonight or so. > You will need to upgrade couch after I do that and bundle the gems, but > I'll let you know. > > - Matt > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby-noreply at macosforge.org Mon Mar 9 15:41:34 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 09 Mar 2009 22:41:34 -0000 Subject: [MacRuby-devel] [MacRuby] #230: integrer conversion bug Message-ID: <054.c453a18687d83403ec616cdcf16cd480@macosforge.org> #230: integrer conversion bug -------------------------------------+-------------------------------------- Reporter: mattaimonetti@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -------------------------------------+-------------------------------------- macirb 0.4 {{{ $ macirb >> require 'rubygems' => false >> Gem.platforms RangeError: integer 34365193920 too big to convert to `int' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems/platform.rb:98:in `%' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems/platform.rb:98:in `inspect' from /usr/local/bin/macirb:12:in `
' }}} Ruby 1.9 irb: {{{ $ irb1.9 irb(main):001:0> require 'rubygems' => false irb(main):002:0> Gem.platforms => ["ruby", #] }}} -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Mon Mar 9 16:30:58 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 09 Mar 2009 23:30:58 -0000 Subject: [MacRuby-devel] [MacRuby] #228: Crash in my NSOutlineView data source In-Reply-To: <049.1b74afa21c8d318fbd0b1e4048c6c730@macosforge.org> References: <049.1b74afa21c8d318fbd0b1e4048c6c730@macosforge.org> Message-ID: <058.fa244d78d7b8f388c804b5abcada1c98@macosforge.org> #228: Crash in my NSOutlineView data source --------------------------------+------------------------------------------- Reporter: cyberfox@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: major | Milestone: Component: MacRuby | Resolution: invalid Keywords: crash | --------------------------------+------------------------------------------- Changes (by lsansonetti@?): * status: new => closed * resolution: => invalid * milestone: MacRuby 1.0 => Comment: This isn't a bug in MacRuby but a bug in your code. You must always return unique objects from the data source methods. In your outlineView:child:ofItem: implementation you are returning new Pair objects, this will very likely crash the outline view because it does not retain the objects. http://developer.apple.com/documentation/Cocoa/Conceptual/OutlineView/Articles/UsingOutlineDataSource.html#//apple_ref/doc/uid/20000725-140686 I recommend to cache the Pair objects and always return the same instances. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Mon Mar 9 16:42:33 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 09 Mar 2009 23:42:33 -0000 Subject: [MacRuby-devel] [MacRuby] #228: Crash in my NSOutlineView data source In-Reply-To: <049.1b74afa21c8d318fbd0b1e4048c6c730@macosforge.org> References: <049.1b74afa21c8d318fbd0b1e4048c6c730@macosforge.org> Message-ID: <058.4907dde71890c6086b13795939b61433@macosforge.org> #228: Crash in my NSOutlineView data source --------------------------------+------------------------------------------- Reporter: cyberfox@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: major | Milestone: Component: MacRuby | Resolution: invalid Keywords: crash | --------------------------------+------------------------------------------- Comment(by cyberfox@?): Greetings, Ah; thank you! That's what I needed to know. I figured there was something deeper that I was missing, but being new to Cocoa, I didn't even know what to look for. The key line appears to be ''The data source is in turn responsible for retaining all of the objects it provides to an outline view, and updating the outline view when there?s a change to the model. It is therefore not safe to release the root item?or any children?until you?re no longer displaying it in the outline view.'' Presumably they're being released by the GC in between accesses. Thanks very much for the pointer! -- Morgan Schweers -- Ticket URL: MacRuby From eloy.de.enige at gmail.com Mon Mar 9 16:45:24 2009 From: eloy.de.enige at gmail.com (Eloy Duran) Date: Tue, 10 Mar 2009 00:45:24 +0100 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: <2A0BA69A-9671-471E-B885-3EDA22B515AC@gmail.com> Message-ID: Ah gotcha. What we could maybe do is add these kind of gems to the MacRuby user that we will create on GitHub in the near future. The gem name would then be prefixed with MacRuby, eg: MacRuby-JSON. It's of course not a real solution like a platform, but it's pretty self-explanatory imo. Eloy On 9 mrt 2009, at 23:06, Matt Aimonetti wrote: > I was not thinking about a dependency framework, just a clean way to > mark gems are MacRuby only. RubyGems already has something builtin: > > spec.platform = Gem::Platform::Win32 > > I'm just not sure what to use for MacRuby and how to deal with this > issue cleanly. > > - Matt > > On Mon, Mar 9, 2009 at 2:58 PM, Eloy Duran > wrote: > Hey Matt, > > I think a gem is fine. You can always choose to vendor it when you > deploy. (Something which Rucola for instance does.) > > Taking on the responsibility of a dependency framework is a bit too > far away from where the current focus of MacRuby should lie imho. > > Eloy > > > On 9 mrt 2009, at 22:13, Matt Aimonetti wrote: > > Hey Guys, > > I worked on a JSON lib for MacRuby which uses a dynlib. I'm > thinking about making it in a gem but it would only be compatible > with MacRuby. I feel like we should discuss this as a group and try > to come up with a standard way of dealing with this challenge. > > - Matt > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From drnicwilliams at gmail.com Mon Mar 9 17:15:45 2009 From: drnicwilliams at gmail.com (Dr Nic Williams) Date: Tue, 10 Mar 2009 08:15:45 +0800 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: Message-ID: <44b555bb0903091715w4e43af91l32a17ae4183faa64@mail.gmail.com> On Tue, Mar 10, 2009 at 5:32 AM, Matt Aimonetti wrote: > Sorry Rich, but I personally only target intel processors. I don't think > MacRuby will ever officially support non-intel machines. You never know when Steve Jobs will get up on stage and excitedly tell the Faithful that the next generation Macs will be on XYZ processor (because he got a better profit margin from them). Processor type isn't sacred afaik. Nic -- Dr Nic Williams iPhone and Rails consultants - http://mocra.com Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com * Surf Report for iPhone - http://mocra.com/projects/surfreport/ * From mattaimonetti at gmail.com Mon Mar 9 17:43:02 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 9 Mar 2009 17:43:02 -0700 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: <44b555bb0903091715w4e43af91l32a17ae4183faa64@mail.gmail.com> References: <44b555bb0903091715w4e43af91l32a17ae4183faa64@mail.gmail.com> Message-ID: Nic, Any suggestions to deal with macruby only gems? I don't think macruby can be considered a platform so any suggestions? - Matt On Mon, Mar 9, 2009 at 5:15 PM, Dr Nic Williams wrote: > On Tue, Mar 10, 2009 at 5:32 AM, Matt Aimonetti > wrote: > > Sorry Rich, but I personally only target intel processors. I don't think > > MacRuby will ever officially support non-intel machines. > > You never know when Steve Jobs will get up on stage and excitedly tell > the Faithful that the next generation Macs will be on XYZ processor > (because he got a better profit margin from them). > > Processor type isn't sacred afaik. > > Nic > > -- > Dr Nic Williams > iPhone and Rails consultants - http://mocra.com > Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com > * Surf Report for iPhone - http://mocra.com/projects/surfreport/ * > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drnicwilliams at gmail.com Mon Mar 9 17:56:08 2009 From: drnicwilliams at gmail.com (Dr Nic Williams) Date: Tue, 10 Mar 2009 08:56:08 +0800 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: <44b555bb0903091715w4e43af91l32a17ae4183faa64@mail.gmail.com> Message-ID: <44b555bb0903091756n761450d0rf59e9aa4539b29e0@mail.gmail.com> You can give each gem a platform scope. Windows-only gems are the most common incarnation of this. There is an OS X-only gem "ghost" (http://github.com/bjeanes/ghost/tree/master): ~ : sudo gem install ghost Password: Successfully installed ghost-0.1.2-universal-darwin-9 Mongrel is a great example of distributing gems for different platforms (unix, windows, java - see http://rubyforge.org/frs/?group_id=1306) Look inside their gemspec/hoe config for how they do this. MacRuby's gem command could be hard-wired to only pull down macruby gems of some sort. This is all I know without doing more investigation. Cheers Nic On Tue, Mar 10, 2009 at 8:43 AM, Matt Aimonetti wrote: > Nic, > > ?Any suggestions to deal with macruby only gems? I don't think macruby can > be considered a platform so any suggestions? > > - Matt > > On Mon, Mar 9, 2009 at 5:15 PM, Dr Nic Williams > wrote: >> >> On Tue, Mar 10, 2009 at 5:32 AM, Matt Aimonetti >> wrote: >> > Sorry Rich, but I personally only target intel processors. I don't think >> > MacRuby will ever officially support non-intel machines. >> >> You never know when Steve Jobs will get up on stage and excitedly tell >> the Faithful that the next generation Macs will be on XYZ processor >> (because he got a better profit margin from them). >> >> Processor type isn't sacred afaik. >> >> Nic >> >> -- >> Dr Nic Williams >> iPhone and Rails consultants - http://mocra.com >> Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com >> * Surf Report for iPhone - http://mocra.com/projects/surfreport/ * >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > -- Dr Nic Williams iPhone and Rails consultants - http://mocra.com Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com * Surf Report for iPhone - http://mocra.com/projects/surfreport/ * From chapbr at gmail.com Mon Mar 9 17:56:16 2009 From: chapbr at gmail.com (Brian Chapados) Date: Mon, 9 Mar 2009 17:56:16 -0700 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: <44b555bb0903091715w4e43af91l32a17ae4183faa64@mail.gmail.com> Message-ID: If we just need a way to check that we are on MacRuby before loading, we could check that: Object.name == "NSObject" Brian On Mon, Mar 9, 2009 at 5:43 PM, Matt Aimonetti wrote: > Nic, > > ?Any suggestions to deal with macruby only gems? I don't think macruby can > be considered a platform so any suggestions? > > - Matt > > On Mon, Mar 9, 2009 at 5:15 PM, Dr Nic Williams > wrote: >> >> On Tue, Mar 10, 2009 at 5:32 AM, Matt Aimonetti >> wrote: >> > Sorry Rich, but I personally only target intel processors. I don't think >> > MacRuby will ever officially support non-intel machines. >> >> You never know when Steve Jobs will get up on stage and excitedly tell >> the Faithful that the next generation Macs will be on XYZ processor >> (because he got a better profit margin from them). >> >> Processor type isn't sacred afaik. >> >> Nic >> >> -- >> Dr Nic Williams >> iPhone and Rails consultants - http://mocra.com >> Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com >> * Surf Report for iPhone - http://mocra.com/projects/surfreport/ * >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > From mattaimonetti at gmail.com Mon Mar 9 18:01:54 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 9 Mar 2009 18:01:54 -0700 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: <44b555bb0903091715w4e43af91l32a17ae4183faa64@mail.gmail.com> Message-ID: I actually meant the opposite, make sure people don't try to load macruby only gems to use with YARV or JRuby. I guess it doesn't matter that much, and I can always use your suggested trick to fail loading the gem if someone isn't on macruby. Thanks, - Matt On Mon, Mar 9, 2009 at 5:56 PM, Brian Chapados wrote: > If we just need a way to check that we are on MacRuby before loading, > we could check that: > > Object.name == "NSObject" > > Brian > > On Mon, Mar 9, 2009 at 5:43 PM, Matt Aimonetti > wrote: > > Nic, > > > > Any suggestions to deal with macruby only gems? I don't think macruby > can > > be considered a platform so any suggestions? > > > > - Matt > > > > On Mon, Mar 9, 2009 at 5:15 PM, Dr Nic Williams > > > wrote: > >> > >> On Tue, Mar 10, 2009 at 5:32 AM, Matt Aimonetti < > mattaimonetti at gmail.com> > >> wrote: > >> > Sorry Rich, but I personally only target intel processors. I don't > think > >> > MacRuby will ever officially support non-intel machines. > >> > >> You never know when Steve Jobs will get up on stage and excitedly tell > >> the Faithful that the next generation Macs will be on XYZ processor > >> (because he got a better profit margin from them). > >> > >> Processor type isn't sacred afaik. > >> > >> Nic > >> > >> -- > >> Dr Nic Williams > >> iPhone and Rails consultants - http://mocra.com > >> Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com > >> * Surf Report for iPhone - http://mocra.com/projects/surfreport/ * > >> _______________________________________________ > >> MacRuby-devel mailing list > >> MacRuby-devel at lists.macosforge.org > >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > > > > _______________________________________________ > > MacRuby-devel mailing list > > MacRuby-devel at lists.macosforge.org > > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdm at cfcl.com Mon Mar 9 19:05:05 2009 From: rdm at cfcl.com (Rich Morin) Date: Mon, 9 Mar 2009 18:05:05 -0800 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: <44b555bb0903091715w4e43af91l32a17ae4183faa64@mail.gmail.com> Message-ID: Matt Aimonetti wrote: > Sorry Rich, but I personally only target intel processors. > I don't think MacRuby will ever officially support non-intel > machines. Since when does the Open Source community take its direction from "official" vendor decisions? As long as a free, working code base exists for a processor and OS, I'm happy to use it. Nor, indeed, am I asking any particular developer to target a given processor. I simply want any packaging standard we adopt to be flexible enough to handle multiple processors. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From rdm at cfcl.com Mon Mar 9 19:23:11 2009 From: rdm at cfcl.com (Rich Morin) Date: Mon, 9 Mar 2009 18:23:11 -0800 Subject: [MacRuby-devel] [ANN] MacRuby 0.4 In-Reply-To: <63e729760903091358p6e547db6i5c914e061869d3d0@mail.gmail.com> References: <1be7247c0903082352l513614ebpd5a35d7d8449d39d@mail.gmail.com> <44b555bb0903090336m3619e944p4456bf025328a78a@mail.gmail.com> <63e729760903091358p6e547db6i5c914e061869d3d0@mail.gmail.com> Message-ID: At 21:58 +0100 3/9/09, D?m?t?r Guly?s wrote: > I've been successfully building the MacRuby framework as a > 32bit PPC/i386 UB, from trunk, with following command: > RC_ARCHS="ppc i386" rake macruby > > For some reason, the order in which the archs are specified > 32bit am not sure how well it actually runs, as I don't have > any reports from PPC users for my app, and it doesn't work in > Rosetta. Thanks! I tried the following on my Power Mac G5, getting the same error output: % rake clean ... % setenv RC_ARCHS ppc % rake Finally, I broke down and tried your exact recipe: % bash bash-3.2$ RC_ARCHS="ppc i386" rake macruby This ran without complaints (!), so I tried: % sudo rake install which also ran without complaints. I then ran: % cd % rehash % which macruby % macruby -v MacRuby version 0.4 (ruby 1.9.1) [universal-darwin9.0, ppc] % macruby -e "p :hello" :hello This indicates some level of functionality, so I have modified http://www.macruby.org/trac/wiki/InstallingMacRuby accordingly. I then ran: % rake test and got: rake test (in /Local/_Private/Homes/rdm/Private/Work/MacRuby/MacRuby-0.4) getting archs from RC_ARCHS! Warning: your appear to use a PowerPC machine. MacRuby's PPC support is very basic and may be dropped in a near future. Supported architectures are Intel 32-bit and 64-bit (i386 and x86_64). ./miniruby rubytest.rb ... sample/test.rb:system ... lib/hotcocoa/object_ext.rb:23: syntax error, unexpected keyword_end, expecting $end lib/hotcocoa/object_ext.rb F ... sample/test.rb:gc ... not ok system 9 -- ./sample/test.rb:1888:in `
' not ok pack 2 -- ./sample/test.rb:1974:in `
' not ok/test: 856 failed 2 test failed rake aborted! Command failed with status (1): [./miniruby rubytest.rb...] .../MacRuby-0.4/rakefile:701 (See full trace by running task with --trace) Feel free to contact me offline if there are any other tests I should run, etc. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From drnicwilliams at gmail.com Mon Mar 9 18:31:15 2009 From: drnicwilliams at gmail.com (Dr Nic Williams) Date: Tue, 10 Mar 2009 09:31:15 +0800 Subject: [MacRuby-devel] ruby gems just for MacRuby In-Reply-To: References: <44b555bb0903091715w4e43af91l32a17ae4183faa64@mail.gmail.com> Message-ID: <44b555bb0903091831k3919e3bese936282d207095cd@mail.gmail.com> If the gem name has a specific platform/arch then it won't be visible to alternate archicture/platforms afaik. On Tue, Mar 10, 2009 at 10:05 AM, Rich Morin wrote: > Matt Aimonetti wrote: >> Sorry Rich, but I personally only target intel processors. >> I don't think MacRuby will ever officially support non-intel >> machines. > > Since when does the Open Source community take its direction > from "official" vendor decisions? ?As long as a free, working > code base exists for a processor and OS, I'm happy to use it. > > Nor, indeed, am I asking any particular developer to target > a given processor. ?I simply want any packaging standard we > adopt to be flexible enough to handle multiple processors. > > -r > -- > http://www.cfcl.com/rdm ? ? ? ? ? ?Rich Morin > http://www.cfcl.com/rdm/resume ? ? rdm at cfcl.com > http://www.cfcl.com/rdm/weblog ? ? +1 650-873-7841 > > Technical editing and writing, programming, and web development > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -- Dr Nic Williams iPhone and Rails consultants - http://mocra.com Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com * Surf Report for iPhone - http://mocra.com/projects/surfreport/ * From cohen.jeff at gmail.com Mon Mar 9 21:10:54 2009 From: cohen.jeff at gmail.com (Jeff Cohen) Date: Mon, 9 Mar 2009 23:10:54 -0500 Subject: [MacRuby-devel] [ANN] MacRuby 0.4 In-Reply-To: <1be7247c0903082352l513614ebpd5a35d7d8449d39d@mail.gmail.com> References: <1be7247c0903082352l513614ebpd5a35d7d8449d39d@mail.gmail.com> Message-ID: <3d7e01550903092110o45baddbep7c3473493b265a15@mail.gmail.com> Great news! Any chance of an updated HotCocoa tutorial or "getting started" guide (other than what's been on the wiki)? Thanks, Jeff On Mon, Mar 9, 2009 at 1:52 AM, Laurent Sansonetti < laurent.sansonetti at gmail.com> wrote: > Hi, > > After several months of development and some slight delays, MacRuby > 0.4 is now available. Get it here while it's still hot! > > MacRuby is a version of Ruby 1.9, ported to run directly on top of Mac > OS X core technologies such as the Objective-C common runtime and > garbage collector, and the CoreFoundation framework. While still a > work in progress, it is the goal of MacRuby to enable the creation of > full-fledged Mac OS X applications which do not sacrifice performance > in order to enjoy the benefits of using Ruby. > > You can learn more about MacRuby, and download a binary installer, > from the website: > > http://ruby.macosforge.org > > Or about this release more specifically, on our blog: > > http://www.macruby.org/post/macruby-04 > > Enjoy, > > Laurent > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattaimonetti at gmail.com Tue Mar 10 18:51:10 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Tue, 10 Mar 2009 18:51:10 -0700 Subject: [MacRuby-devel] MacRuby is now on Twitter Message-ID: If you want to hear the latest MacRuby news, make sure to follow @macruby on twitter: http://twitter.com/macruby On top of sharing with you the latest news, @MacRuby answers your (simple) MacRuby/Hotcocoa questions via twitter. Questions in English, French, Spanish, Japanese will be addressed in their respective languages, Portuguese and Italian questions will be addressed in English :) If you wrote a blog post about MacRuby, a tutorial, released a new application or have something you want to share with the community, don't hesitate to let us know. - Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby-noreply at macosforge.org Wed Mar 11 15:48:50 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Wed, 11 Mar 2009 22:48:50 -0000 Subject: [MacRuby-devel] [MacRuby] #231: [0.4] Can't install hoe Message-ID: <050.6b6a8ee8213a3cc3cfb03e64a9423998@macosforge.org> #231: [0.4] Can't install hoe ---------------------------------+------------------------------------------ Reporter: roberto@? | Owner: lsansonetti@? Type: defect | Status: new Priority: critical | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: hoe, gem ---------------------------------+------------------------------------------ MacRuby 0.4 just installed from the posted package. 10.5.6, macports 1.7. gcc 4.0/4.2 from XCode. {{{ 503 [23:41] roberto at sidhe:HG/old-crypto> sudo macgem install rubyforge hoe Successfully installed rubyforge-1.0.3 ERROR: Error installing hoe: hoe requires (, runtime) 1 gem installed Installing ri documentation for rubyforge-1.0.3... Error reading the class cache; recreating the class cache! Updating class cache with 47 classes... Installing RDoc documentation for rubyforge-1.0.3... }}} I can (and did) install hoe on plain ruby 1.9.1 (from trunk). -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Thu Mar 12 01:02:03 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Thu, 12 Mar 2009 08:02:03 -0000 Subject: [MacRuby-devel] [MacRuby] #154: Odd behavior with NSTableView In-Reply-To: <054.fbe1cc273e0b75a52cdde1c245316cbb@macosforge.org> References: <054.fbe1cc273e0b75a52cdde1c245316cbb@macosforge.org> Message-ID: <063.0efe74056fc14f12e1fb4131a5f1a2bd@macosforge.org> #154: Odd behavior with NSTableView -------------------------------------+-------------------------------------- Reporter: parzival@? | Owner: lsansonetti@? Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: -------------------------------------+-------------------------------------- Comment(by parzival@?): Replying to [ticket:154 parzival@?]: This can be closed now. Periodically I've opened up my project & checked on it. I don't know exactly when it started working, but it does as of 893. -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Thu Mar 12 01:42:18 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Thu, 12 Mar 2009 08:42:18 -0000 Subject: [MacRuby-devel] [MacRuby] #154: Odd behavior with NSTableView In-Reply-To: <054.fbe1cc273e0b75a52cdde1c245316cbb@macosforge.org> References: <054.fbe1cc273e0b75a52cdde1c245316cbb@macosforge.org> Message-ID: <063.cd74d42b5793255263c08f41bd94c0d8@macosforge.org> #154: Odd behavior with NSTableView -------------------------------------+-------------------------------------- Reporter: parzival@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: minor | Milestone: Component: MacRuby | Resolution: fixed Keywords: | -------------------------------------+-------------------------------------- Changes (by eloy.de.enige@?): * status: new => closed * resolution: => fixed Comment: Thanks for the update. -- Ticket URL: MacRuby From itsme213 at hotmail.com Fri Mar 13 20:46:10 2009 From: itsme213 at hotmail.com (Sophie (itsme213)) Date: Fri, 13 Mar 2009 22:46:10 -0500 Subject: [MacRuby-devel] OT: seeking advice on GIT client for OSX Message-ID: Google was somewhat inconclusive, so I'm seeking recommendations here. Apologies if inappropriate, but I'd guess folks here would know. What GIT OSX client would you recommend, comparable to Cornerstone (osx svn client) or Tortoise-SVN (windows SVN client) ? Thanks! From mattaimonetti at gmail.com Fri Mar 13 20:48:21 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Fri, 13 Mar 2009 20:48:21 -0700 Subject: [MacRuby-devel] OT: seeking advice on GIT client for OSX In-Reply-To: References: Message-ID: I personally use the command line and gitx http://gitx.frim.nl/ - Matt On Fri, Mar 13, 2009 at 8:46 PM, Sophie (itsme213) wrote: > Google was somewhat inconclusive, so I'm seeking recommendations here. > Apologies if inappropriate, but I'd guess folks here would know. > > What GIT OSX client would you recommend, comparable to Cornerstone (osx svn > client) or Tortoise-SVN (windows SVN client) ? > > Thanks! > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cohen.jeff at gmail.com Sat Mar 14 21:09:56 2009 From: cohen.jeff at gmail.com (Jeff Cohen) Date: Sat, 14 Mar 2009 23:09:56 -0500 Subject: [MacRuby-devel] How do I handle file drop events in HotCocoa? Message-ID: <3d7e01550903142109n7262046dkfe7006374623eb5a@mail.gmail.com> Hello, I'm just getting started with MacRuby and HotCocoa (was a longtime .NET developer, and wasn't interested in learning Cocoa until MacRuby came along). I have a simple HotCocoa app with just a table view, and I'd like the user to be able to drop a filename from the Finder onto the table view (or anywhere in my app). I can call registerForDraggedTypes() on my table view object successfully. But I'm not sure how to have events delegated to my Application class (or if that's even possible). Looking at the hotcocoa source for wrapping NSView (view.rb), I don't see delegate mappings for the draggingEntered or performDragOperation events. I think I need to do something like the mapping code does and write code like this: delegating "draggingEntered", :to => :dragging_entered but I don't know where I can or should do that, or if I'm even on the right track. Any hint of where I should get started would be appreciated. Thanks! Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: From fero.ziba at googlemail.com Sun Mar 15 06:08:33 2009 From: fero.ziba at googlemail.com (Ferhat Ziba) Date: Sun, 15 Mar 2009 14:08:33 +0100 Subject: [MacRuby-devel] Introduce myself and some questions Message-ID: <34b73b230903150608t7904fd0bl4427f31f8ee0f7dc@mail.gmail.com> Hey guys, My name is Ferhat Ziba, I am student in Hamburg and study computer science. I saw your project and it's awesome. I like the Idea developing os x apps in ruby as first citizen programming language. After I get my fingers dirty with playing arround the source code, I have some questions : 1. Where are the path to the mapping files from hotcocoa ? I found it in the repository but not on my local machine. (I use the prebuild binary package on the project site for installing macruby). I like to extend some functionality for my (experimental) opensource project. 2. When I write some mapping files ? Where should I send it ? I got some other questions, like how licence checking for comercial apps, but I think for this questions the project is to much in early state. Macruby and hotcocoa are great Stuff. Ferhat Ziba -------------- next part -------------- An HTML attachment was scrubbed... URL: From frisco at laszlomail.com Mon Mar 16 05:58:46 2009 From: frisco at laszlomail.com (Frisco Del Rosario) Date: Mon, 16 Mar 2009 05:58:46 -0700 (PDT) Subject: [MacRuby-devel] Starting a New Project tutorial Message-ID: <2058754109.26261.1237208326980.JavaMail.frisco@localhost> I'm following the steps to Starting a New Project at http://www.macruby.org/trac/wiki/MacRubyTutorial, which says: First, let's instantiate our class. In the Library pane, drag-and-drop an NSObject item to the main window. Then, make sure you selected it, and open the inspector pane (click on Window, then Document Info). In the Object Identity tab, select MyController as the object class. But after dragging and dropping an NSObject into the MainMenu.nib window, Document Info shows nothing in the Object ID panel. OS 10.5.6 Xcode 3.1.2 ruby 1.9.1p0 MacRuby 0.4 From johnmacshea at gmail.com Mon Mar 16 06:17:46 2009 From: johnmacshea at gmail.com (John Shea) Date: Mon, 16 Mar 2009 14:17:46 +0100 Subject: [MacRuby-devel] Starting a New Project tutorial In-Reply-To: <2058754109.26261.1237208326980.JavaMail.frisco@localhost> References: <2058754109.26261.1237208326980.JavaMail.frisco@localhost> Message-ID: I am not sure I understand fully what you have done .. Make sure that you have something selected in the MainMenu.nib - otherwise the every panel in the inspector will be blank. But this is what should happen: - with the blue Object selected, and the Inspector open - if you click in the object identity panel - the class will be a grey NSObject - click in this text field and the class name will disappear - start typing in the name of your class - and it should appear - press return to make it stick. If that does not help perhaps you could send the list a screen shot? Cheers, J On Mar 16, 2009, at 13:58 , Frisco Del Rosario wrote: > I'm following the steps to Starting a New Project at http://www.macruby.org/trac/wiki/MacRubyTutorial > , which says: > > First, let's instantiate our class. In the Library pane, drag-and- > drop an NSObject item to the main window. Then, make sure you > selected it, and open the inspector pane (click on Window, then > Document Info). In the Object Identity tab, select MyController as > the object class. > > But after dragging and dropping an NSObject into the MainMenu.nib > window, Document Info shows nothing in the Object ID panel. > > OS 10.5.6 > Xcode 3.1.2 > ruby 1.9.1p0 > MacRuby 0.4 > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From frisco at laszlomail.com Mon Mar 16 07:16:08 2009 From: frisco at laszlomail.com (Frisco Del Rosario) Date: Mon, 16 Mar 2009 07:16:08 -0700 (PDT) Subject: [MacRuby-devel] Starting a New Project tutorial Message-ID: <1614791680.26343.1237212968364.JavaMail.frisco@localhost> On Mon, Mar 16, 2009 at 7:02 AM , macruby-devel-request at lists.macosforge.org wrote: > and open the inspector pane (click on Window, then Document Info). In > the Object Identity tab, select MyController as the object class. I see where I screwed up. I went to Document Info from the Window menu, not Tools -> Inspector -> Class Identity, and so on. Thanks, John Shea. From laurent.sansonetti at gmail.com Mon Mar 16 10:49:55 2009 From: laurent.sansonetti at gmail.com (Laurent Sansonetti) Date: Mon, 16 Mar 2009 10:49:55 -0700 Subject: [MacRuby-devel] Starting a New Project tutorial In-Reply-To: <1614791680.26343.1237212968364.JavaMail.frisco@localhost> References: <1614791680.26343.1237212968364.JavaMail.frisco@localhost> Message-ID: <1be7247c0903161049r12c94f3araa61149483681c75@mail.gmail.com> Hi Frisco, I would recommend to follow this tutorial instead, which should be simpler (since it has pictures :-)). http://developer.apple.com/mac/articles/scriptingautomation/cocoaappswithmacruby.html Laurent On Mon, Mar 16, 2009 at 7:16 AM, Frisco Del Rosario wrote: > > > > On Mon, Mar 16, 2009 at 7:02 AM , macruby-devel-request at lists.macosforge.org > wrote: > >> and open the inspector pane (click on Window, then Document Info). In the >> Object Identity tab, select MyController as the object class. > > I see where I screwed up. I went to Document Info from the Window menu, not > Tools -> Inspector -> Class Identity, and so on. > > Thanks, John Shea. > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > From lsansonetti at apple.com Mon Mar 16 10:58:11 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Mon, 16 Mar 2009 10:58:11 -0700 Subject: [MacRuby-devel] Introduce myself and some questions In-Reply-To: <34b73b230903150608t7904fd0bl4427f31f8ee0f7dc@mail.gmail.com> References: <34b73b230903150608t7904fd0bl4427f31f8ee0f7dc@mail.gmail.com> Message-ID: <0E13100A-C903-46BA-AB88-1F6017AD1206@apple.com> Hi Ferhat, (Sorry for the late reply.) On Mar 15, 2009, at 6:08 AM, Ferhat Ziba wrote: > Hey guys, > > My name is Ferhat Ziba, I am student in Hamburg and study computer > science. I saw your project and it's awesome. I like the Idea > developing os x apps in ruby as first citizen programming language. Thank you :) > After I get my fingers dirty with playing arround the source code, I > have some questions : > > 1. Where are the path to the mapping files from hotcocoa ? I found > it in the repository but not on my local machine. (I use the > prebuild binary package on the project site for installing macruby). > I like to extend some functionality for my (experimental) opensource > project. The mapping files are in the hotcocoa/mappings directory in the MacRuby's standard library. If you are willing to extend RubyCocoa I would recommend to install it from the sources, it will be easier for you to test / contribute your changes back. > 2. When I write some mapping files ? Where should I send it ? You can send them here or create a new ticket on the Trac and attach them. Regards, Laurent From lsansonetti at apple.com Mon Mar 16 11:02:50 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Mon, 16 Mar 2009 11:02:50 -0700 Subject: [MacRuby-devel] How do I handle file drop events in HotCocoa? In-Reply-To: <3d7e01550903142109n7262046dkfe7006374623eb5a@mail.gmail.com> References: <3d7e01550903142109n7262046dkfe7006374623eb5a@mail.gmail.com> Message-ID: <5C15AB62-F730-484A-881A-8721EAE78E57@apple.com> Hi Jeff, (Sorry for the late reply.) On Mar 14, 2009, at 9:09 PM, Jeff Cohen wrote: > Hello, > > I'm just getting started with MacRuby and HotCocoa (was a > longtime .NET developer, and wasn't interested in learning Cocoa > until MacRuby came along). I have a simple HotCocoa app with just a > table view, and I'd like the user to be able to drop a filename from > the Finder onto the table view (or anywhere in my app). I can call > registerForDraggedTypes() on my table view object successfully. But > I'm not sure how to have events delegated to my Application class > (or if that's even possible). > > Looking at the hotcocoa source for wrapping NSView (view.rb), I > don't see delegate mappings for the draggingEntered or > performDragOperation events. I think I need to do something like > the mapping code does and write code like this: > > delegating "draggingEntered", :to => :dragging_entered > > but I don't know where I can or should do that, or if I'm even on > the right track. > > Any hint of where I should get started would be appreciated. I don't think HotCocoa exposes drag and drop facilities yet. In general drag and drop in Cocoa is non trivial to do (esp. if you want to integrate it with complex views such as NSTableViews). The following article describes how to implement drag and drop in Cocoa: http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html It even has a special section dedicated to NSTableViews. You should be able to do everything described in this article using "pure" MacRuby code but if you want to use some kind of syntax sugar via HotCocoa I'm afraid you will have to wait until someone implements them. HTH, Laurent From mattaimonetti at gmail.com Mon Mar 16 11:06:23 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 16 Mar 2009 11:06:23 -0700 Subject: [MacRuby-devel] Introduce myself and some questions In-Reply-To: <0E13100A-C903-46BA-AB88-1F6017AD1206@apple.com> References: <34b73b230903150608t7904fd0bl4427f31f8ee0f7dc@mail.gmail.com> <0E13100A-C903-46BA-AB88-1F6017AD1206@apple.com> Message-ID: <20fefa50903161106y5efc702cxc23e8173938b01c7@mail.gmail.com> > > The mapping files are in the hotcocoa/mappings directory in the MacRuby's > standard library. If you are willing to extend RubyCocoa I would recommend > to install it from the sources, it will be easier for you to test / > contribute your changes back. > And by RubyCocoa, Laurent really meant HotCocoa ;) - Matt On Mon, Mar 16, 2009 at 10:58 AM, Laurent Sansonetti wrote: > Hi Ferhat, > > (Sorry for the late reply.) > > On Mar 15, 2009, at 6:08 AM, Ferhat Ziba wrote: > > Hey guys, >> >> My name is Ferhat Ziba, I am student in Hamburg and study computer >> science. I saw your project and it's awesome. I like the Idea developing os >> x apps in ruby as first citizen programming language. >> > > Thank you :) > > After I get my fingers dirty with playing arround the source code, I have >> some questions : >> >> 1. Where are the path to the mapping files from hotcocoa ? I found it in >> the repository but not on my local machine. (I use the prebuild binary >> package on the project site for installing macruby). I like to extend some >> functionality for my (experimental) opensource project. >> > > The mapping files are in the hotcocoa/mappings directory in the MacRuby's > standard library. If you are willing to extend RubyCocoa I would recommend > to install it from the sources, it will be easier for you to test / > contribute your changes back. > > 2. When I write some mapping files ? Where should I send it ? >> > > You can send them here or create a new ticket on the Trac and attach them. > > Regards, > Laurent > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.wirtel at gmail.com Mon Mar 16 12:03:34 2009 From: stephane.wirtel at gmail.com (=?ISO-8859-1?Q?St=E9phane_Wirtel?=) Date: Mon, 16 Mar 2009 20:03:34 +0100 Subject: [MacRuby-devel] Roadmap - Upgrade the wiki Message-ID: <3DB25BA3-6333-4AEC-87CC-5C0CC6899014@gmail.com> Hi all, I registered on the Wiki but I can't change the Roadmap of the project, because the date for the version 0.4 is wrong ! Could you upgrade this wiki page ? https://www.macruby.org/trac/wiki/MacRubyRoadmap Date of 0.4: 03/08/2009 Thanks Stephane From mattaimonetti at gmail.com Mon Mar 16 12:07:47 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 16 Mar 2009 12:07:47 -0700 Subject: [MacRuby-devel] Roadmap - Upgrade the wiki In-Reply-To: <3DB25BA3-6333-4AEC-87CC-5C0CC6899014@gmail.com> References: <3DB25BA3-6333-4AEC-87CC-5C0CC6899014@gmail.com> Message-ID: <20fefa50903161207i10c37a78yec65930056057e68@mail.gmail.com> Thanks Stephane I just added the release date, I guess we do need to clean up this section tho. Merci, - Matt On Mon, Mar 16, 2009 at 12:03 PM, St?phane Wirtel wrote: > Hi all, > > I registered on the Wiki but I can't change the Roadmap of the project, > because the date for the version 0.4 is wrong ! > > Could you upgrade this wiki page ? > > https://www.macruby.org/trac/wiki/MacRubyRoadmap > Date of 0.4: 03/08/2009 > > Thanks > > Stephane > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.wirtel at gmail.com Mon Mar 16 12:26:58 2009 From: stephane.wirtel at gmail.com (Stephane Wirtel) Date: Mon, 16 Mar 2009 20:26:58 +0100 Subject: [MacRuby-devel] Roadmap - Upgrade the wiki In-Reply-To: <20fefa50903161207i10c37a78yec65930056057e68@mail.gmail.com> References: <3DB25BA3-6333-4AEC-87CC-5C0CC6899014@gmail.com> <20fefa50903161207i10c37a78yec65930056057e68@mail.gmail.com> Message-ID: Welcome, 2009/3/16 Matt Aimonetti > Thanks Stephane I just added the release date, I guess we do need to clean > up this section tho. > > Merci, > > - Matt > > On Mon, Mar 16, 2009 at 12:03 PM, St?phane Wirtel < > stephane.wirtel at gmail.com> wrote: > >> Hi all, >> >> I registered on the Wiki but I can't change the Roadmap of the project, >> because the date for the version 0.4 is wrong ! >> >> Could you upgrade this wiki page ? >> >> https://www.macruby.org/trac/wiki/MacRubyRoadmap >> Date of 0.4: 03/08/2009 >> >> Thanks >> >> Stephane >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > -- LinkedIn: http://www.linkedin.com/in/stephanewirtel Blog: http://simwi.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lsansonetti at apple.com Mon Mar 16 12:34:43 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Mon, 16 Mar 2009 12:34:43 -0700 Subject: [MacRuby-devel] Roadmap - Upgrade the wiki In-Reply-To: <20fefa50903161207i10c37a78yec65930056057e68@mail.gmail.com> References: <3DB25BA3-6333-4AEC-87CC-5C0CC6899014@gmail.com> <20fefa50903161207i10c37a78yec65930056057e68@mail.gmail.com> Message-ID: The new website will make this kind of contributions easier :-) Hopefully it should be live this week. Sent from my iPhone On Mar 16, 2009, at 12:07 PM, Matt Aimonetti wrote: > Thanks Stephane I just added the release date, I guess we do need to > clean up this section tho. > > Merci, > > - Matt > > On Mon, Mar 16, 2009 at 12:03 PM, St?phane Wirtel m> wrote: > Hi all, > > I registered on the Wiki but I can't change the Roadmap of the > project, because the date for the version 0.4 is wrong ! > > Could you upgrade this wiki page ? > > https://www.macruby.org/trac/wiki/MacRubyRoadmap > Date of 0.4: 03/08/2009 > > Thanks > > Stephane > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.wirtel at gmail.com Mon Mar 16 13:24:52 2009 From: stephane.wirtel at gmail.com (=?ISO-8859-1?Q?St=E9phane_Wirtel?=) Date: Mon, 16 Mar 2009 21:24:52 +0100 Subject: [MacRuby-devel] Roadmap - Upgrade the wiki In-Reply-To: References: <3DB25BA3-6333-4AEC-87CC-5C0CC6899014@gmail.com> <20fefa50903161207i10c37a78yec65930056057e68@mail.gmail.com> Message-ID: Thanks for this information. On 16 Mar 2009, at 20:34, Laurent Sansonetti wrote: > The new website will make this kind of contributions easier :-) > > Hopefully it should be live this week. > > Sent from my iPhone > > On Mar 16, 2009, at 12:07 PM, Matt Aimonetti > wrote: > >> Thanks Stephane I just added the release date, I guess we do need >> to clean up this section tho. >> >> Merci, >> >> - Matt >> >> On Mon, Mar 16, 2009 at 12:03 PM, St?phane Wirtel > > wrote: >> Hi all, >> >> I registered on the Wiki but I can't change the Roadmap of the >> project, because the date for the version 0.4 is wrong ! >> >> Could you upgrade this wiki page ? >> >> https://www.macruby.org/trac/wiki/MacRubyRoadmap >> Date of 0.4: 03/08/2009 >> >> Thanks >> >> Stephane >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From martinhess at mac.com Mon Mar 16 20:37:21 2009 From: martinhess at mac.com (Martin Hess) Date: Mon, 16 Mar 2009 20:37:21 -0700 Subject: [MacRuby-devel] Interfacing with C (not objective C) Message-ID: <3E2AF8C2-049F-4055-B2B2-E7B570498544@mac.com> My apologies if this has been covered somewhere else, but how do you interface with C in MacRuby. I know you can just write a C extension for Ruby but it appears that MacRuby makes this easier but it is unclear to me how far its support goes and when you should write an extension. Someone was asking about OpenGL in another thread which is a great example of a more difficult case but I don't think it covers all cases in a general sense. I'll break up the problem as I see it: 1) External C routines can be asynchronous a) Memory handed to the asynchronous routine can't move i.e. no garbage collection b) Call backs (i.e. passing in function pointers to a C routine) i. Asynchronous routines can show up at anytime 2) Function pointers as parameters to external C routines a) Function signature has to match exactly i.e. can't pass in a Ruby method pointer 3) Memory a) Allocated by external C routine i) How to delete if it is the callers responsibility to delete b) Allocated by caller i) How to allocate and get valid pointer to memory that isn't going to get garbage collected away c) Reading and writing allocated memory i) This is raw memory with no type information ii) How do you give it shape so you can read and write symbolically i.e. no peek/poke iii) Reading and writing packed bitfields So how are each of these things done in MacRuby? From cohen.jeff at gmail.com Mon Mar 16 21:39:45 2009 From: cohen.jeff at gmail.com (Jeff Cohen) Date: Mon, 16 Mar 2009 23:39:45 -0500 Subject: [MacRuby-devel] How do I handle file drop events in HotCocoa? In-Reply-To: <5C15AB62-F730-484A-881A-8721EAE78E57@apple.com> References: <3d7e01550903142109n7262046dkfe7006374623eb5a@mail.gmail.com> <5C15AB62-F730-484A-881A-8721EAE78E57@apple.com> Message-ID: <3d7e01550903162139l6129b707ubf525e2037622c6d@mail.gmail.com> Hi Laurant, Thanks a lot for your reply. And perhaps I misspoke somewhat - I'm not trying to implement full drag and drop within my application, but only receive simple filename drop events that originate from outside the application. I think that it's just a matter of adding a few extra delegate mappings, but I don't understand how to "extend" more mappings into the hotcocoa wrapper classes. Perhaps instead I will try to build from source and add the mappings there, and use a local build to test with. If a miracle occurs and I can figure it out, I will submit a patch. :-) Thanks again! Jeff On Mon, Mar 16, 2009 at 1:02 PM, Laurent Sansonetti wrote: > Hi Jeff, > > (Sorry for the late reply.) > > > On Mar 14, 2009, at 9:09 PM, Jeff Cohen wrote: > > Hello, >> >> I'm just getting started with MacRuby and HotCocoa (was a longtime .NET >> developer, and wasn't interested in learning Cocoa until MacRuby came >> along). I have a simple HotCocoa app with just a table view, and I'd like >> the user to be able to drop a filename from the Finder onto the table view >> (or anywhere in my app). I can call registerForDraggedTypes() on my table >> view object successfully. But I'm not sure how to have events delegated to >> my Application class (or if that's even possible). >> >> Looking at the hotcocoa source for wrapping NSView (view.rb), I don't see >> delegate mappings for the draggingEntered or performDragOperation events. I >> think I need to do something like the mapping code does and write code like >> this: >> >> delegating "draggingEntered", :to => :dragging_entered >> >> but I don't know where I can or should do that, or if I'm even on the >> right track. >> >> Any hint of where I should get started would be appreciated. >> > > I don't think HotCocoa exposes drag and drop facilities yet. In general > drag and drop in Cocoa is non trivial to do (esp. if you want to integrate > it with complex views such as NSTableViews). > > The following article describes how to implement drag and drop in Cocoa: > > > http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html > > It even has a special section dedicated to NSTableViews. > > You should be able to do everything described in this article using "pure" > MacRuby code but if you want to use some kind of syntax sugar via HotCocoa > I'm afraid you will have to wait until someone implements them. > > HTH, > Laurent > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattaimonetti at gmail.com Mon Mar 16 23:01:14 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 16 Mar 2009 23:01:14 -0700 Subject: [MacRuby-devel] How do I handle file drop events in HotCocoa? In-Reply-To: <3d7e01550903162139l6129b707ubf525e2037622c6d@mail.gmail.com> References: <3d7e01550903142109n7262046dkfe7006374623eb5a@mail.gmail.com> <5C15AB62-F730-484A-881A-8721EAE78E57@apple.com> <3d7e01550903162139l6129b707ubf525e2037622c6d@mail.gmail.com> Message-ID: <20fefa50903162301r67aea8fft9a767ca3cbf91265@mail.gmail.com> You can define your own mapping within your app or extend the existing ones, delegation can also be added on each instance of any object. Here is a sample app I wrote with a custom mapping (which was later on merged in HotCocoa): http://github.com/mattetti/macruby-examples/blob/fe06617645c8809183fb15bca025016937e1c84b/download/lib/progress_indicator.rb You can see that I defined my mapping like any other mappings and just required the file in my application.rb file: http://github.com/mattetti/macruby-examples/blob/fe06617645c8809183fb15bca025016937e1c84b/download/lib/application.rb#L5 - Matt 2009/3/16 Jeff Cohen > Hi Laurant, > > Thanks a lot for your reply. And perhaps I misspoke somewhat - I'm not > trying to implement full drag and drop within my application, but only > receive simple filename drop events that originate from outside the > application. I think that it's just a matter of adding a few extra delegate > mappings, but I don't understand how to "extend" more mappings into the > hotcocoa wrapper classes. > > Perhaps instead I will try to build from source and add the mappings there, > and use a local build to test with. If a miracle occurs and I can figure it > out, I will submit a patch. :-) > > Thanks again! > Jeff > > > > On Mon, Mar 16, 2009 at 1:02 PM, Laurent Sansonetti > wrote: > >> Hi Jeff, >> >> (Sorry for the late reply.) >> >> >> On Mar 14, 2009, at 9:09 PM, Jeff Cohen wrote: >> >> Hello, >>> >>> I'm just getting started with MacRuby and HotCocoa (was a longtime .NET >>> developer, and wasn't interested in learning Cocoa until MacRuby came >>> along). I have a simple HotCocoa app with just a table view, and I'd like >>> the user to be able to drop a filename from the Finder onto the table view >>> (or anywhere in my app). I can call registerForDraggedTypes() on my table >>> view object successfully. But I'm not sure how to have events delegated to >>> my Application class (or if that's even possible). >>> >>> Looking at the hotcocoa source for wrapping NSView (view.rb), I don't see >>> delegate mappings for the draggingEntered or performDragOperation events. I >>> think I need to do something like the mapping code does and write code like >>> this: >>> >>> delegating "draggingEntered", :to => :dragging_entered >>> >>> but I don't know where I can or should do that, or if I'm even on the >>> right track. >>> >>> Any hint of where I should get started would be appreciated. >>> >> >> I don't think HotCocoa exposes drag and drop facilities yet. In general >> drag and drop in Cocoa is non trivial to do (esp. if you want to integrate >> it with complex views such as NSTableViews). >> >> The following article describes how to implement drag and drop in Cocoa: >> >> >> http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html >> >> It even has a special section dedicated to NSTableViews. >> >> You should be able to do everything described in this article using >> "pure" MacRuby code but if you want to use some kind of syntax sugar via >> HotCocoa I'm afraid you will have to wait until someone implements them. >> >> HTH, >> Laurent >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby-noreply at macosforge.org Mon Mar 16 23:44:13 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Tue, 17 Mar 2009 06:44:13 -0000 Subject: [MacRuby-devel] [MacRuby] #232: Examples macruby apps don't work on Leopard Message-ID: <052.0b11fdf581a9d60739e2752f1396267a@macosforge.org> #232: Examples macruby apps don't work on Leopard -----------------------------------+---------------------------------------- Reporter: anildigital@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- /Developer/Examples/Ruby/MacRuby$ macruby buildall.rb /Users/anildigital/Desktop/temp Successful to build: ABPresence, AnimatingViews, CircleView, DotView, EmbeddedMacRuby, FlickrDemo, OutlineView, PagePacker, PathDemo, RoundTransparentWindow, ViewModelDemo Failed to build: None I have attached example .app file -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Mon Mar 16 23:46:10 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Tue, 17 Mar 2009 06:46:10 -0000 Subject: [MacRuby-devel] [MacRuby] #233: Examples macruby apps don't work on Leopard Message-ID: <052.bbbb25a5b754ed5341ecf6103476a315@macosforge.org> #233: Examples macruby apps don't work on Leopard -----------------------------------+---------------------------------------- Reporter: anildigital@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: macruby -----------------------------------+---------------------------------------- /Developer/Examples/Ruby/MacRuby$ macruby buildall.rb /Users/anildigital/Desktop/temp Successful to build: ABPresence, AnimatingViews, CircleView, DotView, EmbeddedMacRuby, FlickrDemo, OutlineView, PagePacker, PathDemo, RoundTransparentWindow, ViewModelDemo Failed to build: None -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Tue Mar 17 00:37:43 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Tue, 17 Mar 2009 07:37:43 -0000 Subject: [MacRuby-devel] [MacRuby] #232: Examples macruby apps don't work on Leopard In-Reply-To: <052.0b11fdf581a9d60739e2752f1396267a@macosforge.org> References: <052.0b11fdf581a9d60739e2752f1396267a@macosforge.org> Message-ID: <061.542e33706b62547d9af72d0754b158dc@macosforge.org> #232: Examples macruby apps don't work on Leopard -----------------------------------+---------------------------------------- Reporter: anildigital@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Changes (by lsansonetti@?): * milestone: MacRuby 0.4 => Comment: Could you be a little bit more explicit? The description you pasted sounds like all the samples correctly built. What kind of problem do you get when trying to run one? Also, what is your CPU architecture? (PPC machines are not supported by the binary installer). -- Ticket URL: MacRuby From cohen.jeff at gmail.com Tue Mar 17 06:34:57 2009 From: cohen.jeff at gmail.com (Jeff Cohen) Date: Tue, 17 Mar 2009 08:34:57 -0500 Subject: [MacRuby-devel] How do I handle file drop events in HotCocoa? In-Reply-To: <20fefa50903162301r67aea8fft9a767ca3cbf91265@mail.gmail.com> References: <3d7e01550903142109n7262046dkfe7006374623eb5a@mail.gmail.com> <5C15AB62-F730-484A-881A-8721EAE78E57@apple.com> <3d7e01550903162139l6129b707ubf525e2037622c6d@mail.gmail.com> <20fefa50903162301r67aea8fft9a767ca3cbf91265@mail.gmail.com> Message-ID: <3d7e01550903170634i6862508et36f528b751ff458f@mail.gmail.com> Hi Matt, I think the problem is that I'm trying to add more event handlers for an already-defined HotCocoa class. Here's a snippet of the top of my application.rb: # application.rb require 'hotcocoa' require 'logger' # Replace the following code with your own hotcocoa code HotCocoa::Mappings.map :view => :NSView do delegating "draggingEntered", :to => :dragging_entered end class Application... [snip] Now, inside my Application#start method, I eventually have code like this: [line 50] def create_table_view [line 51] @grid_view = layout_view :layout => {:expand => [:width, :height]}, :margin => 0, :spacing => 0 do |view| and when I have my custom mappings at the top of the file, I then get this error when I try to run macrake (I don't get this error if I comment out my custom mapping lines at the top): $ railsinfo: macrake (in /Users/jcohen/dev/sandbox/railsinfo) /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/hotcocoa/mapper.rb:59:in `eval': undefined method `layout=' for # (NoMethodError) from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/hotcocoa/mapper.rb:59:in `eval' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/hotcocoa/mapper.rb:59:in `block (2 levels) in map_method' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/hotcocoa/mapper.rb:51:in `each' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/hotcocoa/mapper.rb:51:in `block in map_method' from /Users/jcohen/dev/hotcocoa/railsinfo/Railsinfo.app/Contents/Resources/lib/application.rb:51:in `create_table_view' Unless I'm wrong, with your ProgressIndicator exmaple, you were defining a completely new class mapping. But since I'm trying to "reopen" NSView so to speak, I tihnk the HotCocoa::Mappings.map call might be messing up what was already mapped for NSView. I'll keep investigating... let me know if you think I might be right, or if I'm off my rocker. Thanks again! Jeff 2009/3/17 Matt Aimonetti > You can define your own mapping within your app or extend the existing > ones, delegation can also be added on each instance of any object. > > Here is a sample app I wrote with a custom mapping (which was later on > merged in HotCocoa): > > http://github.com/mattetti/macruby-examples/blob/fe06617645c8809183fb15bca025016937e1c84b/download/lib/progress_indicator.rb > > You can see that I defined my mapping like any other mappings and just > required the file in my application.rb file: > http://github.com/mattetti/macruby-examples/blob/fe06617645c8809183fb15bca025016937e1c84b/download/lib/application.rb#L5 > > - Matt > > 2009/3/16 Jeff Cohen > > Hi Laurant, >> >> Thanks a lot for your reply. And perhaps I misspoke somewhat - I'm not >> trying to implement full drag and drop within my application, but only >> receive simple filename drop events that originate from outside the >> application. I think that it's just a matter of adding a few extra delegate >> mappings, but I don't understand how to "extend" more mappings into the >> hotcocoa wrapper classes. >> >> Perhaps instead I will try to build from source and add the mappings >> there, and use a local build to test with. If a miracle occurs and I can >> figure it out, I will submit a patch. :-) >> >> Thanks again! >> Jeff >> >> >> >> On Mon, Mar 16, 2009 at 1:02 PM, Laurent Sansonetti < >> lsansonetti at apple.com> wrote: >> >>> Hi Jeff, >>> >>> (Sorry for the late reply.) >>> >>> >>> On Mar 14, 2009, at 9:09 PM, Jeff Cohen wrote: >>> >>> Hello, >>>> >>>> I'm just getting started with MacRuby and HotCocoa (was a longtime .NET >>>> developer, and wasn't interested in learning Cocoa until MacRuby came >>>> along). I have a simple HotCocoa app with just a table view, and I'd like >>>> the user to be able to drop a filename from the Finder onto the table view >>>> (or anywhere in my app). I can call registerForDraggedTypes() on my table >>>> view object successfully. But I'm not sure how to have events delegated to >>>> my Application class (or if that's even possible). >>>> >>>> Looking at the hotcocoa source for wrapping NSView (view.rb), I don't >>>> see delegate mappings for the draggingEntered or performDragOperation >>>> events. I think I need to do something like the mapping code does and write >>>> code like this: >>>> >>>> delegating "draggingEntered", :to => :dragging_entered >>>> >>>> but I don't know where I can or should do that, or if I'm even on the >>>> right track. >>>> >>>> Any hint of where I should get started would be appreciated. >>>> >>> >>> I don't think HotCocoa exposes drag and drop facilities yet. In general >>> drag and drop in Cocoa is non trivial to do (esp. if you want to integrate >>> it with complex views such as NSTableViews). >>> >>> The following article describes how to implement drag and drop in Cocoa: >>> >>> >>> http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html >>> >>> It even has a special section dedicated to NSTableViews. >>> >>> You should be able to do everything described in this article using >>> "pure" MacRuby code but if you want to use some kind of syntax sugar via >>> HotCocoa I'm afraid you will have to wait until someone implements them. >>> >>> HTH, >>> Laurent >>> _______________________________________________ >>> MacRuby-devel mailing list >>> MacRuby-devel at lists.macosforge.org >>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >>> >> >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frisco at laszlomail.com Tue Mar 17 20:58:09 2009 From: frisco at laszlomail.com (Frisco Del Rosario) Date: Tue, 17 Mar 2009 20:58:09 -0700 (PDT) Subject: [MacRuby-devel] I want to help Message-ID: <794067038.28762.1237348690549.JavaMail.frisco@localhost> I am an old dog learning new tricks by reading. I remember that when I was a young dog, I learned better by doing. So I would like to help someone do something. I have experience writing unit tests and documentation, but would like to do anything. From chapbr at gmail.com Tue Mar 17 21:25:40 2009 From: chapbr at gmail.com (Brian Chapados) Date: Tue, 17 Mar 2009 21:25:40 -0700 Subject: [MacRuby-devel] Interfacing with C (not objective C) In-Reply-To: <3E2AF8C2-049F-4055-B2B2-E7B570498544@mac.com> References: <3E2AF8C2-049F-4055-B2B2-E7B570498544@mac.com> Message-ID: I think that if you need to make use extensive use of C functions/libraries, then the least painful route is to wrap this functionality in Objective-C classes. ?Writing Objective-C classes that call your C code is easier than writing C ruby extensions. ?At least in my opinion, this is why MacRuby makes it easier to interface with C. Just create a dylib or framework, load it in MacRuby and use it. Note that there is currently no way to bridge arbitrary C functions anyway, so if you want something that isn't covered by BridgeSupport, your only option right now is to wrap it in Objective-C. For pointers, MacRuby currently provides a simple Pointer class that allows you to: 1. pass around a pointer 2. access the value (dereference) 3. assign the value that is pointed to (this allocates memory that is pointed to) There really isn't a way to get a pointer to a MacRuby function and pass that to a C function. So callback-type situations would have to be wrapped in Objective-C. You can do: 1. a. Memory handed to the asynchronous routine can't move i.e. no garbage collection if you create a Pointer and assign a value to it, then memory gets allocated and should be safe as long as the Pointer object stays around. For example: p = Pointer.new_with_type("i") p.assign(5) my_c_function(p) 3. b. If the caller is allocating the memory, you can create a Pointer object, pass it to the caller and then access the value. This requires that you know the type. An example of this is dealing with pointers to NSError objects. For example: errorp = Pointer.new_with_type("@") result = my_data.writeToURL(save_url, options:nil error:errorp) # access error errorp[0] 3. c You would need to be able to assign the type to a Pointer that you do not create (not currently possible). After looking at objc.m, I think this could be added. However, it would be somewhat dangerous. If you really need to read packed bit fields and things you can't do with Array#pack / unpack, then I would probably wrap that code. Brian On Mon, Mar 16, 2009 at 8:37 PM, Martin Hess wrote: > My apologies if this has been covered somewhere else, but how do you > interface with C in MacRuby. I know you can just write a C extension for > Ruby but it appears that MacRuby makes this easier but it is unclear to me > how far its support goes and when you should write an extension. > > Someone was asking about OpenGL in another thread which is a great example > of a more difficult case but I don't think it covers all cases in a general > sense. I'll break up the problem as I see it: > > 1) External C routines can be asynchronous > ? ? ? ?a) Memory handed to the asynchronous routine can't move i.e. no > garbage collection > ? ? ? ?b) Call backs (i.e. passing in function pointers to a C routine) > ? ? ? ? ? ? ? ?i. ?Asynchronous routines can show up at anytime > > 2) Function pointers as parameters to external C routines > ? ? ? ?a) Function signature has to match exactly i.e. can't pass in a Ruby > method pointer > > 3) Memory > ? ? ? ?a) Allocated by external C routine > ? ? ? ? ? ? ? ?i) How to delete if it is the callers responsibility to > delete > ? ? ? ?b) Allocated by caller > ? ? ? ? ? ? ? ?i) How to allocate and get valid pointer to memory that isn't > going to get garbage collected away > ? ? ? ?c) Reading and writing allocated memory > ? ? ? ? ? ? ? ?i) This is raw memory with no type information > ? ? ? ? ? ? ? ?ii) How do you give it shape so you can read and write > symbolically i.e. no peek/poke > ? ? ? ? ? ? ? ?iii) Reading and writing packed bitfields > > > So how are each of these things done in > MacRuby?_______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > From johnmacshea at gmail.com Wed Mar 18 01:49:10 2009 From: johnmacshea at gmail.com (John Shea) Date: Wed, 18 Mar 2009 09:49:10 +0100 Subject: [MacRuby-devel] I want to help In-Reply-To: <794067038.28762.1237348690549.JavaMail.frisco@localhost> References: <794067038.28762.1237348690549.JavaMail.frisco@localhost> Message-ID: Hello Frisco, one option for you is to become an expert in something MacRuby. One area for example that could give you some good skills and could be good for the MacRuby community (if you release the results) is the CoreAnimation area, an area I was hoping I would have time for but will not. So: 1. You could take a look at the example I translated on johnmacshea.org - in the Hillegas examples - Polynomials. 2. Then you could translate Bill Dudney's CoreAnimation examples with these screencasts : http://www.pragprog.com/screencasts/v-bdcora/creating-a-compelling-user-interface-with-core-animation (He also has a book - available as a pdf at the pragprogs - if you are really keen do that as well). You will probably need to buy the screencasts - and I actually have not checked with the PragProgs whether they are happy to have MacRuby versions of their Objective C code floating around. I have done the macruby translations for the first two or three screencasts. 3. Then you could translate this: http://cocoawithlove.com/2009/03/asteroids-style-game-in-coreanimation.html I am actually not sure what the performance would be in MacRuby - in the 4th instalment in that series Matt suggests that CoreAnimation (in ObjectiveC) can sometimes have performance issues with many layers. 4. Then for the final exam of your short course ;-) you could do what Jordan Hubbard suggested and translate this http://developer.apple.com/samplecode/GeekGameBoard/index.html. If you are interested in following this path let me know and I will send you what I have done in the Bill Dudney screencasts. Even if we aren't allowed to release the macruby versions into the wild - you could learn from the process and help you on the next steps. Cheers, J On Wed, Mar 18, 2009 at 4:58 AM, Frisco Del Rosario wrote: > I am an old dog learning new tricks by reading. I remember that when I was > a young dog, I learned better by doing. > > So I would like to help someone do something. I have experience writing > unit tests and documentation, but would like to do anything. > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lsansonetti at apple.com Wed Mar 18 11:33:51 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Wed, 18 Mar 2009 11:33:51 -0700 Subject: [MacRuby-devel] Interfacing with C (not objective C) In-Reply-To: References: <3E2AF8C2-049F-4055-B2B2-E7B570498544@mac.com> Message-ID: <7C794D81-C1FD-4D6E-B297-318A227851E2@apple.com> Hi Martin & Brian, On Mar 17, 2009, at 9:25 PM, Brian Chapados wrote: > I think that if you need to make use extensive use of C > functions/libraries, then the least painful route is to wrap this > functionality in Objective-C classes. Writing Objective-C classes > that call your C code is easier than writing C ruby extensions. At > least in my opinion, this is why MacRuby makes it easier to interface > with C. Just create a dylib or framework, load it in MacRuby and use > it. > > Note that there is currently no way to bridge arbitrary C functions > anyway, so if you want something that isn't covered by BridgeSupport, > your only option right now is to wrap it in Objective-C. It is possible to cover using BridgeSupport any arbitrary API, though. See the gen_bridge_metadata(1) man page, or BridgeSupport(5) if you want to write it by hand. MacRuby trunk uses libffi under the covers to call C / ObjC implementations and uses the BridgeSupport annotations to provide the correct signatures. We could expose an API (like the Ruby "FFI" gem) that can feed the runtime with signatures, that should be very trivial. > There really isn't a way to get a pointer to a MacRuby function and > pass that to a C function. So callback-type situations would have to > be wrapped in Objective-C. FYI, in RubyCocoa it is possible to pass Proc objects as function pointers. We allocate an FFI closure that calls the proc and pass a pointer to the closure to the underlying C API. This has not been ported to MacRuby, yet :-) Laurent From ruby-noreply at macosforge.org Wed Mar 18 13:29:38 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Wed, 18 Mar 2009 20:29:38 -0000 Subject: [MacRuby-devel] [MacRuby] #234: Backticks segfaults occasionally Message-ID: <049.20a68bd22e8c0ef11fb7a85574a2090d@macosforge.org> #234: Backticks segfaults occasionally --------------------------------+------------------------------------------- Reporter: brad@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Hi, I have a script that is running an external command using backticks `` every 5 seconds or so. It seems to work for a few hours, then segfault. The error report is below. From what I can tell, the string passed into the backticks is not null - i can print it out using NSLog just fine. I haven't been able to provide a quick way to replicate this problem - it seems to take time. This is on the latest svn of MacRuby. {{{ /Users/brad/projects/gately/Gately.app/Contents/Resources/lib/panel.rb:65: [BUG] Segmentation fault MacRuby version 0.4 (ruby 1.9.1) [universal-darwin9.0, x86_64] -- stack frame ------------ 0000 (0xc083a0060): 00000004 0001 (0xc083a0068): 00000000 0002 (0xc083a0070): 00000004 0003 (0xc083a0078): 80035dae8 0004 (0xc083a0080): 00000004 0005 (0xc083a0088): 8006843e0 0006 (0xc083a0090): 00000004 0007 (0xc083a0098): 00000000 0008 (0xc083a00a0): 8000d1ac0 0009 (0xc083a00a8): 00000004 0010 (0xc083a00b0): c0849fec8 0011 (0xc083a00b8): 8000d24a0 0012 (0xc083a00c0): 00000004 0013 (0xc083a00c8): c083a0098 (= 7) 0014 (0xc083a00d0): 8006843e0 0015 (0xc083a00d8): 00000004 0016 (0xc083a00e0): 80067d6c0 0017 (0xc083a00e8): 00000004 0018 (0xc083a00f0): 00000000 <- lfp <- dfp -- control frame ---------- c:0008 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC :` c:0007 p:0036 s:0015 b:0014 l:000007 d:000013 BLOCK /Users/brad/projects/gately/Gately.app/Contents/Resources/lib/panel.rb:65 c:0006 p:---- s:0013 b:0013 l:000012 d:000012 FINISH :nil? c:0005 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :each c:0004 p:0012 s:0008 b:0008 l:000007 d:000007 METHOD /Users/brad/projects/gately/Gately.app/Contents/Resources/lib/panel.rb:63 c:0003 p:0011 s:0004 b:0004 l:001e88 d:000003 BLOCK /Users/brad/projects/gately/Gately.app/Contents/Resources/lib/panel.rb:47 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP --------------------------- }}} -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Fri Mar 20 04:39:45 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Fri, 20 Mar 2009 11:39:45 -0000 Subject: [MacRuby-devel] [MacRuby] #235: Problems with adding objects to scriptable applications via scripting bridge Message-ID: <049.0e5cbacc940b01ced1a227673faf8975@macosforge.org> #235: Problems with adding objects to scriptable applications via scripting bridge --------------------------------+------------------------------------------- Reporter: i.script@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: ScriptingBridge Error --------------------------------+------------------------------------------- hi, lately I've tried to get some exerience in scripting DEVONthink using the ScriptingBridge. This works overall very well. Only the "create a record with in" command crates headaches for me. The following code-snippet exemplifies the problem: {{{ #!/usr/local/bin/macruby framework "Cocoa" framework "Foundation" framework "ScriptingBridge" devon = SBApplication.applicationWithBundleIdentifier("com.devon- technologies.thinkpro2") theGroup = devon.createLocation '/root/scripts/myscript', :in => '/' theRecord =devon.classForScriptingClass("record").alloc.initWithProperties({'type'=>'text','plainText'=>"Hallo Welt!",'name' =>"helloworld"}) puts theRecord.description # Scripting Bridge does not actually create an object in the target application until you add the allocated and # initialized object to an appropriate element array (SBElementArray), such as records in my example. # thats's the way it should be done, but its not working puts devon.databases[0].records.insertObject(theRecord, :atIndex => 11) # or : puts devon.databases[0].records.addObject(theRecord) theRecord.createRecordWithIn resultRecord }}} While working with this code snippet I've found out that: 1. if i use: "puts theRecord" instead of "puts theRecord.description" the script runs out of time 2. the attempt to instantiate a scripting object within DEVONthink creates this error: {{{ /Users/stereocle/Documents/devonruby.rb:24:in `insertObject:atIndex:': NSGenericException: Apple event returned an error. Event = 'core'\'crel'{ 'kocl':'DTrc', 'insh':'insl'{ 'kobj':'obj '{ 'want':'DTrc', 'from':'obj '{ 'want':'DTkb', 'from':'null'(), 'form':'indx', 'seld':1 }, 'form':'indx', 'seld':1 }, 'kpos':'befo' }, 'prdt':{ 'DTpl':'utxt'("Hallo Welt"), 'pnam':'utxt'("helloworld"), 'DTty':'utxt'("text") } } (RuntimeError) Error info = { ErrorNumber = -10000; }}} -- Ticket URL: MacRuby From pete at notahat.com Sun Mar 22 15:18:09 2009 From: pete at notahat.com (Pete Yandell) Date: Mon, 23 Mar 2009 09:18:09 +1100 Subject: [MacRuby-devel] Accessing bytes within NSData Message-ID: <8B80CA03-E7D0-473C-A2A1-368A1D4E6A57@notahat.com> I'd like to use something like Ruby's String#unpack to pull some info out of an NSData, but I'm stumped as to how to do it. NSData.bytes returns a Pointer object, but trying to use [] to dereference it gives me: ArgumentError: can't convert C/Objective-C value `0x800059800' of type `?_?' to Ruby object I've done a lot of digging around, reading of forum posts, playing (unsuccessfully) with BridgeSupport, etc., but it hasn't got me any closer. Any hints? The broader context is that I'm trying to extract the TCP port number from an NSSocketPort. NSSocketPort's address method returns an NSData, which should contain a sockaddr_in, out of which I should be able to pull the port. Thanks, Pete Yandell http://notahat.com/ From ruby-noreply at macosforge.org Mon Mar 23 09:19:23 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 23 Mar 2009 16:19:23 -0000 Subject: [MacRuby-devel] [MacRuby] #236: Array.pack bug Message-ID: <057.a72d04052a1582669003ffea68cc7b4a@macosforge.org> #236: Array.pack bug ----------------------------------------+----------------------------------- Reporter: dave.baldwin@? | Owner: lsansonetti@? Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: array pack ----------------------------------------+----------------------------------- macirb (0.4) and irb (1.8.6) give different results (and lengths) on the following command to pack 4 integers into 16 bytes in little endian format. macruby generates 17 bytes and gets the conversion of 66303 wrong. [0, 110, 66303, 0].pack('VVVV').each_byte{|b| puts b} macirb irb 0 0 0 0 0 0 0 0 110 110 0 0 0 0 0 0 195 255 191 2 2 1 1 0 0 0 0 0 0 0 0 0 0 -- Ticket URL: MacRuby From johnmacshea at gmail.com Tue Mar 24 04:57:38 2009 From: johnmacshea at gmail.com (John Shea) Date: Tue, 24 Mar 2009 12:57:38 +0100 Subject: [MacRuby-devel] Accessing bytes within NSData In-Reply-To: <8B80CA03-E7D0-473C-A2A1-368A1D4E6A57@notahat.com> References: <8B80CA03-E7D0-473C-A2A1-368A1D4E6A57@notahat.com> Message-ID: Did I miss the answer to this one? I have a similar issue returning bytes, voids, GLfloats etc J On Mar 22, 2009, at 11:18 PM, Pete Yandell wrote: > I'd like to use something like Ruby's String#unpack to pull some > info out of an NSData, but I'm stumped as to how to do it. > > NSData.bytes returns a Pointer object, but trying to use [] to > dereference it gives me: > > ArgumentError: can't convert C/Objective-C value `0x800059800' of > type `?_?' to Ruby object > > I've done a lot of digging around, reading of forum posts, playing > (unsuccessfully) with BridgeSupport, etc., but it hasn't got me any > closer. Any hints? > > The broader context is that I'm trying to extract the TCP port > number from an NSSocketPort. NSSocketPort's address method returns > an NSData, which should contain a sockaddr_in, out of which I should > be able to pull the port. > > Thanks, > > Pete Yandell > http://notahat.com/ > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From chapbr at gmail.com Tue Mar 24 12:03:32 2009 From: chapbr at gmail.com (Brian Chapados) Date: Tue, 24 Mar 2009 12:03:32 -0700 Subject: [MacRuby-devel] Accessing bytes within NSData In-Reply-To: <8B80CA03-E7D0-473C-A2A1-368A1D4E6A57@notahat.com> References: <8B80CA03-E7D0-473C-A2A1-368A1D4E6A57@notahat.com> Message-ID: Hi Pete, Since you have an NSData object, you should be able to convert it to a String (NSString) and then use unpack. For example: socket_port = NSSocketPort.alloc.initWithTCPPort(11111) addr = socket_port.address addr_str = NSString.alloc.initWithData(addr, encoding:NSString.defaultCStringEncoding) port = addr_str.unpack("nn")[1] # seems to work - not sure what this should be I suppose the other alternative would be to add some methods to the Pointer class making it possible to set the type of a returned Pointer. Brian On Sun, Mar 22, 2009 at 3:18 PM, Pete Yandell wrote: > I'd like to use something like Ruby's String#unpack to pull some info out of > an NSData, but I'm stumped as to how to do it. > > NSData.bytes returns a Pointer object, but trying to use [] to dereference > it gives me: > > ? ? ? ?ArgumentError: can't convert C/Objective-C value `0x800059800' of > type `?_?' to Ruby object > > I've done a lot of digging around, reading of forum posts, playing > (unsuccessfully) with BridgeSupport, etc., but it hasn't got me any closer. > Any hints? > > The broader context is that I'm trying to extract the TCP port number from > an NSSocketPort. NSSocketPort's address method returns an NSData, which > should contain a sockaddr_in, out of which I should be able to pull the > port. > > Thanks, > > Pete Yandell > http://notahat.com/ > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > From ruby-noreply at macosforge.org Tue Mar 24 17:53:48 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Wed, 25 Mar 2009 00:53:48 -0000 Subject: [MacRuby-devel] [MacRuby] #237: NSConnection cause crash Message-ID: <044.573e192b43b56f51f7fbfe6aa716a512@macosforge.org> #237: NSConnection cause crash ---------------------------+------------------------------------------------ Reporter: qeygh@? | Owner: lsansonetti@? Type: defect | Status: new Priority: major | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: NSConection ---------------------------+------------------------------------------------ An attempt to connect to a different process with: oas = NSConnection.rootProxyForConnectionWithRegisteredName( "OptixWS", host:"" ) Results in macirb crashing. Dump attached. Running from "macruby" crashs too. -- Ticket URL: MacRuby From tjackiw at gmail.com Fri Mar 27 09:57:58 2009 From: tjackiw at gmail.com (Thiago Jackiw) Date: Fri, 27 Mar 2009 09:57:58 -0700 Subject: [MacRuby-devel] Packing gems in the app's folder Message-ID: <206d03720903270957l4030b764h31be32b2f247ee05@mail.gmail.com> Do I have to do anything special to pack gems inside my application's folder? The following isn't working when I require the gems inside of my 'Gems' folder: # rb_main.rb ENV['GEM_HOME'] = File.dirname(__FILE__) + '/Gems' require 'rubygems' require 'mechanize' `require': no such file to load -- mechanize (LoadError) If I do the above in IRB it works just fine. The 'Gems' folder contains the following structure: Gems - cache - doc - gems - mechanize-0.9.2 - specifications - mechanize-0.9.2.gemspec Thanks, and I'm using MacRuby 0.4. -- Thiago Jackiw From eloy.de.enige at gmail.com Fri Mar 27 10:20:09 2009 From: eloy.de.enige at gmail.com (Eloy Duran) Date: Fri, 27 Mar 2009 18:20:09 +0100 Subject: [MacRuby-devel] Packing gems in the app's folder In-Reply-To: <206d03720903270957l4030b764h31be32b2f247ee05@mail.gmail.com> References: <206d03720903270957l4030b764h31be32b2f247ee05@mail.gmail.com> Message-ID: <5A76C991-5510-4391-843B-5F0DCCF31B5D@gmail.com> Hi, Have you included the Gems directory in your xcode project so that it copies the complete dir when building? This probably then tells you that the dir does not exist "p File.exist? (File.expand_path('../Gems', __FILE__))". Second, are you sure you actually need rubygems if you are already vendoring? Removing rubygems from the dependencies will really boost up the load time of your application. So I would do everything to remove it as a dependency. In the best case scenario you only need to do something like (untested code): Dir.glob(File.expand_path('../Gems/*', __FILE__)).each do |gem| $LOAD_PATH.unshift File.join(gem, 'lib') end require "mechanize" - Eloy On 27 mrt 2009, at 17:57, Thiago Jackiw wrote: > Do I have to do anything special to pack gems inside my application's > folder? The following isn't working when I require the gems inside of > my 'Gems' folder: > > # rb_main.rb > ENV['GEM_HOME'] = File.dirname(__FILE__) + '/Gems' > require 'rubygems' > require 'mechanize' > > `require': no such file to load -- mechanize (LoadError) > > If I do the above in IRB it works just fine. > > The 'Gems' folder contains the following structure: > > Gems > - cache > - doc > - gems > - mechanize-0.9.2 > - specifications > - mechanize-0.9.2.gemspec > > Thanks, and I'm using MacRuby 0.4. > > -- > Thiago Jackiw > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From mattaimonetti at gmail.com Fri Mar 27 10:49:57 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Fri, 27 Mar 2009 10:49:57 -0700 Subject: [MacRuby-devel] Packing gems in the app's folder In-Reply-To: <5A76C991-5510-4391-843B-5F0DCCF31B5D@gmail.com> References: <206d03720903270957l4030b764h31be32b2f247ee05@mail.gmail.com> <5A76C991-5510-4391-843B-5F0DCCF31B5D@gmail.com> Message-ID: <20fefa50903271049s79372dddo676ee7411e3d3577@mail.gmail.com> I agree with Eloy, I'm not using rubygems either. Just load manually what you vendored. - Matt On Fri, Mar 27, 2009 at 10:20 AM, Eloy Duran wrote: > Hi, > > Have you included the Gems directory in your xcode project so that it > copies the complete dir when building? > This probably then tells you that the dir does not exist "p > File.exist?(File.expand_path('../Gems', __FILE__))". > > Second, are you sure you actually need rubygems if you are already > vendoring? Removing rubygems from the dependencies will really boost up the > load time of your application. So I would do everything to remove it as a > dependency. In the best case scenario you only need to do something like > (untested code): > > Dir.glob(File.expand_path('../Gems/*', __FILE__)).each do |gem| > $LOAD_PATH.unshift File.join(gem, 'lib') > end > > require "mechanize" > > - Eloy > > > On 27 mrt 2009, at 17:57, Thiago Jackiw wrote: > > Do I have to do anything special to pack gems inside my application's >> folder? The following isn't working when I require the gems inside of >> my 'Gems' folder: >> >> # rb_main.rb >> ENV['GEM_HOME'] = File.dirname(__FILE__) + '/Gems' >> require 'rubygems' >> require 'mechanize' >> >> `require': no such file to load -- mechanize (LoadError) >> >> If I do the above in IRB it works just fine. >> >> The 'Gems' folder contains the following structure: >> >> Gems >> - cache >> - doc >> - gems >> - mechanize-0.9.2 >> - specifications >> - mechanize-0.9.2.gemspec >> >> Thanks, and I'm using MacRuby 0.4. >> >> -- >> Thiago Jackiw >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjackiw at gmail.com Fri Mar 27 10:58:41 2009 From: tjackiw at gmail.com (Thiago Jackiw) Date: Fri, 27 Mar 2009 10:58:41 -0700 Subject: [MacRuby-devel] Packing gems in the app's folder In-Reply-To: <5A76C991-5510-4391-843B-5F0DCCF31B5D@gmail.com> References: <206d03720903270957l4030b764h31be32b2f247ee05@mail.gmail.com> <5A76C991-5510-4391-843B-5F0DCCF31B5D@gmail.com> Message-ID: <206d03720903271058u47ebdba4l5583a001680708b1@mail.gmail.com> Thanks Eloy, it makes sense just to vendor what I need and not require rubygems. Including the Gems directory to the project references did the trick. Thanks! -- Thiago Jackiw On Fri, Mar 27, 2009 at 10:20 AM, Eloy Duran wrote: > Hi, > > Have you included the Gems directory in your xcode project so that it copies > the complete dir when building? > This probably then tells you that the dir does not exist "p > File.exist?(File.expand_path('../Gems', __FILE__))". > > Second, are you sure you actually need rubygems if you are already > vendoring? Removing rubygems from the dependencies will really boost up the > load time of your application. So I would do everything to remove it as a > dependency. In the best case scenario you only need to do something like > (untested code): > > Dir.glob(File.expand_path('../Gems/*', __FILE__)).each do |gem| > ?$LOAD_PATH.unshift File.join(gem, 'lib') > end > > require "mechanize" > > - Eloy > > On 27 mrt 2009, at 17:57, Thiago Jackiw wrote: > >> Do I have to do anything special to pack gems inside my application's >> folder? The following isn't working when I require the gems inside of >> my 'Gems' folder: >> >> # rb_main.rb >> ENV['GEM_HOME'] = File.dirname(__FILE__) + '/Gems' >> require 'rubygems' >> require 'mechanize' >> >> `require': no such file to load -- mechanize (LoadError) >> >> If I do the above in IRB it works just fine. >> >> The 'Gems' folder contains the following structure: >> >> Gems >> - cache >> - doc >> - gems >> ?- mechanize-0.9.2 >> - specifications >> ?- mechanize-0.9.2.gemspec >> >> Thanks, and I'm using MacRuby 0.4. >> >> -- >> Thiago Jackiw >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > From lsansonetti at apple.com Fri Mar 27 20:12:28 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Fri, 27 Mar 2009 20:12:28 -0700 Subject: [MacRuby-devel] new website! Message-ID: Hi guys, I'm glad to introduce you our new website! http://macruby.org It's written with webby and it's very easy to maintain it. It was implemented so that people can easily contribute changes. Dependencies: $ sudo gem install coderay $ sudo gem install webby To get the sources: $ svn co http://svn.macosforge.org/repository/ruby/MacRubyWebsite/trunk macruby-website To build it + start a local web browser + open a new browser window and refresh the server when a file changes: $ cd macruby-website $ webby autobuild Feel free to check it out and if you want to provide a tutorial/recipe please send your patch! I would like to personally thank: John Athayde (design), Rich Kilmer (implementation) and William Siegrist (server hosting). Enjoy, Laurent From stephane.wirtel at gmail.com Fri Mar 27 20:17:54 2009 From: stephane.wirtel at gmail.com (=?ISO-8859-1?Q?St=E9phane_Wirtel?=) Date: Sat, 28 Mar 2009 04:17:54 +0100 Subject: [MacRuby-devel] new website! In-Reply-To: References: Message-ID: <7E4A0B55-8B78-467D-9BD1-1C5D144C910D@gmail.com> coolm I like this layout, thank you so much for this new website stef On 28 Mar 2009, at 04:12, Laurent Sansonetti wrote: > Hi guys, > > I'm glad to introduce you our new website! > > http://macruby.org > > It's written with webby and it's very easy to maintain it. It was > implemented so that people can easily contribute changes. > > Dependencies: > > $ sudo gem install coderay > $ sudo gem install webby > > To get the sources: > > $ svn co http://svn.macosforge.org/repository/ruby/MacRubyWebsite/trunk > macruby-website > > To build it + start a local web browser + open a new browser window > and refresh the server when a file changes: > > $ cd macruby-website > $ webby autobuild > > Feel free to check it out and if you want to provide a tutorial/ > recipe please send your patch! > > I would like to personally thank: John Athayde (design), Rich Kilmer > (implementation) and William Siegrist (server hosting). > > Enjoy, > > Laurent > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel St?phane Wirtel stephane.wirtel at gmail.com From ruby-noreply at macosforge.org Sat Mar 28 00:03:29 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 28 Mar 2009 07:03:29 -0000 Subject: [MacRuby-devel] [MacRuby] #22: NSPredicate doesn't work In-Reply-To: <054.c836341b610c89885e75de809c052727@macosforge.org> References: <054.c836341b610c89885e75de809c052727@macosforge.org> Message-ID: <063.27446b58d1278e5d16b17240a5a8c1ee@macosforge.org> #22: NSPredicate doesn't work -------------------------------------+-------------------------------------- Reporter: jordan.breeding@? | Owner: lsansonetti@? Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.1 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------------+-------------------------------------- Comment(by ads@?): [http://www.sneakeralley.com Nike Air Force One] -- Ticket URL: MacRuby From carlosparamio at gmail.com Sat Mar 28 07:46:37 2009 From: carlosparamio at gmail.com (Carlos Paramio) Date: Sat, 28 Mar 2009 15:46:37 +0100 Subject: [MacRuby-devel] new website! In-Reply-To: References: Message-ID: Very nice. Congrats! Carlos Paramio El 28/03/2009, a las 4:12, Laurent Sansonetti escribi?: > Hi guys, > > I'm glad to introduce you our new website! > > http://macruby.org > > It's written with webby and it's very easy to maintain it. It was > implemented so that people can easily contribute changes. > > Dependencies: > > $ sudo gem install coderay > $ sudo gem install webby > > To get the sources: > > $ svn co http://svn.macosforge.org/repository/ruby/MacRubyWebsite/trunk > macruby-website > > To build it + start a local web browser + open a new browser window > and refresh the server when a file changes: > > $ cd macruby-website > $ webby autobuild > > Feel free to check it out and if you want to provide a tutorial/ > recipe please send your patch! > > I would like to personally thank: John Athayde (design), Rich Kilmer > (implementation) and William Siegrist (server hosting). > > Enjoy, > > Laurent > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From lsansonetti at apple.com Sat Mar 28 12:37:37 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Sat, 28 Mar 2009 12:37:37 -0700 Subject: [MacRuby-devel] branches/experimental Message-ID: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> Hi guys, As some of you already noticed we have been working on a branch for a few weeks and I thought it's now time to describe what has been done and were we are going exactly. I wrote a blog entry here: http://www.macruby.org/blog/2009/03/28/experimental-branch.html 2 big features in this branch: a LLVM-based JIT compiler and a new IO subsystem. Obviously performance-related, we really need to be faster. Current status of the branch: - The compiler is now able to pass most of the Ruby AST. It compiles nodes directly from the parser in a lazy fashion. - Only JIT compilation for the moment (AOT is planned for later). - The VM is still under development, it's not as complete as the compiler yet. - Early performance benchmarks are very promising. - By the time of this writing, we pass the vast majority of the language RubySpecs (a week ago we weren't even able to even bootstrap mspec!), about 1190 expectations. Work is very active in this area, we are also making sure the specs do run with the original Ruby 1.9 and writing missing specs. - The new IO subsystem is mostly functional, but there are still many methods that are not implemented yet and we are working on this. Once it will be complete we will integrate a default runloop in the VM and expose asynchronous IOs. For the near future, the goals are: - Improving the compiler. Currently compile time has not really been optimized yet. - Be able to run IRB. We are almost there. - Remove the libffi code used to call C/ObjC implementations and instead JIT compile stubs and insert them in the dispatcher cache. We should be way closer to ObjC then (and maybe faster once we enable secondary compilations of hotspots and inline the stubs). - Rewrite the BridgeSupport side using LLVM types. - Implement full concurrent threading! (this is a big one :-)). - And many more (check the TODO file for more info). Once we arrive at a point when the branch is as functional as trunk, it will be merged in trunk and we will then work on stabilizing it, to later on release it as 0.5. The schedule for this release is unknown, it will be released when it will be ready (preferably this year though). If you want to help let me know! Laurent From jordan.breeding at mac.com Sat Mar 28 12:48:49 2009 From: jordan.breeding at mac.com (Jordan Breeding) Date: Sat, 28 Mar 2009 14:48:49 -0500 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> Message-ID: Will OSA support be a 0.5 or a 0.6 task? On Mar 28, 2009, at 14:37, Laurent Sansonetti wrote: > Hi guys, > > As some of you already noticed we have been working on a branch for > a few weeks and I thought it's now time to describe what has been > done and were we are going exactly. > > I wrote a blog entry here: http://www.macruby.org/blog/2009/03/28/experimental-branch.html > > 2 big features in this branch: a LLVM-based JIT compiler and a new > IO subsystem. Obviously performance-related, we really need to be > faster. > > Current status of the branch: > > - The compiler is now able to pass most of the Ruby AST. It compiles > nodes directly from the parser in a lazy fashion. > - Only JIT compilation for the moment (AOT is planned for later). > - The VM is still under development, it's not as complete as the > compiler yet. > - Early performance benchmarks are very promising. > - By the time of this writing, we pass the vast majority of the > language RubySpecs (a week ago we weren't even able to even > bootstrap mspec!), about 1190 expectations. Work is very active in > this area, we are also making sure the specs do run with the > original Ruby 1.9 and writing missing specs. > - The new IO subsystem is mostly functional, but there are still > many methods that are not implemented yet and we are working on > this. Once it will be complete we will integrate a default runloop > in the VM and expose asynchronous IOs. > > For the near future, the goals are: > > - Improving the compiler. Currently compile time has not really been > optimized yet. > - Be able to run IRB. We are almost there. > - Remove the libffi code used to call C/ObjC implementations and > instead JIT compile stubs and insert them in the dispatcher cache. > We should be way closer to ObjC then (and maybe faster once we > enable secondary compilations of hotspots and inline the stubs). > - Rewrite the BridgeSupport side using LLVM types. > - Implement full concurrent threading! (this is a big one :-)). > - And many more (check the TODO file for more info). > > Once we arrive at a point when the branch is as functional as trunk, > it will be merged in trunk and we will then work on stabilizing it, > to later on release it as 0.5. The schedule for this release is > unknown, it will be released when it will be ready (preferably this > year though). > > If you want to help let me know! > > Laurent > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From lsansonetti at apple.com Sat Mar 28 12:56:24 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Sat, 28 Mar 2009 12:56:24 -0700 Subject: [MacRuby-devel] branches/experimental In-Reply-To: References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> Message-ID: <0EEF81FD-04BD-4324-B013-3753771E4F9E@apple.com> Most likely 0.6, unless someone volunteers to do it now :-) Laurent On Mar 28, 2009, at 12:48 PM, Jordan Breeding wrote: > Will OSA support be a 0.5 or a 0.6 task? > > On Mar 28, 2009, at 14:37, Laurent Sansonetti > wrote: > >> Hi guys, >> >> As some of you already noticed we have been working on a branch for >> a few weeks and I thought it's now time to describe what has been >> done and were we are going exactly. >> >> I wrote a blog entry here: http://www.macruby.org/blog/2009/03/28/experimental-branch.html >> >> 2 big features in this branch: a LLVM-based JIT compiler and a new >> IO subsystem. Obviously performance-related, we really need to be >> faster. >> >> Current status of the branch: >> >> - The compiler is now able to pass most of the Ruby AST. It >> compiles nodes directly from the parser in a lazy fashion. >> - Only JIT compilation for the moment (AOT is planned for later). >> - The VM is still under development, it's not as complete as the >> compiler yet. >> - Early performance benchmarks are very promising. >> - By the time of this writing, we pass the vast majority of the >> language RubySpecs (a week ago we weren't even able to even >> bootstrap mspec!), about 1190 expectations. Work is very active in >> this area, we are also making sure the specs do run with the >> original Ruby 1.9 and writing missing specs. >> - The new IO subsystem is mostly functional, but there are still >> many methods that are not implemented yet and we are working on >> this. Once it will be complete we will integrate a default runloop >> in the VM and expose asynchronous IOs. >> >> For the near future, the goals are: >> >> - Improving the compiler. Currently compile time has not really >> been optimized yet. >> - Be able to run IRB. We are almost there. >> - Remove the libffi code used to call C/ObjC implementations and >> instead JIT compile stubs and insert them in the dispatcher cache. >> We should be way closer to ObjC then (and maybe faster once we >> enable secondary compilations of hotspots and inline the stubs). >> - Rewrite the BridgeSupport side using LLVM types. >> - Implement full concurrent threading! (this is a big one :-)). >> - And many more (check the TODO file for more info). >> >> Once we arrive at a point when the branch is as functional as >> trunk, it will be merged in trunk and we will then work on >> stabilizing it, to later on release it as 0.5. The schedule for >> this release is unknown, it will be released when it will be ready >> (preferably this year though). >> >> If you want to help let me know! >> >> Laurent >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From jordan.breeding at mac.com Sat Mar 28 13:00:33 2009 From: jordan.breeding at mac.com (Jordan Breeding) Date: Sat, 28 Mar 2009 15:00:33 -0500 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <0EEF81FD-04BD-4324-B013-3753771E4F9E@apple.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <0EEF81FD-04BD-4324-B013-3753771E4F9E@apple.com> Message-ID: Well if you offer guidance and the target for 0.5 really is just "this year" then I might be able to give it a shot and help out. Of course that also depends on whether I get a job immediately after graduation in August and how busy that keeps me. On Mar 28, 2009, at 14:56, Laurent Sansonetti wrote: > Most likely 0.6, unless someone volunteers to do it now :-) > > Laurent > > On Mar 28, 2009, at 12:48 PM, Jordan Breeding wrote: > >> Will OSA support be a 0.5 or a 0.6 task? >> >> On Mar 28, 2009, at 14:37, Laurent Sansonetti >> wrote: >> >>> Hi guys, >>> >>> As some of you already noticed we have been working on a branch >>> for a few weeks and I thought it's now time to describe what has >>> been done and were we are going exactly. >>> >>> I wrote a blog entry here: http://www.macruby.org/blog/2009/03/28/experimental-branch.html >>> >>> 2 big features in this branch: a LLVM-based JIT compiler and a new >>> IO subsystem. Obviously performance-related, we really need to be >>> faster. >>> >>> Current status of the branch: >>> >>> - The compiler is now able to pass most of the Ruby AST. It >>> compiles nodes directly from the parser in a lazy fashion. >>> - Only JIT compilation for the moment (AOT is planned for later). >>> - The VM is still under development, it's not as complete as the >>> compiler yet. >>> - Early performance benchmarks are very promising. >>> - By the time of this writing, we pass the vast majority of the >>> language RubySpecs (a week ago we weren't even able to even >>> bootstrap mspec!), about 1190 expectations. Work is very active in >>> this area, we are also making sure the specs do run with the >>> original Ruby 1.9 and writing missing specs. >>> - The new IO subsystem is mostly functional, but there are still >>> many methods that are not implemented yet and we are working on >>> this. Once it will be complete we will integrate a default runloop >>> in the VM and expose asynchronous IOs. >>> >>> For the near future, the goals are: >>> >>> - Improving the compiler. Currently compile time has not really >>> been optimized yet. >>> - Be able to run IRB. We are almost there. >>> - Remove the libffi code used to call C/ObjC implementations and >>> instead JIT compile stubs and insert them in the dispatcher cache. >>> We should be way closer to ObjC then (and maybe faster once we >>> enable secondary compilations of hotspots and inline the stubs). >>> - Rewrite the BridgeSupport side using LLVM types. >>> - Implement full concurrent threading! (this is a big one :-)). >>> - And many more (check the TODO file for more info). >>> >>> Once we arrive at a point when the branch is as functional as >>> trunk, it will be merged in trunk and we will then work on >>> stabilizing it, to later on release it as 0.5. The schedule for >>> this release is unknown, it will be released when it will be ready >>> (preferably this year though). >>> >>> If you want to help let me know! >>> >>> Laurent >>> _______________________________________________ >>> MacRuby-devel mailing list >>> MacRuby-devel at lists.macosforge.org >>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From rich at infoether.com Sat Mar 28 14:00:16 2009 From: rich at infoether.com (Richard Kilmer) Date: Sat, 28 Mar 2009 17:00:16 -0400 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> Message-ID: This is awesome new Laurent! You have done amazing work to get this far and I know you will get it all the way. Also Eloy and Vincent helped a lot with both the VM and specs and tests. Thanks to all of you! Do you have any plans for enlisting specific support you need to move things along faster? Best, Rich On Mar 28, 2009, at 3:37 PM, Laurent Sansonetti wrote: > Hi guys, > > As some of you already noticed we have been working on a branch for > a few weeks and I thought it's now time to describe what has been > done and were we are going exactly. > > I wrote a blog entry here: http://www.macruby.org/blog/2009/03/28/experimental-branch.html > > 2 big features in this branch: a LLVM-based JIT compiler and a new > IO subsystem. Obviously performance-related, we really need to be > faster. > > Current status of the branch: > > - The compiler is now able to pass most of the Ruby AST. It compiles > nodes directly from the parser in a lazy fashion. > - Only JIT compilation for the moment (AOT is planned for later). > - The VM is still under development, it's not as complete as the > compiler yet. > - Early performance benchmarks are very promising. > - By the time of this writing, we pass the vast majority of the > language RubySpecs (a week ago we weren't even able to even > bootstrap mspec!), about 1190 expectations. Work is very active in > this area, we are also making sure the specs do run with the > original Ruby 1.9 and writing missing specs. > - The new IO subsystem is mostly functional, but there are still > many methods that are not implemented yet and we are working on > this. Once it will be complete we will integrate a default runloop > in the VM and expose asynchronous IOs. > > For the near future, the goals are: > > - Improving the compiler. Currently compile time has not really been > optimized yet. > - Be able to run IRB. We are almost there. > - Remove the libffi code used to call C/ObjC implementations and > instead JIT compile stubs and insert them in the dispatcher cache. > We should be way closer to ObjC then (and maybe faster once we > enable secondary compilations of hotspots and inline the stubs). > - Rewrite the BridgeSupport side using LLVM types. > - Implement full concurrent threading! (this is a big one :-)). > - And many more (check the TODO file for more info). > > Once we arrive at a point when the branch is as functional as trunk, > it will be merged in trunk and we will then work on stabilizing it, > to later on release it as 0.5. The schedule for this release is > unknown, it will be released when it will be ready (preferably this > year though). > > If you want to help let me know! > > Laurent > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From ruby-noreply at macosforge.org Sat Mar 28 15:42:00 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Sat, 28 Mar 2009 22:42:00 -0000 Subject: [MacRuby-devel] [MacRuby] #238: rdoc memleaks & segfaults when installing gems Message-ID: <049.631f6f4547e8173e58fde357da358663@macosforge.org> #238: rdoc memleaks & segfaults when installing gems --------------------------------+------------------------------------------- Reporter: ted@? | Owner: lsansonetti@? Type: defect | Status: new Priority: critical | Milestone: Component: MacRuby | Keywords: gem install rdoc --------------------------------+------------------------------------------- Was trying to install some dependencies for a gem i am working on (so i can test it on macruby). I get a lot of mentions that macruby has a non- zero refcount (all the info is in the trace). http://gist.github.com/87225 installing w/ --no-rdoc & --no-ri works just fine :) -- Ticket URL: MacRuby From rdogra at earthlink.net Sat Mar 28 16:45:56 2009 From: rdogra at earthlink.net (=?UTF-8?B?4KSw4KSc4KSo4KWA4KS2?=) Date: Sat, 28 Mar 2009 16:45:56 -0700 Subject: [MacRuby-devel] macruby experimental benchmark Message-ID: Hello, banchmark is already impressive when compared to 0.4. I ran the benchmark with: 1. clang -03 -arch i386 macruby 0.4 2. clang -O3 -arch i386 macruby 0.5 3. gcc-4.2 -O3 -arch i386 macruby 0.5 (clang is the C/ObjC compiler native to LLVM) PS. clang currently doesn?t pass rake spec:ci ( ============== clang -03 -arch i386 macruby 0.4 ============================ ~/Developer/MacRuby-> ./miniruby -I./lib ../macruby-experimental/ bench.rb user system total real 10 fib(30) 2.610000 0.010000 2.620000 ( 2.623886) 10 fib(35) 28.720000 0.060000 28.780000 ( 28.809891) tak 2.530000 0.000000 2.530000 ( 2.524596) tarai 2.060000 0.010000 2.070000 ( 2.066017) ackermann 2.410000 0.000000 2.410000 ( 2.410433) 10000000 times loop 0.330000 0.000000 0.330000 ( 0.322564) 30000000 times loop 3.240000 0.000000 3.240000 ( 3.243957) 10000000 while loop 0.890000 0.000000 0.890000 ( 0.891436) 60000000 while loop 5.500000 0.020000 5.520000 ( 5.521020) 30000000 msg w/ 0 arg 3.940000 0.010000 3.950000 ( 3.947202) 30000000 msg w/ 1 arg 4.010000 0.010000 4.020000 ( 4.026623) 10000000 super w/ 0 arg 7.420000 0.020000 7.440000 ( 7.437519) 10000000 super w/ 1 arg 9.540000 0.020000 9.560000 ( 9.592043) 10000000 #send 5.280000 0.020000 5.300000 ( 5.309358) 10000000 ivar read 2.040000 0.000000 2.040000 ( 2.053376) 30000000 ivar read 6.100000 0.020000 6.120000 ( 6.119993) 10000000 ivar write 2.150000 0.010000 2.160000 ( 2.152597) 30000000 ivar write 6.440000 0.010000 6.450000 ( 6.449781) 30000000 const 1.800000 0.010000 1.810000 ( 1.803391) 30000000 yield 3.520000 0.010000 3.530000 ( 3.519516) 30000000 msg w/ block+yield 6.400000 0.010000 6.410000 ( 6.418424) 30000000 Proc#call 8.640000 0.030000 8.670000 ( 8.692045) 30000000 while break 2.510000 0.000000 2.510000 ( 2.530938) 10000000 block break 13.810000 0.550000 14.360000 ( 8.429742) 30000000 while next 2.290000 0.000000 2.290000 ( 2.295239) 10000000 block next 2.690000 0.010000 2.700000 ( 2.702703) 60000000 begin w/o exception 4.980000 0.010000 4.990000 ( 5.014342) 60000000 ensure w/o exception 3.640000 0.010000 3.650000 ( 3.647675) 50000 raise 2.580000 0.170000 2.750000 ( 2.077362) =========== clang -O3 -arch i386 macruby 0.5 ===================================== ./miniruby -I./lib bench.rb user system total real 10 fib(30) 0.350000 0.000000 0.350000 ( 0.353159) 10 fib(35) 3.890000 0.000000 3.890000 ( 3.905832) tak 0.220000 0.010000 0.230000 ( 0.224368) tarai 0.170000 0.000000 0.170000 ( 0.162998) ackermann 0.210000 0.000000 0.210000 ( 0.211560) 10000000 times loop 0.140000 0.000000 0.140000 ( 0.138711) 30000000 times loop 1.380000 0.000000 1.380000 ( 1.386931) 10000000 while loop 0.080000 0.000000 0.080000 ( 0.082421) 60000000 while loop 0.500000 0.000000 0.500000 ( 0.493618) 30000000 msg w/ 0 arg 1.050000 0.000000 1.050000 ( 1.052416) 30000000 msg w/ 1 arg 1.650000 0.010000 1.660000 ( 1.646295) 10000000 super w/ 0 arg 1.000000 0.000000 1.000000 ( 1.003267) 10000000 super w/ 1 arg 1.350000 0.000000 1.350000 ( 1.357992) 10000000 #send 0.450000 0.000000 0.450000 ( 0.447047) 10000000 ivar read 0.150000 0.000000 0.150000 ( 0.151039) 30000000 ivar read 0.450000 0.000000 0.450000 ( 0.452225) 10000000 ivar write 0.180000 0.000000 0.180000 ( 0.178246) 30000000 ivar write 0.530000 0.000000 0.530000 ( 0.534289) 30000000 const 0.500000 0.000000 0.500000 ( 0.510684) 30000000 yield 1.190000 0.010000 1.200000 ( 1.194234) 30000000 msg w/ block+yield 3.420000 0.000000 3.420000 ( 3.425893) 30000000 Proc#call 2.340000 0.010000 2.350000 ( 2.346405) 30000000 while break 0.190000 0.000000 0.190000 ( 0.191913) 10000000 block break 1.660000 0.000000 1.660000 ( 1.670270) 30000000 while next 0.240000 0.000000 0.240000 ( 0.246752) 10000000 block next 1.630000 0.000000 1.630000 ( 1.640193) 60000000 begin w/o exception 0.490000 0.000000 0.490000 ( 0.493330) 60000000 ensure w/o exception 0.350000 0.010000 0.360000 ( 0.342626) 50000 raise 3.370000 0.120000 3.490000 ( 1.796350) =========== gcc-4.2 -O3 -arch i386 macruby 0.5 ===================================== ~/Developer/macruby-experimental-> ./miniruby -I./lib bench.rb user system total real 10 fib(30) 0.350000 0.000000 0.350000 ( 0.352703) 10 fib(35) 3.890000 0.010000 3.900000 ( 3.924630) tak 0.230000 0.000000 0.230000 ( 0.224254) tarai 0.160000 0.000000 0.160000 ( 0.164155) ackermann 0.210000 0.000000 0.210000 ( 0.212784) 10000000 times loop 0.150000 0.010000 0.160000 ( 0.153406) 30000000 times loop 1.520000 0.000000 1.520000 ( 1.529161) 10000000 while loop 0.080000 0.000000 0.080000 ( 0.083568) 60000000 while loop 0.490000 0.000000 0.490000 ( 0.497827) 30000000 msg w/ 0 arg 1.150000 0.010000 1.160000 ( 1.163730) 30000000 msg w/ 1 arg 1.650000 0.000000 1.650000 ( 1.658609) 10000000 super w/ 0 arg 0.990000 0.000000 0.990000 ( 0.995326) 10000000 super w/ 1 arg 1.380000 0.000000 1.380000 ( 1.388644) 10000000 #send 0.440000 0.000000 0.440000 ( 0.449934) 10000000 ivar read 0.150000 0.000000 0.150000 ( 0.152117) 30000000 ivar read 0.450000 0.000000 0.450000 ( 0.454063) 10000000 ivar write 0.180000 0.000000 0.180000 ( 0.179490) 30000000 ivar write 0.540000 0.000000 0.540000 ( 0.536518) 30000000 const 0.510000 0.000000 0.510000 ( 0.511782) 30000000 yield 1.280000 0.010000 1.290000 ( 1.281898) 30000000 msg w/ block+yield 3.450000 0.000000 3.450000 ( 3.468621) 30000000 Proc#call 2.220000 0.010000 2.230000 ( 2.236161) 30000000 while break 0.190000 0.000000 0.190000 ( 0.192734) 10000000 block break 1.750000 0.000000 1.750000 ( 1.762103) 30000000 while next 0.240000 0.000000 0.240000 ( 0.246971) 10000000 block next 1.770000 0.010000 1.780000 ( 1.771981) 60000000 begin w/o exception 0.500000 0.000000 0.500000 ( 0.494001) 60000000 ensure w/o exception 0.340000 0.000000 0.340000 ( 0.344364) 50000 raise 2.850000 0.110000 2.960000 ( 1.525959) From lsansonetti at apple.com Sat Mar 28 19:04:18 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Sat, 28 Mar 2009 19:04:18 -0700 Subject: [MacRuby-devel] macruby experimental benchmark In-Reply-To: References: Message-ID: <5E98826C-09BE-40D1-B74F-7F0A9F03818A@apple.com> Hello, I'm curious, how did you manage to build MacRuby with clang? I thought it did not support C++ yet. Did you use llvm-g++ maybe? Laurent On Mar 28, 2009, at 4:45 PM, ????? wrote: > Hello, > > banchmark is already impressive when compared to 0.4. > > I ran the benchmark with: > 1. clang -03 -arch i386 macruby 0.4 > 2. clang -O3 -arch i386 macruby 0.5 > 3. gcc-4.2 -O3 -arch i386 macruby 0.5 > > (clang is the C/ObjC compiler native to LLVM) > > PS. clang currently doesn?t pass rake spec:ci ( > > ============== clang -03 -arch i386 macruby 0.4 > ============================ > ~/Developer/MacRuby-> ./miniruby -I./lib ../macruby-experimental/ > bench.rb > user system total > real > 10 fib(30) 2.610000 0.010000 2.620000 > ( 2.623886) > 10 fib(35) 28.720000 0.060000 28.780000 > ( 28.809891) > tak 2.530000 0.000000 2.530000 > ( 2.524596) > tarai 2.060000 0.010000 2.070000 > ( 2.066017) > ackermann 2.410000 0.000000 2.410000 > ( 2.410433) > 10000000 times loop 0.330000 0.000000 0.330000 > ( 0.322564) > 30000000 times loop 3.240000 0.000000 3.240000 > ( 3.243957) > 10000000 while loop 0.890000 0.000000 0.890000 > ( 0.891436) > 60000000 while loop 5.500000 0.020000 5.520000 > ( 5.521020) > 30000000 msg w/ 0 arg 3.940000 0.010000 3.950000 > ( 3.947202) > 30000000 msg w/ 1 arg 4.010000 0.010000 4.020000 > ( 4.026623) > 10000000 super w/ 0 arg 7.420000 0.020000 7.440000 > ( 7.437519) > 10000000 super w/ 1 arg 9.540000 0.020000 9.560000 > ( 9.592043) > 10000000 #send 5.280000 0.020000 5.300000 > ( 5.309358) > 10000000 ivar read 2.040000 0.000000 2.040000 > ( 2.053376) > 30000000 ivar read 6.100000 0.020000 6.120000 > ( 6.119993) > 10000000 ivar write 2.150000 0.010000 2.160000 > ( 2.152597) > 30000000 ivar write 6.440000 0.010000 6.450000 > ( 6.449781) > 30000000 const 1.800000 0.010000 1.810000 > ( 1.803391) > 30000000 yield 3.520000 0.010000 3.530000 > ( 3.519516) > 30000000 msg w/ block+yield 6.400000 0.010000 6.410000 > ( 6.418424) > 30000000 Proc#call 8.640000 0.030000 8.670000 > ( 8.692045) > 30000000 while break 2.510000 0.000000 2.510000 > ( 2.530938) > 10000000 block break 13.810000 0.550000 14.360000 > ( 8.429742) > 30000000 while next 2.290000 0.000000 2.290000 > ( 2.295239) > 10000000 block next 2.690000 0.010000 2.700000 > ( 2.702703) > 60000000 begin w/o exception 4.980000 0.010000 4.990000 > ( 5.014342) > 60000000 ensure w/o exception 3.640000 0.010000 3.650000 > ( 3.647675) > 50000 raise 2.580000 0.170000 2.750000 > ( 2.077362) > > =========== clang -O3 -arch i386 macruby 0.5 > ===================================== > ./miniruby -I./lib bench.rb > user system total > real > 10 fib(30) 0.350000 0.000000 0.350000 > ( 0.353159) > 10 fib(35) 3.890000 0.000000 3.890000 > ( 3.905832) > tak 0.220000 0.010000 0.230000 > ( 0.224368) > tarai 0.170000 0.000000 0.170000 > ( 0.162998) > ackermann 0.210000 0.000000 0.210000 > ( 0.211560) > 10000000 times loop 0.140000 0.000000 0.140000 > ( 0.138711) > 30000000 times loop 1.380000 0.000000 1.380000 > ( 1.386931) > 10000000 while loop 0.080000 0.000000 0.080000 > ( 0.082421) > 60000000 while loop 0.500000 0.000000 0.500000 > ( 0.493618) > 30000000 msg w/ 0 arg 1.050000 0.000000 1.050000 > ( 1.052416) > 30000000 msg w/ 1 arg 1.650000 0.010000 1.660000 > ( 1.646295) > 10000000 super w/ 0 arg 1.000000 0.000000 1.000000 > ( 1.003267) > 10000000 super w/ 1 arg 1.350000 0.000000 1.350000 > ( 1.357992) > 10000000 #send 0.450000 0.000000 0.450000 > ( 0.447047) > 10000000 ivar read 0.150000 0.000000 0.150000 > ( 0.151039) > 30000000 ivar read 0.450000 0.000000 0.450000 > ( 0.452225) > 10000000 ivar write 0.180000 0.000000 0.180000 > ( 0.178246) > 30000000 ivar write 0.530000 0.000000 0.530000 > ( 0.534289) > 30000000 const 0.500000 0.000000 0.500000 > ( 0.510684) > 30000000 yield 1.190000 0.010000 1.200000 > ( 1.194234) > 30000000 msg w/ block+yield 3.420000 0.000000 3.420000 > ( 3.425893) > 30000000 Proc#call 2.340000 0.010000 2.350000 > ( 2.346405) > 30000000 while break 0.190000 0.000000 0.190000 > ( 0.191913) > 10000000 block break 1.660000 0.000000 1.660000 > ( 1.670270) > 30000000 while next 0.240000 0.000000 0.240000 > ( 0.246752) > 10000000 block next 1.630000 0.000000 1.630000 > ( 1.640193) > 60000000 begin w/o exception 0.490000 0.000000 0.490000 > ( 0.493330) > 60000000 ensure w/o exception 0.350000 0.010000 0.360000 > ( 0.342626) > 50000 raise 3.370000 0.120000 3.490000 > ( 1.796350) > > > =========== gcc-4.2 -O3 -arch i386 macruby 0.5 > ===================================== > ~/Developer/macruby-experimental-> ./miniruby -I./lib bench.rb > user system total > real > 10 fib(30) 0.350000 0.000000 0.350000 > ( 0.352703) > 10 fib(35) 3.890000 0.010000 3.900000 > ( 3.924630) > tak 0.230000 0.000000 0.230000 > ( 0.224254) > tarai 0.160000 0.000000 0.160000 > ( 0.164155) > ackermann 0.210000 0.000000 0.210000 > ( 0.212784) > 10000000 times loop 0.150000 0.010000 0.160000 > ( 0.153406) > 30000000 times loop 1.520000 0.000000 1.520000 > ( 1.529161) > 10000000 while loop 0.080000 0.000000 0.080000 > ( 0.083568) > 60000000 while loop 0.490000 0.000000 0.490000 > ( 0.497827) > 30000000 msg w/ 0 arg 1.150000 0.010000 1.160000 > ( 1.163730) > 30000000 msg w/ 1 arg 1.650000 0.000000 1.650000 > ( 1.658609) > 10000000 super w/ 0 arg 0.990000 0.000000 0.990000 > ( 0.995326) > 10000000 super w/ 1 arg 1.380000 0.000000 1.380000 > ( 1.388644) > 10000000 #send 0.440000 0.000000 0.440000 > ( 0.449934) > 10000000 ivar read 0.150000 0.000000 0.150000 > ( 0.152117) > 30000000 ivar read 0.450000 0.000000 0.450000 > ( 0.454063) > 10000000 ivar write 0.180000 0.000000 0.180000 > ( 0.179490) > 30000000 ivar write 0.540000 0.000000 0.540000 > ( 0.536518) > 30000000 const 0.510000 0.000000 0.510000 > ( 0.511782) > 30000000 yield 1.280000 0.010000 1.290000 > ( 1.281898) > 30000000 msg w/ block+yield 3.450000 0.000000 3.450000 > ( 3.468621) > 30000000 Proc#call 2.220000 0.010000 2.230000 > ( 2.236161) > 30000000 while break 0.190000 0.000000 0.190000 > ( 0.192734) > 10000000 block break 1.750000 0.000000 1.750000 > ( 1.762103) > 30000000 while next 0.240000 0.000000 0.240000 > ( 0.246971) > 10000000 block next 1.770000 0.010000 1.780000 > ( 1.771981) > 60000000 begin w/o exception 0.500000 0.000000 0.500000 > ( 0.494001) > 60000000 ensure w/o exception 0.340000 0.000000 0.340000 > ( 0.344364) > 50000 raise 2.850000 0.110000 2.960000 > ( 1.525959) > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From charles.nutter at sun.com Sat Mar 28 21:46:34 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Sat, 28 Mar 2009 23:46:34 -0500 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> Message-ID: <49CEFD2A.6030708@sun.com> Laurent Sansonetti wrote: > Hi guys, > > As some of you already noticed we have been working on a branch for a > few weeks and I thought it's now time to describe what has been done and > were we are going exactly. Very cool stuff...some low-level benchmarks seem to have really excellent performance. I know you probably don't need bugs filed against 'experimental' yet, but I had a couple questions: 1. Is there a way to tell what's compiling and what isn't? Some benchmarks I run are fast, and some others are incredibly slow. I'd like to know what's representative of actual performance. 2. Is there a way to turn off peephole optimizations? Lots of benchmarks out there, including some we have in JRuby, have a lot of dead code (like repeated assignments to a local variable). That's going to confound a lot of benchmarking, since most of the benchmark isn't actually being run. JRuby has a flag to turn off peephole optz (though I often forget to turn it on). 3. You probably know about these, but I noticed there are numerous problems with eval: * Running an eval benchmark caused the system to blow up, claiming it ran out of space for machine code * bindings appear to be missing altogether * The binding associated with a block does not appear to work, as in p = proc { }; eval 'something', p.binding. This troublesome feature is one reason many local variable optimizations are much more difficult. I'm looking forward to seeing future results and getting some guidance on where we can expect to see the best performance right now. I'd also love to talk about some techniques you're using to see if they'd be applicable for JRuby. - Charlie From lsansonetti at apple.com Sat Mar 28 22:09:58 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Sat, 28 Mar 2009 22:09:58 -0700 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <49CEFD2A.6030708@sun.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <49CEFD2A.6030708@sun.com> Message-ID: Hi Charles, On Mar 28, 2009, at 9:46 PM, Charles Oliver Nutter wrote: > Laurent Sansonetti wrote: >> Hi guys, >> As some of you already noticed we have been working on a branch for >> a few weeks and I thought it's now time to describe what has been >> done and were we are going exactly. > > Very cool stuff...some low-level benchmarks seem to have really > excellent performance. Thank you :) > I know you probably don't need bugs filed against 'experimental' > yet, but I had a couple questions: > > 1. Is there a way to tell what's compiling and what isn't? Some > benchmarks I run are fast, and some others are incredibly slow. I'd > like to know what's representative of actual performance. Currently everything is compiled. It is possible to dump the LLVM IR by turning on the ROXOR_DUMP_IR variable in roxor.cpp. Generally when something is incredibly slow it's because of a runtime bug and not the compiler, though. > 2. Is there a way to turn off peephole optimizations? Lots of > benchmarks out there, including some we have in JRuby, have a lot of > dead code (like repeated assignments to a local variable). That's > going to confound a lot of benchmarking, since most of the benchmark > isn't actually being run. JRuby has a flag to turn off peephole optz > (though I often forget to turn it on). It's possible by modifying the source code and comment the call to createInstructionCombiningPass() and createCFGSimplificationPass(), but I do not recommend to remove these because I think it would break the way we compile Dwarf exception handlers in blocks. # In my personal benchmark suite I try to make sure these optimizations do not provide false positive numbers when comparing against YARV. > 3. You probably know about these, but I noticed there are numerous > problems with eval: > > * Running an eval benchmark caused the system to blow up, claiming > it ran out of space for machine code Yes, currently calling eval with a literal string will call the JIT, so doing this in a loop will most likely eat all your memory :-) I plan to address that later by fallbacking to the LLVM interpreter in some cases, but I doubt this will affect real-world applications. Also, there are ways to improve the JIT (nothing has been done yet). > * bindings appear to be missing altogether > * The binding associated with a block does not appear to work, as in > p = proc { }; eval 'something', p.binding. This troublesome feature > is one reason many local variable optimizations are much more > difficult. Yes as you noticed Binding has not been implemented yet :-( This is on the very top of my TODO list (needed for IRB) and I already know how to implement it without disabling our current "local variables into CPU registers" optimization. > I'm looking forward to seeing future results and getting some > guidance on where we can expect to see the best performance right > now. I'd also love to talk about some techniques you're using to see > if they'd be applicable for JRuby. Absolutely :-) Laurent From charles.nutter at sun.com Sat Mar 28 22:38:00 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Sun, 29 Mar 2009 00:38:00 -0500 Subject: [MacRuby-devel] branches/experimental In-Reply-To: References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <49CEFD2A.6030708@sun.com> Message-ID: <49CF0938.4060800@sun.com> Laurent Sansonetti wrote: > It's possible by modifying the source code and comment the call to > createInstructionCombiningPass() and createCFGSimplificationPass(), but > I do not recommend to remove these because I think it would break the > way we compile Dwarf exception handlers in blocks. > > # In my personal benchmark suite I try to make sure these optimizations > do not provide false positive numbers when comparing against YARV. Ok, it would be nice if there were a simpler way to turn those off; I don't want to break 'experimental' completely, but it would be nice to get real benchmark results in these cases. > Yes, currently calling eval with a literal string will call the JIT, so > doing this in a loop will most likely eat all your memory :-) > > I plan to address that later by fallbacking to the LLVM interpreter in > some cases, but I doubt this will affect real-world applications. Also, > there are ways to improve the JIT (nothing has been done yet). In Rails, as recently as 2.2 (I haven't checked 2.3) there's a small bit of eval'ed code used to look up constants. Before we fixed our parser performance, we found it was a bottleneck. So that's at least one real-world case. > Yes as you noticed Binding has not been implemented yet :-( This is on > the very top of my TODO list (needed for IRB) and I already know how to > implement it without disabling our current "local variables into CPU > registers" optimization. How will you do that? Given that a block can be used as a binding, you can't statically inspect contained blocks to determine which variables are used and which aren't. For example, this code: def foo a = 1 bar { } puts a end def bar(&b) eval "a = 2", b.binding end foo This should print out "2" but prints out "1" in 'experimental' right now. This one feature is the primary reason JRuby can only put local variables in registers when there's no blocks present. When there's a block present, any variable can be accessed via its binding at any time. I've argued for this feature to be removed, but I have been unsuccessful. Current JRuby is also putting local variables in registers (via HotSpot doing so for Java locals) when there's no blocks present. - Charlie From rdogra at earthlink.net Sat Mar 28 20:09:39 2009 From: rdogra at earthlink.net (=?UTF-8?B?4KSw4KSc4KSo4KWA4KS2?=) Date: Sat, 28 Mar 2009 20:09:39 -0700 Subject: [MacRuby-devel] macruby experimental benchmark Message-ID: <10FE165C-23E9-487C-9B8D-ECA91F36D7C5@earthlink.net> > Hello, > I'm curious, how did you manage to build MacRuby with clang? I thought > it did not support C++ yet. Did you use llvm-g++ maybe? > Laurent > I just used g++. I haven't built llvm-gcc. That is too much trouble. when '.c' then ['clang', @cflags] when '.cpp' then ['/usr/bin/g++', @cxxflags] when '.m' then ['clang', @objc_cflags] From lsansonetti at apple.com Sun Mar 29 10:09:57 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Sun, 29 Mar 2009 10:09:57 -0700 Subject: [MacRuby-devel] macruby experimental benchmark In-Reply-To: <10FE165C-23E9-487C-9B8D-ECA91F36D7C5@earthlink.net> References: <10FE165C-23E9-487C-9B8D-ECA91F36D7C5@earthlink.net> Message-ID: On Mar 28, 2009, at 8:09 PM, ????? wrote: >> Hello, >> I'm curious, how did you manage to build MacRuby with clang? I >> thought >> it did not support C++ yet. Did you use llvm-g++ maybe? >> Laurent >> > > I just used g++. I haven't built llvm-gcc. That is too much trouble. > > when '.c' then ['clang', @cflags] > when '.cpp' then ['/usr/bin/g++', @cxxflags] > when '.m' then ['clang', @objc_cflags] Oh I see, that's very cool. In fact I was considering doing that and investigating if it's possible to retrieve the IR from clang at runtime and do some inlining... Laurent From lsansonetti at apple.com Sun Mar 29 10:12:29 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Sun, 29 Mar 2009 10:12:29 -0700 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <49CF0938.4060800@sun.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <49CEFD2A.6030708@sun.com> <49CF0938.4060800@sun.com> Message-ID: <977D2D29-EF12-42C6-9035-3249132CE09A@apple.com> On Mar 28, 2009, at 10:38 PM, Charles Oliver Nutter wrote: > Laurent Sansonetti wrote: >> It's possible by modifying the source code and comment the call to >> createInstructionCombiningPass() and createCFGSimplificationPass(), >> but I do not recommend to remove these because I think it would >> break the way we compile Dwarf exception handlers in blocks. >> # In my personal benchmark suite I try to make sure these >> optimizations do not provide false positive numbers when comparing >> against YARV. > > Ok, it would be nice if there were a simpler way to turn those off; > I don't want to break 'experimental' completely, but it would be > nice to get real benchmark results in these cases. I don't think it's a good idea to provide a way to turn off optimizations and I do not see the point in benchmarking dead code in general (I would never do this). >> Yes, currently calling eval with a literal string will call the >> JIT, so doing this in a loop will most likely eat all your memory :-) >> I plan to address that later by fallbacking to the LLVM interpreter >> in some cases, but I doubt this will affect real-world >> applications. Also, there are ways to improve the JIT (nothing has >> been done yet). > > In Rails, as recently as 2.2 (I haven't checked 2.3) there's a small > bit of eval'ed code used to look up constants. Before we fixed our > parser performance, we found it was a bottleneck. So that's at least > one real-world case. Good to know, I just hope they are not doing this 30 million times in a loop or something :-) >> Yes as you noticed Binding has not been implemented yet :-( This is >> on the very top of my TODO list (needed for IRB) and I already know >> how to implement it without disabling our current "local variables >> into CPU registers" optimization. > > How will you do that? Given that a block can be used as a binding, > you can't statically inspect contained blocks to determine which > variables are used and which aren't. For example, this code: > > def foo > a = 1 > bar { } > puts a > end > > def bar(&b) > eval "a = 2", b.binding > end > > foo > > This should print out "2" but prints out "1" in 'experimental' right > now. Yes, Binding is not implemented yet. Do not worry I have read the MRI source code and know how Binding works and how to provide a compliant implementation. Please stay tuned. Laurent From lsansonetti at apple.com Sun Mar 29 11:29:33 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Sun, 29 Mar 2009 11:29:33 -0700 Subject: [MacRuby-devel] branches/experimental In-Reply-To: References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <0EEF81FD-04BD-4324-B013-3753771E4F9E@apple.com> Message-ID: So, I think there are 2 things to do in order to achieve that goal: 1) making MacRuby an OSA component, so that it's recognized by the system (osalang, Script Edit, etc.). I have no idea on how to implement this. If you're willing to check it out, the documentation is there: http://developer.apple.com/DOCUMENTATION/Carbon/Reference/Open_Scripti_Architecture/Reference/reference.html I unfortunately think that nobody made an open-source OSA component yet. In fact, AFAIK the only other OSA component is a JavaScript implementation which is not maintained anymore (and closed-source). 2) bundling an API to send AppleEvents. This part is not hard, since we do have RubyOSA, rb-appscript or ScriptingBridge.framework to reuse. I guess we would have to do some design conversation first and see which model we would pick, it's even possible to reuse existing code. Let me know if you want to investigate that and I will try to help :-) Laurent On Mar 28, 2009, at 1:00 PM, Jordan Breeding wrote: > Well if you offer guidance and the target for 0.5 really is just > "this year" then I might be able to give it a shot and help out. > > Of course that also depends on whether I get a job immediately after > graduation in August and how busy that keeps me. > > On Mar 28, 2009, at 14:56, Laurent Sansonetti > wrote: > >> Most likely 0.6, unless someone volunteers to do it now :-) >> >> Laurent >> >> On Mar 28, 2009, at 12:48 PM, Jordan Breeding wrote: >> >>> Will OSA support be a 0.5 or a 0.6 task? >>> >>> On Mar 28, 2009, at 14:37, Laurent Sansonetti >>> wrote: >>> >>>> Hi guys, >>>> >>>> As some of you already noticed we have been working on a branch >>>> for a few weeks and I thought it's now time to describe what has >>>> been done and were we are going exactly. >>>> >>>> I wrote a blog entry here: http://www.macruby.org/blog/2009/03/28/experimental-branch.html >>>> >>>> 2 big features in this branch: a LLVM-based JIT compiler and a >>>> new IO subsystem. Obviously performance-related, we really need >>>> to be faster. >>>> >>>> Current status of the branch: >>>> >>>> - The compiler is now able to pass most of the Ruby AST. It >>>> compiles nodes directly from the parser in a lazy fashion. >>>> - Only JIT compilation for the moment (AOT is planned for later). >>>> - The VM is still under development, it's not as complete as the >>>> compiler yet. >>>> - Early performance benchmarks are very promising. >>>> - By the time of this writing, we pass the vast majority of the >>>> language RubySpecs (a week ago we weren't even able to even >>>> bootstrap mspec!), about 1190 expectations. Work is very active >>>> in this area, we are also making sure the specs do run with the >>>> original Ruby 1.9 and writing missing specs. >>>> - The new IO subsystem is mostly functional, but there are still >>>> many methods that are not implemented yet and we are working on >>>> this. Once it will be complete we will integrate a default >>>> runloop in the VM and expose asynchronous IOs. >>>> >>>> For the near future, the goals are: >>>> >>>> - Improving the compiler. Currently compile time has not really >>>> been optimized yet. >>>> - Be able to run IRB. We are almost there. >>>> - Remove the libffi code used to call C/ObjC implementations and >>>> instead JIT compile stubs and insert them in the dispatcher >>>> cache. We should be way closer to ObjC then (and maybe faster >>>> once we enable secondary compilations of hotspots and inline the >>>> stubs). >>>> - Rewrite the BridgeSupport side using LLVM types. >>>> - Implement full concurrent threading! (this is a big one :-)). >>>> - And many more (check the TODO file for more info). >>>> >>>> Once we arrive at a point when the branch is as functional as >>>> trunk, it will be merged in trunk and we will then work on >>>> stabilizing it, to later on release it as 0.5. The schedule for >>>> this release is unknown, it will be released when it will be >>>> ready (preferably this year though). >>>> >>>> If you want to help let me know! >>>> >>>> Laurent >>>> _______________________________________________ >>>> MacRuby-devel mailing list >>>> MacRuby-devel at lists.macosforge.org >>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >>> _______________________________________________ >>> MacRuby-devel mailing list >>> MacRuby-devel at lists.macosforge.org >>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From charles.nutter at sun.com Sun Mar 29 12:09:33 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Sun, 29 Mar 2009 14:09:33 -0500 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <977D2D29-EF12-42C6-9035-3249132CE09A@apple.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <49CEFD2A.6030708@sun.com> <49CF0938.4060800@sun.com> <977D2D29-EF12-42C6-9035-3249132CE09A@apple.com> Message-ID: <49CFC76D.6090206@sun.com> Laurent Sansonetti wrote: > I don't think it's a good idea to provide a way to turn off > optimizations and I do not see the point in benchmarking dead code in > general (I would never do this). I think it's actually very useful to provide a way to turn off specific optimizations, if only because they may eventually run into cases where they break something. But they're also useful when writing benchmarks that have dead code on purpose... For some benchmarks it's very difficult to get a reasonable measurement without forcing some dead code to run. For example, benchmarking a single local variable access gets completely lost in the method or block invocation that surrounds it. By forcing several successive local variable accesses to execute, you get a better picture of what the actual cost is. At any rate, if you have good benchmarks for things like local variables, we can certainly use those for now. > Good to know, I just hope they are not doing this 30 million times in a > loop or something :-) Well, it gets called numerous times per request. In the end, though, Rails performance has not actually been very execution-bound. We've had Ruby code running faster than Ruby 1.8 for almost two years, but we only recently started to post 10-20% performance gains for Rails itself. Rails performance, and probably most large applications' performance, all seem heavily dependent on core classes being as blazing fast as possible. It's a balancing act, and we often completely ignore execution performance for a whole release to work on core classes instead. > Yes, Binding is not implemented yet. Do not worry I have read the MRI > source code and know how Binding works and how to provide a compliant > implementation. Please stay tuned. Well, I'd certainly like to hear what you're planning for this particular case. Just let me know when you're ready to talk about it. I've gone over several options when optimizing JRuby, and the block-as-binding issue makes most of them infeasible. - Charlie From mattaimonetti at gmail.com Sun Mar 29 14:13:52 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Sun, 29 Mar 2009 14:13:52 -0700 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <49CFC76D.6090206@sun.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <49CEFD2A.6030708@sun.com> <49CF0938.4060800@sun.com> <977D2D29-EF12-42C6-9035-3249132CE09A@apple.com> <49CFC76D.6090206@sun.com> Message-ID: <20fefa50903291413x59864ef7r381171a48dd9aebb@mail.gmail.com> Hi Charlie, I don't think/hope you do it on purpose, but it seems that you're asking questions just to prove that Laurent is wrong and that whatever he will do will end up slowing down the current experimental branch. I understand that you are upset about Antonio Cangiano's blog post with early benchmarks, but I have a hard time telling if you are trying to help or trying to hurt the project. From my view point, it seems like you are disseminating negative information(speculations) designed to undermine the credibility of MacRuby. Let's just wait and see. Regards, - Matt On Sun, Mar 29, 2009 at 12:09 PM, Charles Oliver Nutter < charles.nutter at sun.com> wrote: > Laurent Sansonetti wrote: > >> I don't think it's a good idea to provide a way to turn off optimizations >> and I do not see the point in benchmarking dead code in general (I would >> never do this). >> > > I think it's actually very useful to provide a way to turn off specific > optimizations, if only because they may eventually run into cases where they > break something. But they're also useful when writing benchmarks that have > dead code on purpose... > > For some benchmarks it's very difficult to get a reasonable measurement > without forcing some dead code to run. For example, benchmarking a single > local variable access gets completely lost in the method or block invocation > that surrounds it. By forcing several successive local variable accesses to > execute, you get a better picture of what the actual cost is. > > At any rate, if you have good benchmarks for things like local variables, > we can certainly use those for now. > > Good to know, I just hope they are not doing this 30 million times in a >> loop or something :-) >> > > Well, it gets called numerous times per request. > > In the end, though, Rails performance has not actually been very > execution-bound. We've had Ruby code running faster than Ruby 1.8 for almost > two years, but we only recently started to post 10-20% performance gains for > Rails itself. Rails performance, and probably most large applications' > performance, all seem heavily dependent on core classes being as blazing > fast as possible. It's a balancing act, and we often completely ignore > execution performance for a whole release to work on core classes instead. > > Yes, Binding is not implemented yet. Do not worry I have read the MRI >> source code and know how Binding works and how to provide a compliant >> implementation. Please stay tuned. >> > > Well, I'd certainly like to hear what you're planning for this particular > case. Just let me know when you're ready to talk about it. I've gone over > several options when optimizing JRuby, and the block-as-binding issue makes > most of them infeasible. > > - Charlie > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby-noreply at macosforge.org Sun Mar 29 23:43:55 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 30 Mar 2009 06:43:55 -0000 Subject: [MacRuby-devel] [MacRuby] #239: NSXML classes cannot be modified properly Message-ID: <047.ffe22b2429db4c85653a55f8a3a3cb58@macosforge.org> #239: NSXML classes cannot be modified properly ------------------------------+--------------------------------------------- Reporter: kourge@? | Owner: lsansonetti@? Type: defect | Status: new Priority: major | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- It would appear that NSXML Cocoa classes (such as NSXMLDocument and NSXMLNode) can be opened properly, but modifications made to them fail silently. Example: {{{ >> doc = NSXMLDocument.alloc.initWithXMLString "", options: 0, error: nil => # >> doc.nodesForXPath("root", error: nil) => [#] >> doc.nodesForXPath("root", error: nil)[0].XMLString => "" >> class NSXMLDocument >> def find(path); self.nodesForXPath(path, error: nil); end >> end => nil >> doc.find "root" NoMethodError: undefined method `find' for # from (irb):7 from /usr/local/bin/macirb:12:in `
' >> }}} -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Mon Mar 30 06:36:24 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 30 Mar 2009 13:36:24 -0000 Subject: [MacRuby-devel] [MacRuby] #240: no such file to load -- stringio.rb.bundle when starting irb/gems Message-ID: <042.3b242b694944ae4f01068062cede7a44@macosforge.org> #240: no such file to load -- stringio.rb.bundle when starting irb/gems -------------------------+-------------------------------------------------- Reporter: i@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -------------------------+-------------------------------------------------- I just installed newest (0.4) MacRuby from pkg. When running irb I get: {{{ Last login: Mon Mar 30 15:24:09 on ttys007 [teamon ~] macirb no such file to load -- stringio.rb.bundle irb(main):001:0> exit [teamon ~] macirb --version irb 0.9.5(05/04/13) [teamon ~] macruby --version MacRuby version 0.4 (ruby 1.9.1) [universal-darwin9.5, x86_64] [teamon ~] macirb no such file to load -- stringio.rb.bundle irb(main):001:0> require 'rubygems' /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:14: warning: can't register `name' as an KVO setter (method `setName:') /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:14: warning: can't register `version_requirement' as an KVO setter (method `setVersion_requirement:') /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:84: warning: already initialized constant MUTEX /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:86: warning: already initialized constant RubyGemsPackageVersion /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:91: warning: already initialized constant WIN_PATTERNS /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:841: warning: already initialized constant MARSHAL_SPEC_DIR /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:843: warning: already initialized constant YAML_SPEC_DIR LoadError: no such file to load -- stringio.rb.bundle from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/yaml.rb:9:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/yaml.rb:9:in `' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems/config_file.rb:7:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems/config_file.rb:7:in `' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:883:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:883:in `' from (irb):1:in `require' from (irb):1 from /usr/local/bin/macirb:12:in `
' irb(main):002:0> }}} Same thing when I installed from source. -- Ticket URL: MacRuby From joelr1 at gmail.com Mon Mar 30 07:53:03 2009 From: joelr1 at gmail.com (Joel Reymont) Date: Mon, 30 Mar 2009 15:53:03 +0100 Subject: [MacRuby-devel] # of developers Message-ID: How many people are actively developing MacRuby apart from Laurent? Thanks, Joel --- http://tinyco.de Mac, Lisp, OCaml From johnmacshea at gmail.com Mon Mar 30 08:09:33 2009 From: johnmacshea at gmail.com (John Shea) Date: Mon, 30 Mar 2009 17:09:33 +0200 Subject: [MacRuby-devel] # of developers In-Reply-To: References: Message-ID: <6FAD7F1D-B1BB-496E-8FE9-1760E2038D01@gmail.com> Here is the blurb: http://www.macruby.org/project.html J On Mar 30, 2009, at 16:53 , Joel Reymont wrote: > How many people are actively developing MacRuby apart from Laurent? > > Thanks, Joel > > --- > http://tinyco.de > Mac, Lisp, OCaml > > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel From ehynes at dharmagaia.com Mon Mar 30 09:27:51 2009 From: ehynes at dharmagaia.com (Edward Hynes) Date: Mon, 30 Mar 2009 12:27:51 -0400 Subject: [MacRuby-devel] Accessing Obj-C InstVars from Ruby Message-ID: <6095192F-2496-484C-A981-23A89A45381D@dharmagaia.com> Is there a way to access instance variables defined in an Objective-C class from a Ruby extension? I'm porting some of Apple's example code to MacRuby as a learning experience and would like to do so incrementally. Porting the code one class at a time works fine, but for some of the larger classes I'd like to port them a few methods at a time. Here's an example of what's happening --- Example.h --- @interface Example : NSObject { NSString *instVarA; NSString *instVarB; } - (NSString *)methodA; @end --- Example.m --- #import "Example.h" @implementation Example - (id)init { if (self = [super init]) { instVarA = @"instVarA"; instVarB = @"instVarB"; } return self; } - (NSString *)methodA { return instVarA; } @end --- Example.rb --- class Example def methodB @instVarB end end Then at runtime, when I execute the following... example = Example.alloc.init puts example.methodA.inspect puts example.methodB.inspect .. I get "instVarA" nil How do I access InsVarB from Ruby? Thanks, Ed From prabhaka at apple.com Mon Mar 30 10:18:41 2009 From: prabhaka at apple.com (Ernest N. Prabhakar, Ph.D.) Date: Mon, 30 Mar 2009 10:18:41 -0700 Subject: [MacRuby-devel] OSA resources Re: branches/experimental In-Reply-To: References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <0EEF81FD-04BD-4324-B013-3753771E4F9E@apple.com> Message-ID: <14D4E79C-2F66-452E-9872-CEB69D04265F@apple.com> Hi Laurent, On Mar 29, 2009, at 11:29 AM, Laurent Sansonetti wrote: > 1) making MacRuby an OSA component, so that it's recognized by the > system (osalang, Script Edit, etc.). I have no idea on how to > implement this. If you're willing to check it out, the documentation > is there: > > http://developer.apple.com/DOCUMENTATION/Carbon/Reference/Open_Scripti_Architecture/Reference/reference.html > > I unfortunately think that nobody made an open-source OSA component > yet. In fact, AFAIK the only other OSA component is a JavaScript > implementation which is not maintained anymore (and closed-source). Hmm, have you looked at: OSA Components Release Notes http://www.vcn.bc.ca/~philip/osa/ The OSA components included in this release enable scripting languages like Perl, Python, Ruby, sh, and Tcl to work in the OSA environment at peer level with AppleScript. TclOSAScript - Exec for MacTcl http://www.sagecertification.org/publications/library/proceedings/tcl97/full_papers/ingham/ingham_html/ingham.html TclOSAScript provides the ability for MacTcl scripts to run scripts in any other OSA compatible language on the Macintosh. Since the OSA is the standard mechanism for interapplication communication on the Mac, this allows MacTcl to run other applications, and provides an exec like facility (though arguably using a much richer communication model.) Frontier/ UserLand (Mac OS 9?) http://docserver.userland.com/osa/ http://www.scripting.com/frontier/snippets/userTalkEverywhere.html Not sure if any of these is what you were looking for, but figured I may as well pass them along, if only for background. -- Ernie P . From mattaimonetti at gmail.com Mon Mar 30 11:08:01 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 11:08:01 -0700 Subject: [MacRuby-devel] [hotcocoa] http wrapper, what do you think? Message-ID: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> In my free time, I've been working on a http://lighthouseapp.com client app which mixes API calls with webkit views (I'll release the source code later on). The app is 100% HotCocoa (meaning that I didn't use any nib/xibs). For people who are not used to work with delegation, having to deal with file download, URL queries can be a bit challenging if you want to start using the underlying obj-c methods. That's why I wrote a small HTTP wrapper to clean up my code and make download/queries easier. The library is divided in 2 major parts, a helper and the Query/Response classes. Here is how the helper looks like so far: Download helper making file download trivial Pass an url, and a block or a delegator A block takes precedence over a delegator, meaning that you can't pass a delegator and use a block, you have to choose which approach to pick. ==== Parameters url:: url of the resource to download options:: optional options used for the query &block:: block which is called when the file is downloaded ==== Options :method:: An optional value which represents the HTTP method to use :payload:: - data to pass to a POST, PUT, DELETE query. :delegation:: - class or instance to call when the file is downloaded. the handle_query_response method will be called on the passed object :save_to:: - path to save the response to :credential:: - should contains the :user key and :password key By default the credential will be saved for the entire session TODO :progress :: Proc to call everytime the downloader makes some progress :cache_storage :custom headers Error handling ==== Examples download("http://www.macruby.org/files/MacRuby%200.4.zip", {:save_to => '~/tmp/macruby.zip'.stringByStandardizingPath}) do |macruby| NSLog("file downloaded!") end download "http://macruby.org" do |mr| # The response object has 3 accessors: status_code, headers and body NSLog("status: #{mr.status_code}, Headers: #{mr.headers.inspect}") end path = File.expand_path('~/macruby_tmp.html') window :frame => [100, 100, 500, 500], :title => "HotCocoa" do |win| download("http://macruby.org", {:save_to => path}) do |homepage| win << label(:text => "status code: #{homepage.status_code}", :layout => {:start => false}) win << label(:text => "Headers: #{homepage.headers.inspect}", :layout => {:start => false}) end end download "http://macruby.org/users/matt", :delegation => @downloaded_file, :method => 'PUT', :payload => {:name => 'matt aimonetti'} download "http://macruby.org/roadmap.xml", :delegation => self download "http://localhost:5984/couchrest-test/", :method => 'POST', :payload => '{"user":"mattaimonetti at gmail.com","zip":92129}', :delegation => self download("http://mysite.com/login", {:credential => {:user => 'me', :password => 's3krit'}}) do |test| NSLog("response received: #{test.headers} #{test.status_code}") end As you can see from the example list, the method name download isn't always appropriate and maybe I should give it the http_query alias. What do you think? What's nice with this approach, is that on top of being simple, the query and the response handling are async so the rest of your code can be run and you get notified only when the response comes back. The underlying API looks like that: MacRubyHTTP::Query.new( url, http_method='GET', options={} ) Queries don't run in a custom runloop yet but that's something I want to look at once IO work on the experimental branch will be done. So, here is my question, do you guys think that this is something that should be part of HotCocoa or it's better if it stays its own separate lib? Also, what do you think about having a default vendor folder for hotcocoa apps and autoload the vendor files if available? - Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From chapbr at gmail.com Mon Mar 30 11:23:22 2009 From: chapbr at gmail.com (Brian Chapados) Date: Mon, 30 Mar 2009 11:23:22 -0700 Subject: [MacRuby-devel] [MacRuby] #240: no such file to load -- stringio.rb.bundle when starting irb/gems In-Reply-To: <042.3b242b694944ae4f01068062cede7a44@macosforge.org> References: <042.3b242b694944ae4f01068062cede7a44@macosforge.org> Message-ID: When you built MacRuby, did you have the RUBYOPT env set? If so, unset it. See the comments for this: http://www.macruby.org/trac/ticket/226#comment:7 Brian On Mon, Mar 30, 2009 at 6:36 AM, MacRuby wrote: > #240: no such file to load -- stringio.rb.bundle when starting irb/gems > -------------------------+-------------------------------------------------- > ?Reporter: ?i@? ? ? ? ? ?| ? ? ? Owner: ?lsansonetti@? > ? ? Type: ?defect ? ? ? | ? ? ?Status: ?new > ?Priority: ?blocker ? ? ?| ? Milestone: > Component: ?MacRuby ? ? ?| ? ?Keywords: > -------------------------+-------------------------------------------------- > ?I just installed newest (0.4) MacRuby from pkg. When running irb I get: > ?{{{ > ?Last login: Mon Mar 30 15:24:09 on ttys007 > ?[teamon ~] macirb > ?no such file to load -- stringio.rb.bundle > ?irb(main):001:0> exit > ?[teamon ~] macirb --version > ?irb 0.9.5(05/04/13) > ?[teamon ~] macruby --version > ?MacRuby version 0.4 (ruby 1.9.1) [universal-darwin9.5, x86_64] > ?[teamon ~] macirb > ?no such file to load -- stringio.rb.bundle > ?irb(main):001:0> require 'rubygems' > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:14: > ?warning: can't register `name' as an KVO setter (method `setName:') > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:14: > ?warning: can't register `version_requirement' as an KVO setter (method > ?`setVersion_requirement:') > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:84: > ?warning: already initialized constant MUTEX > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:86: > ?warning: already initialized constant RubyGemsPackageVersion > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:91: > ?warning: already initialized constant WIN_PATTERNS > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:841: > ?warning: already initialized constant MARSHAL_SPEC_DIR > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:843: > ?warning: already initialized constant YAML_SPEC_DIR > ?LoadError: no such file to load -- stringio.rb.bundle > ? ? ? ? from > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/yaml.rb:9:in > ?`require' > ? ? ? ? from > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/yaml.rb:9:in > ?`' > ? ? ? ? from > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems/config_file.rb:7:in > ?`require' > ? ? ? ? from > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems/config_file.rb:7:in > ?`' > ? ? ? ? from > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:883:in > ?`require' > ? ? ? ? from > ?/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rubygems.rb:883:in > ?`' > ? ? ? ? from (irb):1:in `require' > ? ? ? ? from (irb):1 > ? ? ? ? from /usr/local/bin/macirb:12:in `
' > ?irb(main):002:0> > > ?}}} > > ?Same thing when I installed from source. > > -- > Ticket URL: > MacRuby > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > From johnmacshea at gmail.com Mon Mar 30 11:27:20 2009 From: johnmacshea at gmail.com (John Shea) Date: Mon, 30 Mar 2009 20:27:20 +0200 Subject: [MacRuby-devel] Accessing Obj-C InstVars from Ruby In-Reply-To: <6095192F-2496-484C-A981-23A89A45381D@dharmagaia.com> References: <6095192F-2496-484C-A981-23A89A45381D@dharmagaia.com> Message-ID: Hello Edward, well since no one else has answered i will speculate a bit (it might provoke someone wiser). I assume that the Ruby and the Objective C class are magically married together perhaps via some sort of proxy class - since you cant as far as i know add to an objective C class more instance methods - and inserting a compiled class into a ruby class must be also problematic - anyway it seems complicated. So I assume that the ruby class is actually still a separate class. I must admit i never tried to extend a compiled object C class - and I surprised it works as well as it does. Given that, what about just adding getters and setters in the usual way to the objective class manually or with properties (see http://theocacao.com/document.page/510)? Or just rewrite the whole class in Ruby? Cheers, J On 3/30/09, Edward Hynes wrote: > Is there a way to access instance variables defined in an Objective-C > class from a Ruby extension? I'm porting some of Apple's example code > to MacRuby as a learning experience and would like to do so > incrementally. Porting the code one class at a time works fine, but > for some of the larger classes I'd like to port them a few methods at > a time. Here's an example of what's happening > > > --- Example.h --- > > @interface Example : NSObject { > NSString *instVarA; > NSString *instVarB; > } > > - (NSString *)methodA; > @end > > > --- Example.m --- > > #import "Example.h" > > @implementation Example > - (id)init { > if (self = [super init]) { > instVarA = @"instVarA"; > instVarB = @"instVarB"; > } > return self; > } > > - (NSString *)methodA { > return instVarA; > } > > @end > > > --- Example.rb --- > > class Example > def methodB > @instVarB > end > end > > > Then at runtime, when I execute the following... > > example = Example.alloc.init > puts example.methodA.inspect > puts example.methodB.inspect > > > .. I get > > "instVarA" > nil > > > How do I access InsVarB from Ruby? > > Thanks, > Ed > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > From federico.builes at gmail.com Mon Mar 30 11:39:31 2009 From: federico.builes at gmail.com (Federico Builes) Date: Mon, 30 Mar 2009 13:39:31 -0500 Subject: [MacRuby-devel] Rubyspec - Google Summer of Code Message-ID: <598db1000903301139i451854f0w520c54b496c8b89d@mail.gmail.com> (This message is being sent to several lists, I apologize if you get more than one copy). The Rubyspec project (http://rubyspec.org) is interested in finding one student to work with us this year in the Google Summer of Code. We'll be applying under the Ruby on Rails organization, you can find more information at: http://socghop.appspot.com/org/show/google/gsoc2009/rails A few months ago we merged the 1.8/1.9 specs and currently, Ruby 1.9 is not able to get a complete run on the specs. We'd like to start there, making sure that we can get a complete run with failures (instead of crashes/freezes). After having that, the student could start working on fixing some of the failing specs and writing new ones that target 1.9 specifically. The ideal candidate would be someone experienced with RSpec-style testing (we use our own system called MSpec), familiar with Ruby and interested in spending his summer helping the Ruby community. I'll be happy to answer to your ideas/comments/suggestions at federico.builes at gmail.com. We also have a mailing list and IRC channel that you might want to check out: * http://groups.google.com/group/rubyspec * #rubyspec @ irc.freenode.net * http://github.com/rubyspec If you're interested in applying please check out the Google Summer of Code application at: http://socghop.appspot.com/ -- Federico From charles.nutter at sun.com Mon Mar 30 12:12:51 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Mon, 30 Mar 2009 14:12:51 -0500 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <20fefa50903291413x59864ef7r381171a48dd9aebb@mail.gmail.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <49CEFD2A.6030708@sun.com> <49CF0938.4060800@sun.com> <977D2D29-EF12-42C6-9035-3249132CE09A@apple.com> <49CFC76D.6090206@sun.com> <20fefa50903291413x59864ef7r381171a48dd9aebb@mail.gmail.com> Message-ID: <49D119B3.3@sun.com> Matt Aimonetti wrote: > Hi Charlie, > > I don't think/hope you do it on purpose, but it seems that you're > asking questions just to prove that Laurent is wrong and that whatever > he will do will end up slowing down the current experimental branch. I think you're misinterpreting me. I'd love for Laurent to be right, and I'd love to know how to get around the cases that end up slowing down JRuby. I sincerely hope it's possible, since it would mean JRuby can probably do whatever MacRuby does in those cases. And I may be able to help if some of the optimization ideas are discussed more openly; I had similar discussions with IronRuby folks at RubyConf 2007 and saved them going down a path that I knew would eventually break code. - Charlie From mattaimonetti at gmail.com Mon Mar 30 12:14:07 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 12:14:07 -0700 Subject: [MacRuby-devel] # of developers In-Reply-To: <6FAD7F1D-B1BB-496E-8FE9-1760E2038D01@gmail.com> References: <6FAD7F1D-B1BB-496E-8FE9-1760E2038D01@gmail.com> Message-ID: <20fefa50903301214q58bcaa9q535d8fa043ef185f@mail.gmail.com> Joel, If you were thinking about helping out, be reassured, help is always welcome ;) - Matt 2009/3/30 John Shea > Here is the blurb: > http://www.macruby.org/project.html > > J > > On Mar 30, 2009, at 16:53 , Joel Reymont wrote: > > How many people are actively developing MacRuby apart from Laurent? >> >> Thanks, Joel >> >> --- >> http://tinyco.de >> Mac, Lisp, OCaml >> >> >> >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lsansonetti at apple.com Mon Mar 30 12:14:18 2009 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Mon, 30 Mar 2009 12:14:18 -0700 Subject: [MacRuby-devel] Accessing Obj-C InstVars from Ruby In-Reply-To: References: <6095192F-2496-484C-A981-23A89A45381D@dharmagaia.com> Message-ID: <06108C4C-2F5C-45E3-B7CC-D98959B8BE5F@apple.com> Hi John & Edward, On Mar 30, 2009, at 11:27 AM, John Shea wrote: > Hello Edward, > > well since no one else has answered i will speculate a bit (it might > provoke someone wiser). > > I assume that the Ruby and the Objective C class are magically married > together perhaps via some sort of proxy class - since you cant as far > as i know add to an objective C class more instance methods - and > inserting a compiled class into a ruby class must be also problematic > - anyway it seems complicated. So I assume that the ruby class is > actually still a separate class. I must admit i never tried to extend > a compiled object C class - and I surprised it works as well as it > does. In MacRuby, a Ruby class is a true Objective-C class. We try to use the Objective-C runtime for everything possible, however, because of some limitations of Objective-C there are things we need to do on the side, like for example maintaining instance variables (in Objective-C you cannot add an instance variable dynamically to a class). > On 3/30/09, Edward Hynes wrote: >> Is there a way to access instance variables defined in an Objective-C >> class from a Ruby extension? It is currently not implemented, but it's technically possible. A good work-around is to define accessors (properties) as John mentioned. Laurent From johnmacshea at gmail.com Mon Mar 30 12:42:27 2009 From: johnmacshea at gmail.com (John Shea) Date: Mon, 30 Mar 2009 21:42:27 +0200 Subject: [MacRuby-devel] helping out Message-ID: Hi Matt, you said: > If you were thinking about helping out, be reassured, help is always welcome ;) I would happily spend some time on MacRuby, but I have no idea where to start. I downloaded the experimental branch - was not really sure to go from there but tried running some simple ruby code with the miniruby executable - it hung so I assume I was doing something wrong. Anyway I was wondering whether you could give me a quick run down on how to start investigating learning and experimenting with the experimental branch. Any links would be helpful. I would like to start as simple as possible - but down the track one particular part that i would be interested in is tracing the dispatch from bridgesupport method to opengl function. I can't really spend much time until after the Amsterdam conference however. Speaking of which is it you that cannot make it? Pity if so - I was looking fwd to your talk as I have some very flakey code which interfaces with some traditional (ie non REST) webservices - I was hoping for some (yet more) tips ;-). Cheers, J From chapbr at gmail.com Mon Mar 30 12:56:44 2009 From: chapbr at gmail.com (Brian Chapados) Date: Mon, 30 Mar 2009 12:56:44 -0700 Subject: [MacRuby-devel] Accessing Obj-C InstVars from Ruby In-Reply-To: <6095192F-2496-484C-A981-23A89A45381D@dharmagaia.com> References: <6095192F-2496-484C-A981-23A89A45381D@dharmagaia.com> Message-ID: In this case, you could use the KVC[1] (key-value coding) accessor (#valueForKey:) to access the ivar. class Example def methodB self.valueForKey("instVarB") end end [1]: http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Compliant.html Brian On Mon, Mar 30, 2009 at 9:27 AM, Edward Hynes wrote: > Is there a way to access instance variables defined in an Objective-C class > from a Ruby extension? ?I'm porting some of Apple's example code to MacRuby > as a learning experience and would like to do so incrementally. ?Porting the > code one class at a time works fine, but for some of the larger classes I'd > like to port them a few methods at a time. ?Here's an example of what's > happening > > > --- Example.h --- > > ? @interface Example : NSObject { > ? ? ? NSString *instVarA; > ? ? ? NSString *instVarB; > ? ?} > > ? - (NSString *)methodA; > ? @end > > > --- Example.m --- > > ? #import "Example.h" > > ? @implementation Example > ? ? - (id)init { > ? ? ? if (self = [super init]) { > ? ? ? ? instVarA = @"instVarA"; > ? ? ? ? instVarB = @"instVarB"; > ? ? ? } > ? ? ? return self; > ? ? } > > ? ? - (NSString *)methodA { > ? ? ? return instVarA; > ? ? } > > ? @end > > > --- Example.rb --- > > ? class Example > ? ? def methodB > ? ? ? @instVarB > ? ? end > ? end > > > Then at runtime, when I execute the following... > > ? example = Example.alloc.init > ? puts example.methodA.inspect > ? puts example.methodB.inspect > > > .. I get > > ? "instVarA" > ? nil > > > How do I access InsVarB from Ruby? > > Thanks, > Ed > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > From mattaimonetti at gmail.com Mon Mar 30 13:06:44 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 13:06:44 -0700 Subject: [MacRuby-devel] helping out In-Reply-To: References: Message-ID: <20fefa50903301306x7356261dv518f5d9f678d6a36@mail.gmail.com> Hey John, I would happily spend some time on MacRuby, but I have no idea where to > start. Anyway I was wondering whether you could give me a quick run down on > how to start investigating learning and experimenting with the > experimental branch. > Don't start with the experimental branch, it's a work in progress and unless you work on a very specific area under the supervision of Laurent, I think you should wait a little bit. I would like to start as simple as possible - but down the track one > particular part that i would be interested in is tracing the dispatch from > bridgesupport method to opengl function. > Once the experimental branch will have the cocoa integration I'm sure this is something we can help you working on. (and by 'we' I really mean: Laurent :p) Speaking of which is it you that cannot make it? Pity if so - I was looking > fwd to your talk as I have some very flaky code which interfaces with some > traditional (ie non REST) webservices - I was hoping for some (yet more) > tips ;-). > Unfortunately, there was a last minute change and I won't be able to make it to the conf. However, I'm still planning on preparing some documentation on integrating MacRuby apps with remote/local web applications. You mentioned non-REST webservices, what do you have to deal with? SOAP, XML-RPC, something else? On a different note, I can think of a few things that you could do to help: - work on MacRuby/HotCocoa examples, I know you already ported a lot of samples from various sources, but some original samples to show various technics would def. be helpful. - write articles for the blog (I believe you already started) - work on HotCocoa (add mappings, suggest new APIs, study a way to test hotcocoa code (hotcocoa itself as well as developer's code)) - port the major ruby C extensions to MacRuby (using C or obj-c) I'll try to talk with Laurent and list the things he would like people to work on. Once we have a concrete list, maybe we can organize ourselves in pairs/small groups and start tackling these tasks. - Matt On Mon, Mar 30, 2009 at 12:42 PM, John Shea wrote: > Hi Matt, > > you said: > > If you were thinking about helping out, be reassured, help is always > welcome ;) > > I would happily spend some time on MacRuby, but I have no idea where to > start. > I downloaded the experimental branch - was not really sure to go from > there but tried running some simple ruby code with the miniruby > executable - it hung so I assume I was doing something wrong. > > Anyway I was wondering whether you could give me a quick run down on > how to start investigating learning and experimenting with the > experimental branch. Any links would be helpful. I would like to start > as simple as possible - but down the track one particular part that i > would be interested in is tracing the dispatch from bridgesupport > method to opengl function. > > I can't really spend much time until after the Amsterdam conference > however. > > Speaking of which is it you that cannot make it? Pity if so - I was > looking fwd to your talk as I have some very flakey code which > interfaces with some traditional (ie non REST) webservices - I was > hoping for some (yet more) tips ;-). > > Cheers, > J > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.nutter at sun.com Mon Mar 30 13:23:52 2009 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Mon, 30 Mar 2009 15:23:52 -0500 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <49D119B3.3@sun.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <49CEFD2A.6030708@sun.com> <49CF0938.4060800@sun.com> <977D2D29-EF12-42C6-9035-3249132CE09A@apple.com> <49CFC76D.6090206@sun.com> <20fefa50903291413x59864ef7r381171a48dd9aebb@mail.gmail.com> <49D119B3.3@sun.com> Message-ID: <49D12A58.2050306@sun.com> Charles Oliver Nutter wrote: > Matt Aimonetti wrote: >> Hi Charlie, >> >> I don't think/hope you do it on purpose, but it seems that you're >> asking questions just to prove that Laurent is wrong and that whatever >> he will do will end up slowing down the current experimental branch. > > I think you're misinterpreting me. I'd love for Laurent to be right, and > I'd love to know how to get around the cases that end up slowing down > JRuby. I sincerely hope it's possible, since it would mean JRuby can > probably do whatever MacRuby does in those cases. And I may be able to > help if some of the optimization ideas are discussed more openly; I had > similar discussions with IronRuby folks at RubyConf 2007 and saved them > going down a path that I knew would eventually break code. Hmm, I just realized "more openly" sounded bad. I just mean I'm here if anyone wants to discuss ideas, and I might be able to help. Carry on! :) - Charlie From marick at exampler.com Mon Mar 30 13:39:20 2009 From: marick at exampler.com (Brian Marick) Date: Mon, 30 Mar 2009 15:39:20 -0500 Subject: [MacRuby-devel] helping out In-Reply-To: <20fefa50903301306x7356261dv518f5d9f678d6a36@mail.gmail.com> References: <20fefa50903301306x7356261dv518f5d9f678d6a36@mail.gmail.com> Message-ID: <67FD6403-E048-4DD5-A6C5-78DF64905F2C@exampler.com> I'm going to start porting the _RubyCocoa_ demo app into MacRuby. What's the most useful (to you) branch to use? On Mar 30, 2009, at 3:06 PM, Matt Aimonetti wrote: > Hey John, > > I would happily spend some time on MacRuby, but I have no idea where > to start. > Anyway I was wondering whether you could give me a quick run down on > how to start investigating learning and experimenting with the > experimental branch. > > Don't start with the experimental branch, it's a work in progress > and unless you work on a very specific area under the supervision of > Laurent, I think you should wait a little bit. > > I would like to start as simple as possible - but down the track one > particular part that i would be interested in is tracing the > dispatch from bridgesupport method to opengl function. > > Once the experimental branch will have the cocoa integration I'm > sure this is something we can help you working on. (and by 'we' I > really mean: Laurent :p) > > Speaking of which is it you that cannot make it? Pity if so - I was > looking fwd to your talk as I have some very flaky code which > interfaces with some traditional (ie non REST) webservices - I was > hoping for some (yet more) tips ;-). > > Unfortunately, there was a last minute change and I won't be able to > make it to the conf. However, I'm still planning on preparing some > documentation on integrating MacRuby apps with remote/local web > applications. You mentioned non-REST webservices, what do you have > to deal with? SOAP, XML-RPC, something else? > > On a different note, I can think of a few things that you could do > to help: > - work on MacRuby/HotCocoa examples, I know you already ported a lot > of samples from various sources, but some original samples to show > various technics would def. be helpful. > - write articles for the blog (I believe you already started) > - work on HotCocoa (add mappings, suggest new APIs, study a way to > test hotcocoa code (hotcocoa itself as well as developer's code)) > - port the major ruby C extensions to MacRuby (using C or obj-c) > > I'll try to talk with Laurent and list the things he would like > people to work on. Once we have a concrete list, maybe we can > organize ourselves in pairs/small groups and start tackling these > tasks. > > - Matt > > > > On Mon, Mar 30, 2009 at 12:42 PM, John Shea > wrote: > Hi Matt, > > you said: > > If you were thinking about helping out, be reassured, help is > always welcome ;) > > I would happily spend some time on MacRuby, but I have no idea where > to start. > I downloaded the experimental branch - was not really sure to go from > there but tried running some simple ruby code with the miniruby > executable - it hung so I assume I was doing something wrong. > > Anyway I was wondering whether you could give me a quick run down on > how to start investigating learning and experimenting with the > experimental branch. Any links would be helpful. I would like to start > as simple as possible - but down the track one particular part that i > would be interested in is tracing the dispatch from bridgesupport > method to opengl function. > > I can't really spend much time until after the Amsterdam conference > however. > > Speaking of which is it you that cannot make it? Pity if so - I was > looking fwd to your talk as I have some very flakey code which > interfaces with some traditional (ie non REST) webservices - I was > hoping for some (yet more) tips ;-). > > Cheers, > J > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog, www.twitter.com/marick From prabhaka at apple.com Mon Mar 30 13:43:57 2009 From: prabhaka at apple.com (Ernest N. Prabhakar, Ph.D.) Date: Mon, 30 Mar 2009 13:43:57 -0700 Subject: [MacRuby-devel] [hotcocoa] http wrapper, what do you think? In-Reply-To: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> References: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> Message-ID: <57E1098B-C860-4829-BD41-D4D3018D4DD1@apple.com> Hi Matt, On Mar 30, 2009, at 11:08 AM, Matt Aimonetti wrote: > As you can see from the example list, the method name download isn't > always appropriate and maybe I should give it the http_query alias. > What do you think? > What's nice with this approach, is that on top of being simple, the > query and the response handling are async so the rest of your code > can be run and you get notified only when the response comes back. > > The underlying API looks like that: MacRubyHTTP::Query.new( url, > http_method='GET', options={} ) > Queries don't run in a custom runloop yet but that's something I > want to look at once IO work on the experimental branch will be done. > > > So, here is my question, do you guys think that this is something > that should be part of HotCocoa or it's better if it stays its own > separate lib? > Also, what do you think about having a default vendor folder for > hotcocoa apps and autoload the vendor files if available? > Good stuff. I think it is worth iterating on as a separate lib for now, and integrating it with HotCocoa later. For comparison, you may also want to look at how "Shoes" handles downloads (below). -- Ernie P. http://help.shoooes.net/App.html download(url: a string, styles) Starts a download thread (much like XMLHttpRequest, if you're familiar with JavaScript.) This method returns immediately and runs the download in the background. Each download thread also fires start, progress and finish events. You can send the download to a file or just get back a string (in the finish event.) If you attach a block to a download, it'll get called as the finish event. Shoes.app do stack do title "Searching Google", :size => 16 @status = para "One moment..." # Search Google for 'shoes' and print the HTTP headers download "http://www.google.com/search?q=shoes" do |goog| @status.text = "Headers: " + goog.response.headers.inspect end end end And, if we wanted to use the downloaded data, we'd get it using goog.response.body. This example is truly the simplest form of download: pulling some web data down into memory and handling it once it's done. Another simple use of download is to save some web data to a file, using the :save style. Shoes.app do stack do title "Downloading Google image", :size => 16 @status = para "One moment..." download "http://www.google.com/logos/nasa50th.gif", :save => "nasa50th.gif" do @status.text = "Okay, is downloaded." end end end In this case, you can still get the headers for the downloaded file, but response.body will be nil, since the data wasn't saved to memory. You will need to open the file to get the downloaded goods. If you need to send certain headers or actions to the web server, you can use the :method, :headers and :body styles to customize the HTTP request. (And, if you need to go beyond these, you can always break out Ruby's OpenURI class.) Shoes.app do stack do title "POSTing to Google", :size => 16 @status = para "One moment..." download "http://www.stevex.net/dump.php", :method => "POST", :body => "v=1.0&q=shoes" do |dump| require 'hpricot' @status.text = Hpricot(dump.response.body).inner_text end end end As you can see from the above example, Shoes includes the Hpricot library for parsing HTML. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.wirtel at gmail.com Mon Mar 30 14:02:13 2009 From: stephane.wirtel at gmail.com (=?ISO-8859-1?Q?St=E9phane_Wirtel?=) Date: Mon, 30 Mar 2009 23:02:13 +0200 Subject: [MacRuby-devel] MacRuby and XML-RPC Message-ID: Hi all, I am trying to create a small xml-rpc client with macruby, but I got this error. stargate:test_ruby stephane$ ./client.rb /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/ rexml/attribute.rb:18:in `': uninitialized constant REXML::Attribute::NAME_STR (NameError) from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/rexml/attribute.rb:9:in `' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/rexml/attribute.rb:4:in `' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/rexml/element.rb:3:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/rexml/element.rb:3:in `' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/rexml/document.rb:1:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/rexml/document.rb:1:in `' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/xmlrpc/parser.rb:700:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/xmlrpc/parser.rb:700:in `initialize' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/xmlrpc/utils.rb:48:in `new' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/xmlrpc/utils.rb:48:in `parser' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/xmlrpc/client.rb:421:in `call2' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 1.9.1/xmlrpc/client.rb:410:in `call' from ./client.rb:6:in `
' Here is the source code of my small client #!/usr/local/bin/macruby require "xmlrpc/client" server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", 8069) puts server.call("about") This code works fine with the standard ruby. So, I have downloaded the trunk version and I will try to fix this bug, and make a patch. Regards, Stephane From mattaimonetti at gmail.com Mon Mar 30 14:22:02 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 14:22:02 -0700 Subject: [MacRuby-devel] MacRuby and XML-RPC In-Reply-To: References: Message-ID: <20fefa50903301422t5aefb8d3n7bc3a3406e3b7886@mail.gmail.com> Could you please create a ticket for this bug, it looks like a constant is being called before being defined. It might be related to the load order in MacRuby (wild guess). - Matt On Mon, Mar 30, 2009 at 2:02 PM, St?phane Wirtel wrote: > Hi all, > > I am trying to create a small xml-rpc client with macruby, but I got this > error. > > stargate:test_ruby stephane$ ./client.rb > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:18:in > `': uninitialized constant REXML::Attribute::NAME_STR > (NameError) > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:9:in > `' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:4:in > `' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in > `require' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in > `' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in > `require' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in > `' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/parser.rb:700:in > `require' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/parser.rb:700:in > `initialize' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/utils.rb:48:in > `new' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/utils.rb:48:in > `parser' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/client.rb:421:in > `call2' > from > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/client.rb:410:in > `call' > from ./client.rb:6:in `
' > > > Here is the source code of my small client > > #!/usr/local/bin/macruby > > require "xmlrpc/client" > > server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", 8069) > puts server.call("about") > > This code works fine with the standard ruby. > > So, I have downloaded the trunk version and I will try to fix this bug, and > make a patch. > > Regards, > > Stephane > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattaimonetti at gmail.com Mon Mar 30 14:37:45 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 14:37:45 -0700 Subject: [MacRuby-devel] [hotcocoa] http wrapper, what do you think? In-Reply-To: <57E1098B-C860-4829-BD41-D4D3018D4DD1@apple.com> References: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> <57E1098B-C860-4829-BD41-D4D3018D4DD1@apple.com> Message-ID: <20fefa50903301437o75056b88ra89a8cead89f59d1@mail.gmail.com> Ernie, Pretty cool, my library does(will do) what Shoes does but with more flexibility (you can assign any class/objects as a delegates and it supports more options (including using your keychain for auth)). Did/do you use Shoes, if so, I'd be interested in knowing what you think we are missing or what we should look at. Thanks, - Matt 2009/3/30 Ernest N. Prabhakar, Ph.D. > Hi Matt, > On Mar 30, 2009, at 11:08 AM, Matt Aimonetti wrote: > > As you can see from the example list, the method name download isn't always > appropriate and maybe I should give it the http_query alias. What do you > think? > What's nice with this approach, is that on top of being simple, the query > and the response handling are async so the rest of your code can be run and > you get notified only when the response comes back. > > The underlying API looks like that: MacRubyHTTP::Query.new( url, > http_method='GET', options={} ) > Queries don't run in a custom runloop yet but that's something I want to > look at once IO work on the experimental branch will be done. > > > So, here is my question, do you guys think that this is something that > should be part of HotCocoa or it's better if it stays its own separate lib? > Also, what do you think about having a default vendor folder for hotcocoa > apps and autoload the vendor files if available? > > > Good stuff. I think it is worth iterating on as a separate lib for now, and > integrating it with HotCocoa later. For comparison, you may also want to > look at how "Shoes" handles downloads (below). > > -- Ernie P. > > http://help.shoooes.net/App.html > > *download(url: a string, styles)* > > Starts a download thread (much like XMLHttpRequest, if you're familiar with > JavaScript.) This method returns immediately and runs the download in the > background. Each download thread also fires start, progress and finishevents. You can send the download to a file or just get back a string (in > the finish event.) > > If you attach a block to a download, it'll get called as the finish event. > *Shoes*.app do > stack do > title "Searching Google", :size => 16 > @status = para "One moment..." > # Search Google for 'shoes' and print the HTTP headers > download "http://www.google.com/search?q=shoes" do |goog| > @status.text = "Headers: " + goog.response.headers.inspect > end > end > end > > And, if we wanted to use the downloaded data, we'd get it using > goog.response.body. This example is truly the simplest form of download: > pulling some web data down into memory and handling it once it's done. > > Another simple use of download is to save some web data to a file, using > the :save style. > *Shoes*.app do > stack do > title "Downloading Google image", :size => 16 > @status = para "One moment..." > download "http://www.google.com/logos/nasa50th.gif", > :save => "nasa50th.gif" do > @status.text = "Okay, is downloaded." > end > end > end > > In this case, you can still get the headers for the downloaded file, but > response.body will be nil, since the data wasn't saved to memory. You will > need to open the file to get the downloaded goods. > > If you need to send certain headers or actions to the web server, you can > use the :method, :headers and :body styles to customize the HTTP request. > (And, if you need to go beyond these, you can always break out Ruby's > OpenURI class.) > *Shoes*.app do > stack do > title "POSTing to Google", :size => 16 > @status = para "One moment..." > download "http://www.stevex.net/dump.php", > :method => "POST", :body => "v=1.0&q=shoes" do |dump| > require 'hpricot' > @status.text = *Hpricot*(dump.response.body).inner_text > end > end > end > > As you can see from the above example, Shoes includes the Hpricot library > for parsing HTML. > > > > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattaimonetti at gmail.com Mon Mar 30 14:39:13 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 14:39:13 -0700 Subject: [MacRuby-devel] helping out In-Reply-To: <67FD6403-E048-4DD5-A6C5-78DF64905F2C@exampler.com> References: <20fefa50903301306x7356261dv518f5d9f678d6a36@mail.gmail.com> <67FD6403-E048-4DD5-A6C5-78DF64905F2C@exampler.com> Message-ID: <20fefa50903301439r30216569nac765a82e965f060@mail.gmail.com> Use trunk aka 0.4 for now. - Matt On Mon, Mar 30, 2009 at 1:39 PM, Brian Marick wrote: > I'm going to start porting the _RubyCocoa_ demo app into MacRuby. What's > the most useful (to you) branch to use? > > > On Mar 30, 2009, at 3:06 PM, Matt Aimonetti wrote: > > Hey John, >> >> I would happily spend some time on MacRuby, but I have no idea where to >> start. >> Anyway I was wondering whether you could give me a quick run down on >> how to start investigating learning and experimenting with the >> experimental branch. >> >> Don't start with the experimental branch, it's a work in progress and >> unless you work on a very specific area under the supervision of Laurent, I >> think you should wait a little bit. >> >> I would like to start as simple as possible - but down the track one >> particular part that i would be interested in is tracing the dispatch from >> bridgesupport method to opengl function. >> >> Once the experimental branch will have the cocoa integration I'm sure this >> is something we can help you working on. (and by 'we' I really mean: Laurent >> :p) >> >> Speaking of which is it you that cannot make it? Pity if so - I was >> looking fwd to your talk as I have some very flaky code which interfaces >> with some traditional (ie non REST) webservices - I was hoping for some (yet >> more) tips ;-). >> >> Unfortunately, there was a last minute change and I won't be able to make >> it to the conf. However, I'm still planning on preparing some documentation >> on integrating MacRuby apps with remote/local web applications. You >> mentioned non-REST webservices, what do you have to deal with? SOAP, >> XML-RPC, something else? >> >> On a different note, I can think of a few things that you could do to >> help: >> - work on MacRuby/HotCocoa examples, I know you already ported a lot of >> samples from various sources, but some original samples to show various >> technics would def. be helpful. >> - write articles for the blog (I believe you already started) >> - work on HotCocoa (add mappings, suggest new APIs, study a way to test >> hotcocoa code (hotcocoa itself as well as developer's code)) >> - port the major ruby C extensions to MacRuby (using C or obj-c) >> >> I'll try to talk with Laurent and list the things he would like people to >> work on. Once we have a concrete list, maybe we can organize ourselves in >> pairs/small groups and start tackling these tasks. >> >> - Matt >> >> >> >> On Mon, Mar 30, 2009 at 12:42 PM, John Shea >> wrote: >> Hi Matt, >> >> you said: >> > If you were thinking about helping out, be reassured, help is always >> welcome ;) >> >> I would happily spend some time on MacRuby, but I have no idea where to >> start. >> I downloaded the experimental branch - was not really sure to go from >> there but tried running some simple ruby code with the miniruby >> executable - it hung so I assume I was doing something wrong. >> >> Anyway I was wondering whether you could give me a quick run down on >> how to start investigating learning and experimenting with the >> experimental branch. Any links would be helpful. I would like to start >> as simple as possible - but down the track one particular part that i >> would be interested in is tracing the dispatch from bridgesupport >> method to opengl function. >> >> I can't really spend much time until after the Amsterdam conference >> however. >> >> Speaking of which is it you that cannot make it? Pity if so - I was >> looking fwd to your talk as I have some very flakey code which >> interfaces with some traditional (ie non REST) webservices - I was >> hoping for some (yet more) tips ;-). >> >> Cheers, >> J >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> > > ----- > Brian Marick, independent consultant > Mostly on agile methods with a testing slant > www.exampler.com, www.exampler.com/blog, www.twitter.com/marick > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattaimonetti at gmail.com Mon Mar 30 14:41:47 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 14:41:47 -0700 Subject: [MacRuby-devel] branches/experimental In-Reply-To: <49D12A58.2050306@sun.com> References: <545524EE-A54E-4447-B209-817799A3BC35@apple.com> <49CEFD2A.6030708@sun.com> <49CF0938.4060800@sun.com> <977D2D29-EF12-42C6-9035-3249132CE09A@apple.com> <49CFC76D.6090206@sun.com> <20fefa50903291413x59864ef7r381171a48dd9aebb@mail.gmail.com> <49D119B3.3@sun.com> <49D12A58.2050306@sun.com> Message-ID: <20fefa50903301441p4e9324d8xd0d1c903c91547be@mail.gmail.com> Thanks Charles for clarifying the situation :) For once, I'm glad to see I was wrong. - Matt On Mon, Mar 30, 2009 at 1:23 PM, Charles Oliver Nutter < charles.nutter at sun.com> wrote: > Charles Oliver Nutter wrote: > >> Matt Aimonetti wrote: >> >>> Hi Charlie, >>> >>> I don't think/hope you do it on purpose, but it seems that you're asking >>> questions just to prove that Laurent is wrong and that whatever he will do >>> will end up slowing down the current experimental branch. >>> >> >> I think you're misinterpreting me. I'd love for Laurent to be right, and >> I'd love to know how to get around the cases that end up slowing down JRuby. >> I sincerely hope it's possible, since it would mean JRuby can probably do >> whatever MacRuby does in those cases. And I may be able to help if some of >> the optimization ideas are discussed more openly; I had similar discussions >> with IronRuby folks at RubyConf 2007 and saved them going down a path that I >> knew would eventually break code. >> > > Hmm, I just realized "more openly" sounded bad. I just mean I'm here if > anyone wants to discuss ideas, and I might be able to help. Carry on! :) > > > - Charlie > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chapbr at gmail.com Mon Mar 30 14:46:25 2009 From: chapbr at gmail.com (Brian Chapados) Date: Mon, 30 Mar 2009 14:46:25 -0700 Subject: [MacRuby-devel] [hotcocoa] http wrapper, what do you think? In-Reply-To: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> References: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> Message-ID: Seems like a good idea that would be useful even outside of HotCocoa. Especially for simple cases, I think if Obj-C had blocks, this would be a good place to use them. For more control, the delegate pattern actually works really well. It's good that you have a way to do both. Does the delegate object also receive messages that would be sent to an NSURLDownload? That might be a nice way to allow easy integration in cases where an object that responds to the delegate methods is defined in Obj-C. Also, regarding multi-threading, couldn't you just use NSURLDownload (which you're probably already using underneath) + NSOperation/NSOperationQueue. Since your #download method already wraps the underlying process, you could should able to generate NSOperations to perform the downloads and add them to a queue. Those classes handle creating threads (which have their own runloops) and performing a task on the thread. That said, maybe this approach would not work with the current IO implementation? Brian 2009/3/30 Matt Aimonetti : > In my free time, I've been working on a http://lighthouseapp.com client app > which mixes API calls with webkit views (I'll release the source code later > on). > The app is 100% HotCocoa (meaning that I didn't use any nib/xibs). > For people who are not used to work with delegation, having to deal with > file download, URL queries can be a bit challenging if you want to start > using the underlying obj-c methods. > > That's why I wrote a small HTTP wrapper to clean up my code and make > download/queries easier. > The library is divided in 2 major parts, a helper and the Query/Response > classes. > > Here is how the helper looks like so far: > > ?Download helper making file download trivial > ?Pass an url, and a block or a delegator > ?A block takes precedence over a delegator, meaning that you can't > ?pass a delegator and use a block, you have to choose which approach > ?to pick. > > ?==== Parameters > ?url:: url of the resource to download > ?options:: optional options used for the query > ?&block:: block which is called when the file is downloaded > > ?==== Options > ?:method:: An optional value which represents the HTTP > method to use > ?:payload::??? - data to pass to a POST, PUT, DELETE query. > ?:delegation:: - class or instance to call when the file is > downloaded. > ???????????????????????? the handle_query_response method will be called on > the > ???????????????????????? passed object > ?:save_to::??? - path to save the response to > ?:credential::?? - should contains the :user key and :password key > ???????????????????????? By default the credential will be saved for the > entire session > > ?TODO > ?:progress ::??? Proc to call everytime the downloader makes some > progress > ?:cache_storage > ?:custom headers > ?Error handling > > ?==== Examples > > ??? download("http://www.macruby.org/files/MacRuby%200.4.zip", {:save_to => > '~/tmp/macruby.zip'.stringByStandardizingPath}) do |macruby| > ????? NSLog("file downloaded!") > ??? end > > ?? download "http://macruby.org" do |mr| > ???? # The response object has 3 accessors: status_code, headers and body > ???? NSLog("status: #{mr.status_code}, Headers: #{mr.headers.inspect}") > ?? end > > ?? path = File.expand_path('~/macruby_tmp.html') > ?? window :frame => [100, 100, 500, 500], :title => "HotCocoa" do |win| > ???? download("http://macruby.org", {:save_to => path}) do |homepage| > ?????? win << label(:text => "status code: #{homepage.status_code}", :layout > => {:start => false}) > ?????? win << label(:text => "Headers: #{homepage.headers.inspect}", :layout > => {:start => false}) > ???? end > ?? end > > ?? download "http://macruby.org/users/matt", :delegation => > @downloaded_file, :method => 'PUT', :payload => {:name => 'matt aimonetti'} > > ?? download "http://macruby.org/roadmap.xml", :delegation => self > > ?? download "http://localhost:5984/couchrest-test/", :method => 'POST', > :payload => '{"user":"mattaimonetti at gmail.com","zip":92129}', :delegation => > self > > ?? download("http://mysite.com/login", {:credential => {:user => 'me', > :password => 's3krit'}}) do |test| > ???? NSLog("response received: #{test.headers} #{test.status_code}") > ?? end > > > As you can see from the example list, the method name download isn't always > appropriate and maybe I should give it the http_query alias. What do you > think? > What's nice with this approach, is that on top of being simple, the query > and the response handling are async so the rest of your code can be run and > you get notified only when the response comes back. > > The underlying API looks like that:? MacRubyHTTP::Query.new( url, > http_method='GET', options={} ) > Queries don't run in a custom runloop yet but that's something I want to > look at once IO work on the experimental branch will be done. > > > So, here is my question, do you guys think that this is something that > should be part of HotCocoa or it's better if it stays its own separate lib? > Also, what do you think about having a default vendor folder for hotcocoa > apps and autoload the vendor files if available? > > - Matt > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > From stephane.wirtel at gmail.com Mon Mar 30 14:51:43 2009 From: stephane.wirtel at gmail.com (=?ISO-8859-1?Q?St=E9phane_Wirtel?=) Date: Mon, 30 Mar 2009 23:51:43 +0200 Subject: [MacRuby-devel] MacRuby and XML-RPC In-Reply-To: <20fefa50903301422t5aefb8d3n7bc3a3406e3b7886@mail.gmail.com> References: <20fefa50903301422t5aefb8d3n7bc3a3406e3b7886@mail.gmail.com> Message-ID: http://www.macruby.org/trac/ticket/134 Thank you But I hope this bug will be resolved because I want to implement a native cocoa client for the OpenERP project On 30 Mar 2009, at 23:22, Matt Aimonetti wrote: > Could you please create a ticket for this bug, it looks like a > constant is being called before being defined. It might be related > to the load order in MacRuby (wild guess). > > - Matt > > On Mon, Mar 30, 2009 at 2:02 PM, St?phane Wirtel > wrote: > Hi all, > > I am trying to create a small xml-rpc client with macruby, but I got > this error. > > stargate:test_ruby stephane$ ./client.rb > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ > 1.9.1/rexml/attribute.rb:18:in `': uninitialized > constant REXML::Attribute::NAME_STR (NameError) > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/attribute.rb:9:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/attribute.rb:4:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/element.rb:3:in `require' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/element.rb:3:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/document.rb:1:in `require' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/document.rb:1:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/parser.rb:700:in `require' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/parser.rb:700:in `initialize' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/utils.rb:48:in `new' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/utils.rb:48:in `parser' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/client.rb:421:in `call2' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/client.rb:410:in `call' > from ./client.rb:6:in `
' > > > Here is the source code of my small client > > #!/usr/local/bin/macruby > > require "xmlrpc/client" > > server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", > 8069) > puts server.call("about") > > This code works fine with the standard ruby. > > So, I have downloaded the trunk version and I will try to fix this > bug, and make a patch. > > Regards, > > Stephane > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel St?phane Wirtel stephane.wirtel at gmail.com From ruby-noreply at macosforge.org Mon Mar 30 14:54:43 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 30 Mar 2009 21:54:43 -0000 Subject: [MacRuby-devel] [MacRuby] #134: require 'rexml/document' fails In-Reply-To: <053.9607c6edbd717c36c6be2265db40d5f1@macosforge.org> References: <053.9607c6edbd717c36c6be2265db40d5f1@macosforge.org> Message-ID: <062.bb7f7458a9d1970ee8ba246ecdbef27d@macosforge.org> #134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@? | Owner: lsansonetti@? Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by stephane@?): Hi, I confirm this bug in the last stable 0.4, Hope it'll help -- Ticket URL: MacRuby From mattaimonetti at gmail.com Mon Mar 30 15:00:42 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 15:00:42 -0700 Subject: [MacRuby-devel] [hotcocoa] http wrapper, what do you think? In-Reply-To: References: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> Message-ID: <20fefa50903301500k48068bb7kfc15ea8e8cafd822@mail.gmail.com> > > Does the delegate object also receive messages that would be sent to an > NSURLDownload? > I'm actually using NSURLConnection and not NSURLDownload which seemed a bit too simple when I looked at it. If the delegator is a proc, then it currently only gets called once the request finished properly. (I still need to write the error handling etc...) If your delegator is an object or a class, all messages should be passed directly. Also, regarding multi-threading, couldn't you just use NSURLDownload (which > you're probably already using underneath) + NSOperation/NSOperationQueue. > I need to look into NSOperation/NSOperationQueue to see how it works, I'm still pretty new to Cocoa and I don't know all the tricks cool kids use ;) I'll do what Ernie and put what I have so far on GitHub and let people hack on it until we have something nice that could be used in most use cases. Since I'm going on vacation, I'll add you (Brian) to my repo so you can deal with pull requests and push your own stuff there ;) Reharding using the class outside of HotCocoa, I agree, but you should be able to only require the file and include the module. What do you think? - Matt On Mon, Mar 30, 2009 at 2:46 PM, Brian Chapados wrote: > Seems like a good idea that would be useful even outside of HotCocoa. > Especially for simple cases, I think if Obj-C had blocks, this would > be a good place to use them. For more control, the delegate pattern > actually works really well. It's good that you have a way to do both. > Does the delegate object also receive messages that would be sent to > an NSURLDownload? That might be a nice way to allow easy integration > in cases where an object that responds to the delegate methods is > defined in Obj-C. > > Also, regarding multi-threading, couldn't you just use NSURLDownload > (which you're probably already using underneath) + > NSOperation/NSOperationQueue. Since your #download method already > wraps the underlying process, you could should able to generate > NSOperations to perform the downloads and add them to a queue. Those > classes handle creating threads (which have their own runloops) and > performing a task on the thread. That said, maybe this approach would > not work with the current IO implementation? > > Brian > > 2009/3/30 Matt Aimonetti : > > In my free time, I've been working on a http://lighthouseapp.com client > app > > which mixes API calls with webkit views (I'll release the source code > later > > on). > > The app is 100% HotCocoa (meaning that I didn't use any nib/xibs). > > For people who are not used to work with delegation, having to deal with > > file download, URL queries can be a bit challenging if you want to start > > using the underlying obj-c methods. > > > > That's why I wrote a small HTTP wrapper to clean up my code and make > > download/queries easier. > > The library is divided in 2 major parts, a helper and the Query/Response > > classes. > > > > Here is how the helper looks like so far: > > > > Download helper making file download trivial > > Pass an url, and a block or a delegator > > A block takes precedence over a delegator, meaning that you can't > > pass a delegator and use a block, you have to choose which approach > > to pick. > > > > ==== Parameters > > url:: url of the resource to download > > options:: optional options used for the query > > &block:: block which is called when the file is downloaded > > > > ==== Options > > :method:: An optional value which represents the HTTP > > method to use > > :payload:: - data to pass to a POST, PUT, DELETE query. > > :delegation:: - class or instance to call when the file is > > downloaded. > > the handle_query_response method will be called > on > > the > > passed object > > :save_to:: - path to save the response to > > :credential:: - should contains the :user key and :password key > > By default the credential will be saved for the > > entire session > > > > TODO > > :progress :: Proc to call everytime the downloader makes some > > progress > > :cache_storage > > :custom headers > > Error handling > > > > ==== Examples > > > > download("http://www.macruby.org/files/MacRuby%200.4.zip", {:save_to > => > > '~/tmp/macruby.zip'.stringByStandardizingPath}) do |macruby| > > NSLog("file downloaded!") > > end > > > > download "http://macruby.org" do |mr| > > # The response object has 3 accessors: status_code, headers and body > > NSLog("status: #{mr.status_code}, Headers: #{mr.headers.inspect}") > > end > > > > path = File.expand_path('~/macruby_tmp.html') > > window :frame => [100, 100, 500, 500], :title => "HotCocoa" do |win| > > download("http://macruby.org", {:save_to => path}) do |homepage| > > win << label(:text => "status code: #{homepage.status_code}", > :layout > > => {:start => false}) > > win << label(:text => "Headers: #{homepage.headers.inspect}", > :layout > > => {:start => false}) > > end > > end > > > > download "http://macruby.org/users/matt", :delegation => > > @downloaded_file, :method => 'PUT', :payload => {:name => 'matt > aimonetti'} > > > > download "http://macruby.org/roadmap.xml", :delegation => self > > > > download "http://localhost:5984/couchrest-test/", :method => 'POST', > > :payload => '{"user":"mattaimonetti at gmail.com","zip":92129}', > :delegation => > > self > > > > download("http://mysite.com/login", {:credential => {:user => 'me', > > :password => 's3krit'}}) do |test| > > NSLog("response received: #{test.headers} #{test.status_code}") > > end > > > > > > As you can see from the example list, the method name download isn't > always > > appropriate and maybe I should give it the http_query alias. What do you > > think? > > What's nice with this approach, is that on top of being simple, the query > > and the response handling are async so the rest of your code can be run > and > > you get notified only when the response comes back. > > > > The underlying API looks like that: MacRubyHTTP::Query.new( url, > > http_method='GET', options={} ) > > Queries don't run in a custom runloop yet but that's something I want to > > look at once IO work on the experimental branch will be done. > > > > > > So, here is my question, do you guys think that this is something that > > should be part of HotCocoa or it's better if it stays its own separate > lib? > > Also, what do you think about having a default vendor folder for hotcocoa > > apps and autoload the vendor files if available? > > > > - Matt > > > > > > _______________________________________________ > > MacRuby-devel mailing list > > MacRuby-devel at lists.macosforge.org > > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby-noreply at macosforge.org Mon Mar 30 15:06:20 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Mon, 30 Mar 2009 22:06:20 -0000 Subject: [MacRuby-devel] [MacRuby] #134: require 'rexml/document' fails In-Reply-To: <053.9607c6edbd717c36c6be2265db40d5f1@macosforge.org> References: <053.9607c6edbd717c36c6be2265db40d5f1@macosforge.org> Message-ID: <062.991390a660889e5ea7b261bdb233b736@macosforge.org> #134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@? | Owner: lsansonetti@? Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by mattaimonetti@?): As a work around, the following works: {{{ module A module B CONST1 = "cool" end module C include B end class D include C CONST2 = A::B::CONST1 end end }}} -- Ticket URL: MacRuby From prabhaka at apple.com Mon Mar 30 15:06:51 2009 From: prabhaka at apple.com (Ernest N. Prabhakar, Ph.D.) Date: Mon, 30 Mar 2009 15:06:51 -0700 Subject: [MacRuby-devel] [hotcocoa] http wrapper, what do you think? In-Reply-To: <20fefa50903301437o75056b88ra89a8cead89f59d1@mail.gmail.com> References: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> <57E1098B-C860-4829-BD41-D4D3018D4DD1@apple.com> <20fefa50903301437o75056b88ra89a8cead89f59d1@mail.gmail.com> Message-ID: <6452C5F0-6A82-4049-AABA-1151D7765B57@apple.com> Hi Matt, On Mar 30, 2009, at 2:37 PM, Matt Aimonetti wrote: > Pretty cool, my library does(will do) what Shoes does but with more > flexibility (you can assign any class/objects as a delegates and it > supports more options (including using your keychain for auth)). > Did/do you use Shoes, if so, I'd be interested in knowing what you > think we are missing or what we should look at. The one thing I didn't notice in your API was having explicit mappings for "start" and "finish", (though I see "progress" on your TODO). -- Ernie P. From mattaimonetti at gmail.com Mon Mar 30 15:11:48 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 15:11:48 -0700 Subject: [MacRuby-devel] MacRuby and XML-RPC In-Reply-To: References: <20fefa50903301422t5aefb8d3n7bc3a3406e3b7886@mail.gmail.com> Message-ID: <20fefa50903301511k6ca27794nf010f0d2c71758cc@mail.gmail.com> If I can find 5 minutes tonight, I'll try to write a quick work around patch for you so you can start working on your project and not wait for Macruby to be fixed. - Matt On Mon, Mar 30, 2009 at 2:51 PM, St?phane Wirtel wrote: > http://www.macruby.org/trac/ticket/134 > > Thank you > > But I hope this bug will be resolved because I want to implement a native > cocoa client for the OpenERP project > > On 30 Mar 2009, at 23:22, Matt Aimonetti wrote: > > Could you please create a ticket for this bug, it looks like a constant is >> being called before being defined. It might be related to the load order in >> MacRuby (wild guess). >> >> - Matt >> >> On Mon, Mar 30, 2009 at 2:02 PM, St?phane Wirtel < >> stephane.wirtel at gmail.com> wrote: >> Hi all, >> >> I am trying to create a small xml-rpc client with macruby, but I got this >> error. >> >> stargate:test_ruby stephane$ ./client.rb >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:18:in >> `': uninitialized constant REXML::Attribute::NAME_STR >> (NameError) >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:9:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:4:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in >> `require' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in >> `require' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/parser.rb:700:in >> `require' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/parser.rb:700:in >> `initialize' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/utils.rb:48:in >> `new' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/utils.rb:48:in >> `parser' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/client.rb:421:in >> `call2' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/client.rb:410:in >> `call' >> from ./client.rb:6:in `
' >> >> >> Here is the source code of my small client >> >> #!/usr/local/bin/macruby >> >> require "xmlrpc/client" >> >> server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", 8069) >> puts server.call("about") >> >> This code works fine with the standard ruby. >> >> So, I have downloaded the trunk version and I will try to fix this bug, >> and make a patch. >> >> Regards, >> >> Stephane >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> > > St?phane Wirtel > stephane.wirtel at gmail.com > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.wirtel at gmail.com Mon Mar 30 15:16:19 2009 From: stephane.wirtel at gmail.com (=?ISO-8859-1?Q?St=E9phane_Wirtel?=) Date: Tue, 31 Mar 2009 00:16:19 +0200 Subject: [MacRuby-devel] MacRuby and XML-RPC In-Reply-To: <20fefa50903301511k6ca27794nf010f0d2c71758cc@mail.gmail.com> References: <20fefa50903301422t5aefb8d3n7bc3a3406e3b7886@mail.gmail.com> <20fefa50903301511k6ca27794nf010f0d2c71758cc@mail.gmail.com> Message-ID: Thank you so much, If you send me your patch, I send it to a friend of mine, because we want to start this project for the next week. Regards, Stephane On 31 Mar 2009, at 00:11, Matt Aimonetti wrote: > If I can find 5 minutes tonight, I'll try to write a quick work > around patch for you so you can start working on your project and > not wait for Macruby to be fixed. > > - Matt > > > On Mon, Mar 30, 2009 at 2:51 PM, St?phane Wirtel > wrote: > http://www.macruby.org/trac/ticket/134 > > Thank you > > But I hope this bug will be resolved because I want to implement a > native cocoa client for the OpenERP project > > On 30 Mar 2009, at 23:22, Matt Aimonetti wrote: > > Could you please create a ticket for this bug, it looks like a > constant is being called before being defined. It might be related > to the load order in MacRuby (wild guess). > > - Matt > > On Mon, Mar 30, 2009 at 2:02 PM, St?phane Wirtel > wrote: > Hi all, > > I am trying to create a small xml-rpc client with macruby, but I got > this error. > > stargate:test_ruby stephane$ ./client.rb > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ > 1.9.1/rexml/attribute.rb:18:in `': uninitialized > constant REXML::Attribute::NAME_STR (NameError) > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/attribute.rb:9:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/attribute.rb:4:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/element.rb:3:in `require' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/element.rb:3:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/document.rb:1:in `require' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/rexml/document.rb:1:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/parser.rb:700:in `require' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/parser.rb:700:in `initialize' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/utils.rb:48:in `new' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/utils.rb:48:in `parser' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/client.rb:421:in `call2' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/ > lib/ruby/1.9.1/xmlrpc/client.rb:410:in `call' > from ./client.rb:6:in `
' > > > Here is the source code of my small client > > #!/usr/local/bin/macruby > > require "xmlrpc/client" > > server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", > 8069) > puts server.call("about") > > This code works fine with the standard ruby. > > So, I have downloaded the trunk version and I will try to fix this > bug, and make a patch. > > Regards, > > Stephane > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > St?phane Wirtel > stephane.wirtel at gmail.com > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel St?phane Wirtel stephane.wirtel at gmail.com From mattaimonetti at gmail.com Mon Mar 30 15:18:44 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 15:18:44 -0700 Subject: [MacRuby-devel] [hotcocoa] http wrapper, what do you think? In-Reply-To: <6452C5F0-6A82-4049-AABA-1151D7765B57@apple.com> References: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> <57E1098B-C860-4829-BD41-D4D3018D4DD1@apple.com> <20fefa50903301437o75056b88ra89a8cead89f59d1@mail.gmail.com> <6452C5F0-6A82-4049-AABA-1151D7765B57@apple.com> Message-ID: <20fefa50903301518x29e153d5x397cffa0885bf7ff@mail.gmail.com> Oh right, I don't have a mapping for "start" but that's pretty easy to add. The "finish" mapping is the optional block you pass to the helper method. Once the request is processed, the block is being called. I'm wondering if these callbacks, shouldn't be defined using accessors instead. passing too many options via a hash is kinda nasty, don't you think? The problem with adding accessors to the helper is that now I need to use a kicker method and we end up with almost the same API as the default obj-c api :p - Matt On Mon, Mar 30, 2009 at 3:06 PM, Ernest N. Prabhakar, Ph.D. < prabhaka at apple.com> wrote: > Hi Matt, > > On Mar 30, 2009, at 2:37 PM, Matt Aimonetti wrote: > >> Pretty cool, my library does(will do) what Shoes does but with more >> flexibility (you can assign any class/objects as a delegates and it supports >> more options (including using your keychain for auth)). >> Did/do you use Shoes, if so, I'd be interested in knowing what you think >> we are missing or what we should look at. >> > > The one thing I didn't notice in your API was having explicit mappings for > "start" and "finish", (though I see "progress" on your TODO). > > -- Ernie P. > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ehynes at dharmagaia.com Mon Mar 30 15:46:11 2009 From: ehynes at dharmagaia.com (Edward Hynes) Date: Mon, 30 Mar 2009 18:46:11 -0400 Subject: [MacRuby-devel] Accessing Obj-C InstVars from Ruby In-Reply-To: <06108C4C-2F5C-45E3-B7CC-D98959B8BE5F@apple.com> References: <6095192F-2496-484C-A981-23A89A45381D@dharmagaia.com> <06108C4C-2F5C-45E3-B7CC-D98959B8BE5F@apple.com> Message-ID: <7E98285D-BFF2-44CF-8834-B9C826FFF23E@dharmagaia.com> Accessors, it's soooo obvious (after you all pointed the way ;^) Thanks, Ed From chapbr at gmail.com Mon Mar 30 16:36:22 2009 From: chapbr at gmail.com (Brian Chapados) Date: Mon, 30 Mar 2009 16:36:22 -0700 Subject: [MacRuby-devel] [hotcocoa] http wrapper, what do you think? In-Reply-To: <20fefa50903301500k48068bb7kfc15ea8e8cafd822@mail.gmail.com> References: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> <20fefa50903301500k48068bb7kfc15ea8e8cafd822@mail.gmail.com> Message-ID: 2009/3/30 Matt Aimonetti : >> Does the delegate object also receive messages that would be sent to an >> NSURLDownload? > > I'm actually using NSURLConnection and not NSURLDownload which seemed a bit > too simple when I looked at it. If the delegator is a proc, then it > currently only gets called once the request finished properly. (I still need > to write the error handling etc...) > If your delegator is an object or a class, all messages should be passed > directly. Right... NSURLConnection is more flexible. >> Also, regarding multi-threading, couldn't you just use NSURLDownload >> (which you're probably already using underneath) + >> NSOperation/NSOperationQueue. > > I need to look into NSOperation/NSOperationQueue to see how it works, I'm > still pretty new to Cocoa and I don't know all the tricks cool kids use ;) The libraries are vast, and the NSOperation stuff is new in 10.5, so there aren't as many examples floating around the net. Just throwing it out there as a possibility. I'm not sure how hard it would be to implement. I've only used NSOperation for really simple stuff. > I'll do what Ernie and put what I have so far on GitHub and let people hack > on it until we have something nice that could be used in most use cases. > Since I'm going on vacation, I'll add you (Brian) to my repo so you can deal > with pull requests and push your own stuff there ;) So, you are assigning me as the delegate? ;-) > Reharding using the class outside of HotCocoa, I agree, but you should be > able to only require the file and include the module. What do you think? Yes, that makes sense. It sounds like you've got a good start. I agree with your goal of just making the standard use cases easy. It is nice to have a block right next to the download call, as it is easy to understand the logic. If something requires more complicated handling, then delegate option is always available. Anyway, I'll see if I can make any progress on NSOperation and error-handling. Brian > > On Mon, Mar 30, 2009 at 2:46 PM, Brian Chapados wrote: >> >> Seems like a good idea that would be useful even outside of HotCocoa. >> Especially for simple cases, I think if Obj-C had blocks, this would >> be a good place to use them. For more control, the delegate pattern >> actually works really well. ?It's good that you have a way to do both. >> Does the delegate object also receive messages that would be sent to >> an NSURLDownload? ?That might be a nice way to allow easy integration >> in cases where an object that responds to the delegate methods is >> defined in Obj-C. >> >> Also, regarding multi-threading, couldn't you just use NSURLDownload >> (which you're probably already using underneath) + >> NSOperation/NSOperationQueue. Since your #download method already >> wraps the underlying process, you could should able to generate >> NSOperations to perform the downloads and add them to a queue. ?Those >> classes handle creating threads (which have their own runloops) and >> performing a task on the thread. That said, maybe this approach would >> not work with the current IO implementation? >> >> Brian >> >> 2009/3/30 Matt Aimonetti : >> > In my free time, I've been working on a http://lighthouseapp.com client >> > app >> > which mixes API calls with webkit views (I'll release the source code >> > later >> > on). >> > The app is 100% HotCocoa (meaning that I didn't use any nib/xibs). >> > For people who are not used to work with delegation, having to deal with >> > file download, URL queries can be a bit challenging if you want to start >> > using the underlying obj-c methods. >> > >> > That's why I wrote a small HTTP wrapper to clean up my code and make >> > download/queries easier. >> > The library is divided in 2 major parts, a helper and the Query/Response >> > classes. >> > >> > Here is how the helper looks like so far: >> > >> > ?Download helper making file download trivial >> > ?Pass an url, and a block or a delegator >> > ?A block takes precedence over a delegator, meaning that you can't >> > ?pass a delegator and use a block, you have to choose which approach >> > ?to pick. >> > >> > ?==== Parameters >> > ?url:: url of the resource to download >> > ?options:: optional options used for the query >> > ?&block:: block which is called when the file is downloaded >> > >> > ?==== Options >> > ?:method:: An optional value which represents the HTTP >> > method to use >> > ?:payload::??? - data to pass to a POST, PUT, DELETE query. >> > ?:delegation:: - class or instance to call when the file is >> > downloaded. >> > ???????????????????????? the handle_query_response method will be called >> > on >> > the >> > ???????????????????????? passed object >> > ?:save_to::??? - path to save the response to >> > ?:credential::?? - should contains the :user key and :password key >> > ???????????????????????? By default the credential will be saved for the >> > entire session >> > >> > ?TODO >> > ?:progress ::??? Proc to call everytime the downloader makes some >> > progress >> > ?:cache_storage >> > ?:custom headers >> > ?Error handling >> > >> > ?==== Examples >> > >> > ??? download("http://www.macruby.org/files/MacRuby%200.4.zip", {:save_to >> > => >> > '~/tmp/macruby.zip'.stringByStandardizingPath}) do |macruby| >> > ????? NSLog("file downloaded!") >> > ??? end >> > >> > ?? download "http://macruby.org" do |mr| >> > ???? # The response object has 3 accessors: status_code, headers and >> > body >> > ???? NSLog("status: #{mr.status_code}, Headers: #{mr.headers.inspect}") >> > ?? end >> > >> > ?? path = File.expand_path('~/macruby_tmp.html') >> > ?? window :frame => [100, 100, 500, 500], :title => "HotCocoa" do |win| >> > ???? download("http://macruby.org", {:save_to => path}) do |homepage| >> > ?????? win << label(:text => "status code: #{homepage.status_code}", >> > :layout >> > => {:start => false}) >> > ?????? win << label(:text => "Headers: #{homepage.headers.inspect}", >> > :layout >> > => {:start => false}) >> > ???? end >> > ?? end >> > >> > ?? download "http://macruby.org/users/matt", :delegation => >> > @downloaded_file, :method => 'PUT', :payload => {:name => 'matt >> > aimonetti'} >> > >> > ?? download "http://macruby.org/roadmap.xml", :delegation => self >> > >> > ?? download "http://localhost:5984/couchrest-test/", :method => 'POST', >> > :payload => '{"user":"mattaimonetti at gmail.com","zip":92129}', >> > :delegation => >> > self >> > >> > ?? download("http://mysite.com/login", {:credential => {:user => 'me', >> > :password => 's3krit'}}) do |test| >> > ???? NSLog("response received: #{test.headers} #{test.status_code}") >> > ?? end >> > >> > >> > As you can see from the example list, the method name download isn't >> > always >> > appropriate and maybe I should give it the http_query alias. What do you >> > think? >> > What's nice with this approach, is that on top of being simple, the >> > query >> > and the response handling are async so the rest of your code can be run >> > and >> > you get notified only when the response comes back. >> > >> > The underlying API looks like that:? MacRubyHTTP::Query.new( url, >> > http_method='GET', options={} ) >> > Queries don't run in a custom runloop yet but that's something I want to >> > look at once IO work on the experimental branch will be done. >> > >> > >> > So, here is my question, do you guys think that this is something that >> > should be part of HotCocoa or it's better if it stays its own separate >> > lib? >> > Also, what do you think about having a default vendor folder for >> > hotcocoa >> > apps and autoload the vendor files if available? >> > >> > - Matt >> > >> > >> > _______________________________________________ >> > MacRuby-devel mailing list >> > MacRuby-devel at lists.macosforge.org >> > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> > >> > >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > From ruby-noreply at macosforge.org Mon Mar 30 18:32:42 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Tue, 31 Mar 2009 01:32:42 -0000 Subject: [MacRuby-devel] [MacRuby] #240: no such file to load -- stringio.rb.bundle when starting irb/gems In-Reply-To: <042.3b242b694944ae4f01068062cede7a44@macosforge.org> References: <042.3b242b694944ae4f01068062cede7a44@macosforge.org> Message-ID: <051.ff5c4ddb016e1665a691d5bef9d4c524@macosforge.org> #240: no such file to load -- stringio.rb.bundle when starting irb/gems -------------------------+-------------------------------------------------- Reporter: i@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -------------------------+-------------------------------------------------- Comment(by i@?): This is what I found out {{{ Last login: Tue Mar 31 03:25:20 on ttys000 [teamon ~] macirb irb(main):001:0> require 'stringio' LoadError: no such file to load -- stringio.rb.bundle from (irb):1:in `require' from (irb):1 from /usr/local/bin/macirb:12:in `
' irb(main):002:0> require 'stringio.bundle' => true irb(main):004:0> require 'syck.bundle' => true irb(main):005:0> require 'rubygems' => true irb(main):006:0> }}} it looks like MacRuby first appends ".rb" to the end of string and then appends ".bundle" -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Mon Mar 30 20:01:28 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Tue, 31 Mar 2009 03:01:28 -0000 Subject: [MacRuby-devel] [MacRuby] #134: require 'rexml/document' fails In-Reply-To: <053.9607c6edbd717c36c6be2265db40d5f1@macosforge.org> References: <053.9607c6edbd717c36c6be2265db40d5f1@macosforge.org> Message-ID: <062.d79a098b676f0a92ed381163368c01ec@macosforge.org> #134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@? | Owner: lsansonetti@? Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by mattaimonetti@?): Because the constants are not inherited properly, we need to reopen the Attribute class and include the module defining the constants we are after. You can use the following hack to get rexml working until this problem gets resolved: {{{ require 'rexml/xmltokens' module REXML class Attribute include ::REXML::XMLTokens end end }}} You can put the hotpatch in a ruby file and require it before loading rexml/client or rexml/document. - Matt -- Ticket URL: MacRuby From mattaimonetti at gmail.com Mon Mar 30 20:05:38 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 20:05:38 -0700 Subject: [MacRuby-devel] MacRuby and XML-RPC In-Reply-To: References: <20fefa50903301422t5aefb8d3n7bc3a3406e3b7886@mail.gmail.com> <20fefa50903301511k6ca27794nf010f0d2c71758cc@mail.gmail.com> Message-ID: <20fefa50903302005wffba952y6c1964ef4db2b045@mail.gmail.com> There you go: $ macirb >> require 'rexml/xmltokens' => true >> module REXML >> class Attribute >> include ::REXML::XMLTokens >> end >> end => REXML::Attribute >> require "xmlrpc/client" => true >> server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", 8069) => ##-> tiny.my.odoo.com:8069 open=false>, @http_last_response=nil, @proxy_port=nil, @parser=nil, @timeout=30, @http_header_extra=nil, @proxy_host=nil> >> puts server.call("about") OpenERP is an ERP+CRM program for small and medium businesses. The whole source code is distributed under the terms of the GNU Public Licence. (c) 2003-TODAY, Fabien Pinckaers - Tiny sprl => nil I added the tiny patch to the bug tracker so other people can use this workaround and get rexml working. I'm sure there a obj-c XML-RPC client we could wrap in a macruby specfic lib, rexml is pretty awful :( - Matt On Mon, Mar 30, 2009 at 3:16 PM, St?phane Wirtel wrote: > Thank you so much, > > If you send me your patch, I send it to a friend of mine, because we want > to start this project for the next week. > > Regards, > > Stephane > > On 31 Mar 2009, at 00:11, Matt Aimonetti wrote: > > If I can find 5 minutes tonight, I'll try to write a quick work around >> patch for you so you can start working on your project and not wait for >> Macruby to be fixed. >> >> - Matt >> >> >> On Mon, Mar 30, 2009 at 2:51 PM, St?phane Wirtel < >> stephane.wirtel at gmail.com> wrote: >> http://www.macruby.org/trac/ticket/134 >> >> Thank you >> >> But I hope this bug will be resolved because I want to implement a native >> cocoa client for the OpenERP project >> >> On 30 Mar 2009, at 23:22, Matt Aimonetti wrote: >> >> Could you please create a ticket for this bug, it looks like a constant is >> being called before being defined. It might be related to the load order in >> MacRuby (wild guess). >> >> - Matt >> >> On Mon, Mar 30, 2009 at 2:02 PM, St?phane Wirtel < >> stephane.wirtel at gmail.com> wrote: >> Hi all, >> >> I am trying to create a small xml-rpc client with macruby, but I got this >> error. >> >> stargate:test_ruby stephane$ ./client.rb >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:18:in >> `': uninitialized constant REXML::Attribute::NAME_STR >> (NameError) >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:9:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:4:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in >> `require' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in >> `require' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/parser.rb:700:in >> `require' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/parser.rb:700:in >> `initialize' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/utils.rb:48:in >> `new' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/utils.rb:48:in >> `parser' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/client.rb:421:in >> `call2' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/client.rb:410:in >> `call' >> from ./client.rb:6:in `
' >> >> >> Here is the source code of my small client >> >> #!/usr/local/bin/macruby >> >> require "xmlrpc/client" >> >> server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", 8069) >> puts server.call("about") >> >> This code works fine with the standard ruby. >> >> So, I have downloaded the trunk version and I will try to fix this bug, >> and make a patch. >> >> Regards, >> >> Stephane >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> St?phane Wirtel >> stephane.wirtel at gmail.com >> >> >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> > > St?phane Wirtel > stephane.wirtel at gmail.com > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.wirtel at gmail.com Mon Mar 30 22:48:45 2009 From: stephane.wirtel at gmail.com (=?ISO-8859-1?Q?St=E9phane_Wirtel?=) Date: Tue, 31 Mar 2009 07:48:45 +0200 Subject: [MacRuby-devel] MacRuby and XML-RPC In-Reply-To: <20fefa50903302005wffba952y6c1964ef4db2b045@mail.gmail.com> References: <20fefa50903301422t5aefb8d3n7bc3a3406e3b7886@mail.gmail.com> <20fefa50903301511k6ca27794nf010f0d2c71758cc@mail.gmail.com> <20fefa50903302005wffba952y6c1964ef4db2b045@mail.gmail.com> Message-ID: <841ABAD4-FA1A-4223-A976-18A0F89B11BB@gmail.com> Thank you for the workaround and the patch. It works Stephane On 31 Mar 2009, at 05:05, Matt Aimonetti wrote: > There you go: > > $ macirb > >> require 'rexml/xmltokens' > => true > >> module REXML > >> class Attribute > >> include ::REXML::XMLTokens > >> end > >> end > => REXML::Attribute > >> require "xmlrpc/client" > => true > >> server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", > 8069) > => ##- @use_ssl=false, @auth=nil, @create=nil, @http=#<# 0x8003bff00>> tiny.my.odoo.com:8069 open=false>, > @http_last_response=nil, @proxy_port=nil, @parser=nil, @timeout=30, > @http_header_extra=nil, @proxy_host=nil> > >> puts server.call("about") > > > OpenERP is an ERP+CRM program for small and medium businesses. > > The whole source code is distributed under the terms of the > GNU Public Licence. > > (c) 2003-TODAY, Fabien Pinckaers - Tiny sprl > => nil > > > I added the tiny patch to the bug tracker so other people can use > this workaround and get rexml working. > I'm sure there a obj-c XML-RPC client we could wrap in a macruby > specfic lib, rexml is pretty awful :( > > - Matt > > > > > On Mon, Mar 30, 2009 at 3:16 PM, St?phane Wirtel > wrote: > Thank you so much, > > If you send me your patch, I send it to a friend of mine, because we > want to start this project for the next week. > > Regards, > > Stephane > > On 31 Mar 2009, at 00:11, Matt Aimonetti wrote: > > If I can find 5 minutes tonight, I'll try to write a quick work > around patch for you so you can start working on your project and > not wait for Macruby to be fixed. > > - Matt > > > On Mon, Mar 30, 2009 at 2:51 PM, St?phane Wirtel > wrote: > http://www.macruby.org/trac/ticket/134 > > Thank you > > But I hope this bug will be resolved because I want to implement a > native cocoa client for the OpenERP project > > On 30 Mar 2009, at 23:22, Matt Aimonetti wrote: > > Could you please create a ticket for this bug, it looks like a > constant is being called before being defined. It might be related > to the load order in MacRuby (wild guess). > > - Matt > > On Mon, Mar 30, 2009 at 2:02 PM, St?phane Wirtel > wrote: > Hi all, > > I am trying to create a small xml-rpc client with macruby, but I got > this error. > > stargate:test_ruby stephane$ ./client.rb > /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ > 1.9.1/rexml/attribute.rb:18:in `': uninitialized > constant REXML::Attribute::NAME_STR (NameError) > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/rexml/attribute.rb:9:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/rexml/attribute.rb:4:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/rexml/element.rb:3:in `require' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/rexml/element.rb:3:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/rexml/document.rb:1:in `require' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/rexml/document.rb:1:in `' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/xmlrpc/parser.rb:700:in `require' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/xmlrpc/parser.rb:700:in `initialize' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/xmlrpc/utils.rb:48:in `new' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/xmlrpc/utils.rb:48:in `parser' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/xmlrpc/client.rb:421:in `call2' > from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ > ruby/1.9.1/xmlrpc/client.rb:410:in `call' > from ./client.rb:6:in `
' > > > Here is the source code of my small client > > #!/usr/local/bin/macruby > > require "xmlrpc/client" > > server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", > 8069) > puts server.call("about") > > This code works fine with the standard ruby. > > So, I have downloaded the trunk version and I will try to fix this > bug, and make a patch. > > Regards, > > Stephane > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > St?phane Wirtel > stephane.wirtel at gmail.com > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > St?phane Wirtel > stephane.wirtel at gmail.com > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel St?phane Wirtel stephane.wirtel at gmail.com From mattaimonetti at gmail.com Mon Mar 30 23:00:08 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Mon, 30 Mar 2009 23:00:08 -0700 Subject: [MacRuby-devel] MacRuby and XML-RPC In-Reply-To: <841ABAD4-FA1A-4223-A976-18A0F89B11BB@gmail.com> References: <20fefa50903301422t5aefb8d3n7bc3a3406e3b7886@mail.gmail.com> <20fefa50903301511k6ca27794nf010f0d2c71758cc@mail.gmail.com> <20fefa50903302005wffba952y6c1964ef4db2b045@mail.gmail.com> <841ABAD4-FA1A-4223-A976-18A0F89B11BB@gmail.com> Message-ID: <20fefa50903302300y497fba35id4892d6b4dfac2de@mail.gmail.com> You're welcome, please keep us posted, your project sounds pretty interesting :) Btw, I'm glad to see so many French speakers in the MacRuby community! - Matt On Mon, Mar 30, 2009 at 10:48 PM, St?phane Wirtel wrote: > Thank you for the workaround and the patch. > > It works > > Stephane > > On 31 Mar 2009, at 05:05, Matt Aimonetti wrote: > > There you go: >> >> $ macirb >> >> require 'rexml/xmltokens' >> => true >> >> module REXML >> >> class Attribute >> >> include ::REXML::XMLTokens >> >> end >> >> end >> => REXML::Attribute >> >> require "xmlrpc/client" >> => true >> >> server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", >> 8069) >> => ##-> @path="/xmlrpc/common", @cookie=nil, @user=nil, @port=8069, @password=nil, >> @use_ssl=false, @auth=nil, @create=nil, >> @http=#<#> tiny.my.odoo.com:8069open=false>, @http_last_response=nil, @proxy_port=nil, @parser=nil, >> @timeout=30, @http_header_extra=nil, @proxy_host=nil> >> >> puts server.call("about") >> >> >> OpenERP is an ERP+CRM program for small and medium businesses. >> >> The whole source code is distributed under the terms of the >> GNU Public Licence. >> >> (c) 2003-TODAY, Fabien Pinckaers - Tiny sprl >> => nil >> >> >> I added the tiny patch to the bug tracker so other people can use this >> workaround and get rexml working. >> I'm sure there a obj-c XML-RPC client we could wrap in a macruby specfic >> lib, rexml is pretty awful :( >> >> - Matt >> >> >> >> >> On Mon, Mar 30, 2009 at 3:16 PM, St?phane Wirtel < >> stephane.wirtel at gmail.com> wrote: >> Thank you so much, >> >> If you send me your patch, I send it to a friend of mine, because we want >> to start this project for the next week. >> >> Regards, >> >> Stephane >> >> On 31 Mar 2009, at 00:11, Matt Aimonetti wrote: >> >> If I can find 5 minutes tonight, I'll try to write a quick work around >> patch for you so you can start working on your project and not wait for >> Macruby to be fixed. >> >> - Matt >> >> >> On Mon, Mar 30, 2009 at 2:51 PM, St?phane Wirtel < >> stephane.wirtel at gmail.com> wrote: >> http://www.macruby.org/trac/ticket/134 >> >> Thank you >> >> But I hope this bug will be resolved because I want to implement a native >> cocoa client for the OpenERP project >> >> On 30 Mar 2009, at 23:22, Matt Aimonetti wrote: >> >> Could you please create a ticket for this bug, it looks like a constant is >> being called before being defined. It might be related to the load order in >> MacRuby (wild guess). >> >> - Matt >> >> On Mon, Mar 30, 2009 at 2:02 PM, St?phane Wirtel < >> stephane.wirtel at gmail.com> wrote: >> Hi all, >> >> I am trying to create a small xml-rpc client with macruby, but I got this >> error. >> >> stargate:test_ruby stephane$ ./client.rb >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:18:in >> `': uninitialized constant REXML::Attribute::NAME_STR >> (NameError) >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:9:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/attribute.rb:4:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in >> `require' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/element.rb:3:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in >> `require' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/rexml/document.rb:1:in >> `' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/parser.rb:700:in >> `require' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/parser.rb:700:in >> `initialize' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/utils.rb:48:in >> `new' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/utils.rb:48:in >> `parser' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/client.rb:421:in >> `call2' >> from >> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.1/xmlrpc/client.rb:410:in >> `call' >> from ./client.rb:6:in `
' >> >> >> Here is the source code of my small client >> >> #!/usr/local/bin/macruby >> >> require "xmlrpc/client" >> >> server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common", 8069) >> puts server.call("about") >> >> This code works fine with the standard ruby. >> >> So, I have downloaded the trunk version and I will try to fix this bug, >> and make a patch. >> >> Regards, >> >> Stephane >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> St?phane Wirtel >> stephane.wirtel at gmail.com >> >> >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> St?phane Wirtel >> stephane.wirtel at gmail.com >> >> >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> > > St?phane Wirtel > stephane.wirtel at gmail.com > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby-noreply at macosforge.org Tue Mar 31 00:00:12 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Tue, 31 Mar 2009 07:00:12 -0000 Subject: [MacRuby-devel] [MacRuby] #193: exec() does not work on MacRuby In-Reply-To: <057.f9c777beef15da1f89c2476b23c5a0a1@macosforge.org> References: <057.f9c777beef15da1f89c2476b23c5a0a1@macosforge.org> Message-ID: <066.6d6044f3e54336f3f28ca4c06ce9396b@macosforge.org> #193: exec() does not work on MacRuby ----------------------------------------+----------------------------------- Reporter: vincent.isambart@? | Owner: lsansonetti@? Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- Comment(by kourge@?): Interestingly, the backtick syntax works: {{{ ~$ macirb >> `ls Applications` => "CrossOver?n" >> }}} -- Ticket URL: MacRuby From ruby-noreply at macosforge.org Tue Mar 31 00:05:02 2009 From: ruby-noreply at macosforge.org (MacRuby) Date: Tue, 31 Mar 2009 07:05:02 -0000 Subject: [MacRuby-devel] [MacRuby] #241: NSMutableSet#merge fails Message-ID: <047.5dfbcc93251aef974426e6cf12e4184c@macosforge.org> #241: NSMutableSet#merge fails ------------------------------+--------------------------------------------- Reporter: kourge@? | Owner: lsansonetti@? Type: defect | Status: new Priority: major | Milestone: MacRuby 0.4 Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- NSMutableSet#merge succeeds if called with another NSMutableSet, but it fails when passed an Enumerable, such as NSMutableArray. {{{ ~ kourge$ irb >> s = Set[1, 2] NameError: uninitialized constant Set from (irb):1 >> require 'set' => true >> s = Set[1, 2] => # >> s.merge [3, 4] => # >> quit ~ kourge$ macirb >> s = Set[1, 2] => # >> s.merge [3, 4] 2009-03-30 23:54:03.319 macruby[233:10b] *** -[NSCFArray _applyValues:context:]: unrecognized selector sent to instance 0x80047cd80 2009-03-30 23:54:03.365 macruby[233:10b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFArray _applyValues:context:]: unrecognized selector sent to instance 0x80047cd80' 2009-03-30 23:54:03.366 macruby[233:10b] Stack: ( 140735351352508, 140735358957775, 140735351379451, 140735351372932, 140735351373272, 4295759037, 4296060391, 4296017807, 4296038178, 4296040810, 4296042845, 4296060391, 4296017807, 4296038178, 4296074114, 4295152255, 4295972133, 4296060391, 4296017807, 4296038178, 4296066197, 4296060391, 4296017807, 4296038178, 4296066197, 4296060391, 4296017807, 4296038178, 4296038828, 4295151426, 4295164679, 4294971167, 4294971044 ) terminate called after throwing an instance of 'NSException' Abort trap ~ kourge$ }}} -- Ticket URL: MacRuby From timrandg at gmail.com Tue Mar 31 01:17:45 2009 From: timrandg at gmail.com (Tim Rand) Date: Tue, 31 Mar 2009 01:17:45 -0700 Subject: [MacRuby-devel] Can any kind macruby experts help me get sqlite3 gem working with macruby--please? Message-ID: Can any kind macruby experts help me get sqlite3 gem working with macruby? sqlite3-ruby-1.2.4 ruby gem works in ruby 1.9.0. So I think it should work in macruby also... >From macirb I added the path to the gem: $: << "path/to/the/sqlite3-ruby-1.2.4/lib" require 'sqlite3.rb' # => true $db = SQLite3::Database.new("/path/to/x.db.rsd") RuntimeError: *no driver for sqlite3 found* the error comes from the load_driver method near line 621 of the sqlite3/database.rb file. def load_driver( driver ) case driver when Class # do nothing--use what was given when Symbol, String require "sqlite3/driver/#{driver.to_s.downcase}/driver" driver = SQLite3::Driver.const_get( driver )::Driver else [ "Native", "DL" ].each do |d| begin require "sqlite3/driver/#{d.downcase}/driver" driver = SQLite3::Driver.const_get( d )::Driver break rescue SyntaxError raise rescue ScriptError, Exception, NameError end end raise "no driver for sqlite3 found" unless driver end @driver = driver.new end private :load_driver Macruby enters the method with driver set to NSNull, and the driver fails to load. In ruby (1.9.0) the driver loads via the Native driver. irb19 session: >> db = SQLite3::Database.new("/Users/Tim/Desktop/newdb") => #, @statement_factory=SQLite3::Statement, @handle=#, @closed=false, @results_as_hash=false, @type_translation=false, @translator=nil, @transaction_active=false> Can anyone offer an idea about how they might try to patch this to work with macruby? I know an alternative would be CoreData--but it is too cumbersome for me. Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattaimonetti at gmail.com Tue Mar 31 01:51:07 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Tue, 31 Mar 2009 01:51:07 -0700 Subject: [MacRuby-devel] Can any kind macruby experts help me get sqlite3 gem working with macruby--please? In-Reply-To: References: Message-ID: <20fefa50903310151r6cb96a11lf2f0d394428f5738@mail.gmail.com> the sqlite3 gem uses a native C extension which needs to compiled for your system. (usually done when installed via rubygems) The installation will fail if you use macgem, probably due to some IO issues and the lack of support of C extension. Someone should look into writing a wrapper for macruby using an obj-c driver. That can't be that hard and that would be very useful. I've been thinking about porting the DataObject and the DO SQlite3 driver to MacRuby but I didn't have time yet (and I didn't really need it either). DataObject is the uniform API used by DataMapper to talk to its drivers. If someone is interested in working on that, I can put him/her in contact with the DM team. - Matt 2009/3/31 Tim Rand > Can any kind macruby experts help me get sqlite3 gem working with macruby? > > sqlite3-ruby-1.2.4 ruby gem works in ruby 1.9.0. So I think it should work > in macruby also... > From macirb I added the path to the gem: > > $: << "path/to/the/sqlite3-ruby-1.2.4/lib" > > require 'sqlite3.rb' # => true > > $db = SQLite3::Database.new("/path/to/x.db.rsd") > > RuntimeError: *no driver for sqlite3 found* > the error comes from the load_driver method near line 621 of the > sqlite3/database.rb file. > > def load_driver( driver ) > case driver > when Class > # do nothing--use what was given > when Symbol, String > require "sqlite3/driver/#{driver.to_s.downcase}/driver" > driver = SQLite3::Driver.const_get( driver )::Driver > else > [ "Native", "DL" ].each do |d| > begin > require "sqlite3/driver/#{d.downcase}/driver" > driver = SQLite3::Driver.const_get( d )::Driver > break > rescue SyntaxError > raise > rescue ScriptError, Exception, NameError > end > end > raise "no driver for sqlite3 found" unless driver > end > > @driver = driver.new > end > private :load_driver > > Macruby enters the method with driver set to NSNull, and the driver fails > to load. In ruby (1.9.0) the driver loads via the Native driver. > > irb19 session: > >> db = SQLite3::Database.new("/Users/Tim/Desktop/newdb") > => # @driver=# @authorizer={}, @busy_handler={}, @trace={}>, > @statement_factory=SQLite3::Statement, > @handle=#, @closed=false, > @results_as_hash=false, @type_translation=false, @translator=nil, > @transaction_active=false> > > Can anyone offer an idea about how they might try to patch this to work > with macruby? I know an alternative would be CoreData--but it is too > cumbersome for me. > Thanks, > Tim > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From timrandg at gmail.com Tue Mar 31 08:32:04 2009 From: timrandg at gmail.com (Tim Rand) Date: Tue, 31 Mar 2009 08:32:04 -0700 Subject: [MacRuby-devel] macruby and sqlite3 gem Message-ID: I was worried that it was an IO issue with macruby, which is why I am very excited that the 0.5 version is going to be address the IO system--hopefully it will help with this issue. I would love to help, but an issue spanning macruby, obj-c, sqlite3, and possibly C is really stretching my abilities. On the subject of sqlite wrappers in objective-C. I tried several that I found on the sqlite webpage (the have a long list of wrappers in several languages including obj-c). But it appears that most if not all are not being maintained and are not up to date and don't work with Leopard. If anyone knows of a light weight obj-c wrapper for sqlite3 that works in Leopard, please let us know. If I had some code that works to look at, I should be able to adapt it for macruby. framework 'QuickLite.framework' # fails with the error below framework 'QuickLite' # fails can't find file Error Domain=NSCocoaErrorDomain Code=3585 UserInfo=0x800621ae0 "The bundle ?QuickLite? could not be loaded because it does not contain a version for the current architecture." On Tue, Mar 31, 2009 at 7:24 AM, wrote: > Send MacRuby-devel mailing list submissions to > ? ? ? ?macruby-devel at lists.macosforge.org > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ?http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > or, via email, send a message with subject or body 'help' to > ? ? ? ?macruby-devel-request at lists.macosforge.org > > You can reach the person managing the list at > ? ? ? ?macruby-devel-owner at lists.macosforge.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of MacRuby-devel digest..." > > > Today's Topics: > > ? 1. Re: Can any kind macruby experts help me get ? ? ?sqlite3 gem > ? ? ?working with macruby--please? (Matt Aimonetti) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 31 Mar 2009 01:51:07 -0700 > From: Matt Aimonetti > Subject: Re: [MacRuby-devel] Can any kind macruby experts help me get > ? ? ? ?sqlite3 gem working with macruby--please? > To: "MacRuby development discussions." > ? ? ? ? > Message-ID: > ? ? ? ?<20fefa50903310151r6cb96a11lf2f0d394428f5738 at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > the sqlite3 gem uses a native C extension which needs to compiled for your > system. (usually done when installed via rubygems) > The installation will fail if you use macgem, probably due to some IO issues > and the lack of support of C extension. > > Someone should look into writing a wrapper for macruby using an obj-c > driver. That can't be that hard and that would be very useful. I've been > thinking about porting the DataObject and the DO SQlite3 driver to MacRuby > but I didn't have time yet (and I didn't really need it either). ?DataObject > is the uniform API used by DataMapper to talk to its drivers. > If someone is interested in working on that, I can put him/her in contact > with the DM team. > > - Matt > > > > 2009/3/31 Tim Rand > >> Can any kind macruby experts help me get sqlite3 gem working with macruby? >> >> sqlite3-ruby-1.2.4 ruby gem works in ruby 1.9.0. So I think it should work >> in macruby also... >> From macirb I added the path to the gem: >> >> $: << "path/to/the/sqlite3-ruby-1.2.4/lib" >> >> require 'sqlite3.rb' ?# => true >> >> $db = SQLite3::Database.new("/path/to/x.db.rsd") >> >> RuntimeError: *no driver for sqlite3 found* >> the error comes from the load_driver method near line 621 of the >> sqlite3/database.rb file. >> >> ? ?def load_driver( driver ) >> ? ? ? case driver >> ? ? ? ? when Class >> ? ? ? ? ? # do nothing--use what was given >> ? ? ? ? when Symbol, String >> ? ? ? ? ? require "sqlite3/driver/#{driver.to_s.downcase}/driver" >> ? ? ? ? ? driver = SQLite3::Driver.const_get( driver )::Driver >> ? ? ? ? else >> ? ? ? ? ? [ "Native", "DL" ].each do |d| >> ? ? ? ? ? ? begin >> ? ? ? ? ? ? ? require "sqlite3/driver/#{d.downcase}/driver" >> ? ? ? ? ? ? ? driver = SQLite3::Driver.const_get( d )::Driver >> ? ? ? ? ? ? ? break >> ? ? ? ? ? ? rescue SyntaxError >> ? ? ? ? ? ? ? raise >> ? ? ? ? ? ? rescue ScriptError, Exception, NameError >> ? ? ? ? ? ? end >> ? ? ? ? ? end >> ? ? ? ? ? raise "no driver for sqlite3 found" unless driver >> ? ? ? end >> >> ? ? ? @driver = driver.new >> ? ? end >> ? ? private :load_driver >> >> Macruby enters the method with driver set to NSNull, and the driver fails >> to load. In ruby (1.9.0) the driver loads via the Native driver. >> >> irb19 session: >> >> db = SQLite3::Database.new("/Users/Tim/Desktop/newdb") >> => #> @driver=#> @authorizer={}, @busy_handler={}, @trace={}>, >> @statement_factory=SQLite3::Statement, >> @handle=#, @closed=false, >> @results_as_hash=false, @type_translation=false, @translator=nil, >> @transaction_active=false> >> >> Can anyone offer an idea about how they might try to patch this to work >> with macruby? ?I know an alternative would be CoreData--but it is too >> cumbersome for me. >> Thanks, >> Tim >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > End of MacRuby-devel Digest, Vol 13, Issue 47 > ********************************************* > From jordan.breeding at mac.com Tue Mar 31 08:35:38 2009 From: jordan.breeding at mac.com (Jordan Breeding) Date: Tue, 31 Mar 2009 10:35:38 -0500 Subject: [MacRuby-devel] macruby and sqlite3 gem In-Reply-To: References: Message-ID: "does not contain a version for the current architecture" sounds like a 32-bit vs. 64-bit problem to me. MacRuby 0.4 has both i386 and x86_64 archs for macruby and macirb, on a capable system it will pick the x86_64 arch first, which means any frameworks you load while running that arch need to have x86_64 in their Framework/library/bundle as well. What happens if you try running with something like `arch -arch i386 macruby` or `arch -arch i386 macirb` instead? On Mar 31, 2009, at 10:32, Tim Rand wrote: > I was worried that it was an IO issue with macruby, which is why I am > very excited that the 0.5 version is going to be address the IO > system--hopefully it will help with this issue. I would love to help, > but an issue spanning macruby, obj-c, sqlite3, and possibly C is > really stretching my abilities. > > On the subject of sqlite wrappers in objective-C. I tried several that > I found on the sqlite webpage (the have a long list of wrappers in > several languages including obj-c). But it appears that most if not > all are not being maintained and are not up to date and don't work > with Leopard. If anyone knows of a light weight obj-c wrapper for > sqlite3 that works in Leopard, please let us know. If I had some code > that works to look at, I should be able to adapt it for macruby. > > framework 'QuickLite.framework' # fails with the error below > framework 'QuickLite' # fails can't find file > > Error Domain=NSCocoaErrorDomain Code=3585 UserInfo=0x800621ae0 "The > bundle ?QuickLite? could not be loaded because it does not contain a > version for the current architecture." > > > On Tue, Mar 31, 2009 at 7:24 AM, > wrote: >> Send MacRuby-devel mailing list submissions to >> macruby-devel at lists.macosforge.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> or, via email, send a message with subject or body 'help' to >> macruby-devel-request at lists.macosforge.org >> >> You can reach the person managing the list at >> macruby-devel-owner at lists.macosforge.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of MacRuby-devel digest..." >> >> >> Today's Topics: >> >> 1. Re: Can any kind macruby experts help me get sqlite3 gem >> working with macruby--please? (Matt Aimonetti) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 31 Mar 2009 01:51:07 -0700 >> From: Matt Aimonetti >> Subject: Re: [MacRuby-devel] Can any kind macruby experts help me get >> sqlite3 gem working with macruby--please? >> To: "MacRuby development discussions." >> >> Message-ID: >> <20fefa50903310151r6cb96a11lf2f0d394428f5738 at mail.gmail.com> >> Content-Type: text/plain; charset="utf-8" >> >> the sqlite3 gem uses a native C extension which needs to compiled >> for your >> system. (usually done when installed via rubygems) >> The installation will fail if you use macgem, probably due to some >> IO issues >> and the lack of support of C extension. >> >> Someone should look into writing a wrapper for macruby using an obj-c >> driver. That can't be that hard and that would be very useful. I've >> been >> thinking about porting the DataObject and the DO SQlite3 driver to >> MacRuby >> but I didn't have time yet (and I didn't really need it either). >> DataObject >> is the uniform API used by DataMapper to talk to its drivers. >> If someone is interested in working on that, I can put him/her in >> contact >> with the DM team. >> >> - Matt >> >> >> >> 2009/3/31 Tim Rand >> >>> Can any kind macruby experts help me get sqlite3 gem working with >>> macruby? >>> >>> sqlite3-ruby-1.2.4 ruby gem works in ruby 1.9.0. So I think it >>> should work >>> in macruby also... >>> From macirb I added the path to the gem: >>> >>> $: << "path/to/the/sqlite3-ruby-1.2.4/lib" >>> >>> require 'sqlite3.rb' # => true >>> >>> $db = SQLite3::Database.new("/path/to/x.db.rsd") >>> >>> RuntimeError: *no driver for sqlite3 found* >>> the error comes from the load_driver method near line 621 of the >>> sqlite3/database.rb file. >>> >>> def load_driver( driver ) >>> case driver >>> when Class >>> # do nothing--use what was given >>> when Symbol, String >>> require "sqlite3/driver/#{driver.to_s.downcase}/driver" >>> driver = SQLite3::Driver.const_get( driver )::Driver >>> else >>> [ "Native", "DL" ].each do |d| >>> begin >>> require "sqlite3/driver/#{d.downcase}/driver" >>> driver = SQLite3::Driver.const_get( d )::Driver >>> break >>> rescue SyntaxError >>> raise >>> rescue ScriptError, Exception, NameError >>> end >>> end >>> raise "no driver for sqlite3 found" unless driver >>> end >>> >>> @driver = driver.new >>> end >>> private :load_driver >>> >>> Macruby enters the method with driver set to NSNull, and the >>> driver fails >>> to load. In ruby (1.9.0) the driver loads via the Native driver. >>> >>> irb19 session: >>>>> db = SQLite3::Database.new("/Users/Tim/Desktop/newdb") >>> => #>> @driver=#>> @callback_data={}, >>> @authorizer={}, @busy_handler={}, @trace={}>, >>> @statement_factory=SQLite3::Statement, >>> @handle=#, @closed=false, >>> @results_as_hash=false, @type_translation=false, @translator=nil, >>> @transaction_active=false> >>> >>> Can anyone offer an idea about how they might try to patch this to >>> work >>> with macruby? I know an alternative would be CoreData--but it is >>> too >>> cumbersome for me. >>> Thanks, >>> Tim >>> >>> _______________________________________________ >>> MacRuby-devel mailing list >>> MacRuby-devel at lists.macosforge.org >>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >>> >>> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: > > >> >> ------------------------------ >> >> _______________________________________________ >> MacRuby-devel mailing list >> MacRuby-devel at lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel >> >> >> End of MacRuby-devel Digest, Vol 13, Issue 47 >> ********************************************* >> > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3847 bytes Desc: not available URL: From mw at polarix.org Tue Mar 31 11:29:10 2009 From: mw at polarix.org (Markus Werner) Date: Tue, 31 Mar 2009 20:29:10 +0200 Subject: [MacRuby-devel] Macruby.framwork into Bundle Message-ID: <2983BD9A-3F7F-4207-8E42-3D5756281E8C@polarix.org> Hello List, I used the tutorial and tried to put the Macruby.framework into my Bundle. The executable already contains the right "path" to the framework and I copied the Run Script from "Embeded Mac Ruby Target" to my regular target, so the framework is in the bundle. (Why is this an extra target at all ? No criticism, just curiosity :-) ) If I do this thing with a virgin application, the application starts on a mac without macruby installed, but if I use my learnig project "http://github.com/polarix/iterm-auto-bookmark/tree/master ", the applications starts and quit immediately, without any error. BTW If somthing went wrong, on a call to a method (ruby or object-c object) you alway get a "NoMethodError" even if the method exists. The same thing applies to RubyCocoa. See http://discussions.apple.com/thread.jspa? threadID=1957372&tstart=60 if you like. :-D with kind regards Markus -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2205 bytes Desc: not available URL: From mattaimonetti at gmail.com Tue Mar 31 11:34:36 2009 From: mattaimonetti at gmail.com (Matt Aimonetti) Date: Tue, 31 Mar 2009 11:34:36 -0700 Subject: [MacRuby-devel] [hotcocoa] http wrapper, what do you think? In-Reply-To: References: <20fefa50903301108o209f269iad82fc3c6244f607@mail.gmail.com> <20fefa50903301500k48068bb7kfc15ea8e8cafd822@mail.gmail.com> Message-ID: <20fefa50903311134j19652794h9a3b2190b28d1be1@mail.gmail.com> Here is the file: http://github.com/mattetti/macruby-httpwrapper/tree/master I noticed I gave you some wrong info, currently the delegator doesn't receive all delegated messages. Instead it gets called with a custom method and the response gets passed to it. This currently only happens when the download is successful http://github.com/mattetti/macruby-httpwrapper/blob/93230af840d1cdc5124f36397c289a993d6dd164/macruby_http.rb#L222 That's something we probably should fix. I tried to make the delegation process easier than what obj-c does but maybe we need to support a more advanced mode. Anyways, I added Brian to the repo and I hope to a see a fully finished version when I come back from vacation ;) - Matt p.s: adding tests would be totally awesome, I'm just not sure how to address that yet. On Mon, Mar 30, 2009 at 4:36 PM, Brian Chapados wrote: > 2009/3/30 Matt Aimonetti : > >> Does the delegate object also receive messages that would be sent to an > >> NSURLDownload? > > > > I'm actually using NSURLConnection and not NSURLDownload which seemed a > bit > > too simple when I looked at it. If the delegator is a proc, then it > > currently only gets called once the request finished properly. (I still > need > > to write the error handling etc...) > > If your delegator is an object or a class, all messages should be passed > > directly. > > Right... NSURLConnection is more flexible. > > >> Also, regarding multi-threading, couldn't you just use NSURLDownload > >> (which you're probably already using underneath) + > >> NSOperation/NSOperationQueue. > > > > I need to look into NSOperation/NSOperationQueue to see how it works, I'm > > still pretty new to Cocoa and I don't know all the tricks cool kids use > ;) > > The libraries are vast, and the NSOperation stuff is new in 10.5, so > there aren't as many examples floating around the net. > Just throwing it out there as a possibility. I'm not sure how hard it > would be to implement. I've only used NSOperation for really simple > stuff. > > > I'll do what Ernie and put what I have so far on GitHub and let people > hack > > on it until we have something nice that could be used in most use cases. > > Since I'm going on vacation, I'll add you (Brian) to my repo so you can > deal > > with pull requests and push your own stuff there ;) > > So, you are assigning me as the delegate? ;-) > > > Reharding using the class outside of HotCocoa, I agree, but you should be > > able to only require the file and include the module. What do you think? > > Yes, that makes sense. It sounds like you've got a good start. I > agree with your goal of just making the standard use cases easy. It is > nice to have a block right next to the download call, as it is easy to > understand the logic. If something requires more complicated > handling, then delegate option is always available. Anyway, I'll see > if I can make any progress on NSOperation and error-handling. > > Brian > > > > > On Mon, Mar 30, 2009 at 2:46 PM, Brian Chapados > wrote: > >> > >> Seems like a good idea that would be useful even outside of HotCocoa. > >> Especially for simple cases, I think if Obj-C had blocks, this would > >> be a good place to use them. For more control, the delegate pattern > >> actually works really well. It's good that you have a way to do both. > >> Does the delegate object also receive messages that would be sent to > >> an NSURLDownload? That might be a nice way to allow easy integration > >> in cases where an object that responds to the delegate methods is > >> defined in Obj-C. > >> > >> Also, regarding multi-threading, couldn't you just use NSURLDownload > >> (which you're probably already using underneath) + > >> NSOperation/NSOperationQueue. Since your #download method already > >> wraps the underlying process, you could should able to generate > >> NSOperations to perform the downloads and add them to a queue. Those > >> classes handle creating threads (which have their own runloops) and > >> performing a task on the thread. That said, maybe this approach would > >> not work with the current IO implementation? > >> > >> Brian > >> > >> 2009/3/30 Matt Aimonetti : > >> > In my free time, I've been working on a http://lighthouseapp.comclient > >> > app > >> > which mixes API calls with webkit views (I'll release the source code > >> > later > >> > on). > >> > The app is 100% HotCocoa (meaning that I didn't use any nib/xibs). > >> > For people who are not used to work with delegation, having to deal > with > >> > file download, URL queries can be a bit challenging if you want to > start > >> > using the underlying obj-c methods. > >> > > >> > That's why I wrote a small HTTP wrapper to clean up my code and make > >> > download/queries easier. > >> > The library is divided in 2 major parts, a helper and the > Query/Response > >> > classes. > >> > > >> > Here is how the helper looks like so far: > >> > > >> > Download helper making file download trivial > >> > Pass an url, and a block or a delegator > >> > A block takes precedence over a delegator, meaning that you can't > >> > pass a delegator and use a block, you have to choose which approach > >> > to pick. > >> > > >> > ==== Parameters > >> > url:: url of the resource to download > >> > options:: optional options used for the query > >> > &block:: block which is called when the file is downloaded > >> > > >> > ==== Options > >> > :method:: An optional value which represents the HTTP > >> > method to use > >> > :payload:: - data to pass to a POST, PUT, DELETE query. > >> > :delegation:: - class or instance to call when the file is > >> > downloaded. > >> > the handle_query_response method will be > called > >> > on > >> > the > >> > passed object > >> > :save_to:: - path to save the response to > >> > :credential:: - should contains the :user key and :password > key > >> > By default the credential will be saved for > the > >> > entire session > >> > > >> > TODO > >> > :progress :: Proc to call everytime the downloader makes > some > >> > progress > >> > :cache_storage > >> > :custom headers > >> > Error handling > >> > > >> > ==== Examples > >> > > >> > download("http://www.macruby.org/files/MacRuby%200.4.zip", > {:save_to > >> > => > >> > '~/tmp/macruby.zip'.stringByStandardizingPath}) do |macruby| > >> > NSLog("file downloaded!") > >> > end > >> > > >> > download "http://macruby.org" do |mr| > >> > # The response object has 3 accessors: status_code, headers and > >> > body > >> > NSLog("status: #{mr.status_code}, Headers: > #{mr.headers.inspect}") > >> > end > >> > > >> > path = File.expand_path('~/macruby_tmp.html') > >> > window :frame => [100, 100, 500, 500], :title => "HotCocoa" do > |win| > >> > download("http://macruby.org", {:save_to => path}) do |homepage| > >> > win << label(:text => "status code: #{homepage.status_code}", > >> > :layout > >> > => {:start => false}) > >> > win << label(:text => "Headers: #{homepage.headers.inspect}", > >> > :layout > >> > => {:start => false}) > >> > end > >> > end > >> > > >> > download "http://macruby.org/users/matt", :delegation => > >> > @downloaded_file, :method => 'PUT', :payload => {:name => 'matt > >> > aimonetti'} > >> > > >> > download "http://macruby.org/roadmap.xml", :delegation => self > >> > > >> > download "http://localhost:5984/couchrest-test/", :method => > 'POST', > >> > :payload => '{"user":"mattaimonetti at gmail.com","zip":92129}', > >> > :delegation => > >> > self > >> > > >> > download("http://mysite.com/login", {:credential => {:user => > 'me', > >> > :password => 's3krit'}}) do |test| > >> > NSLog("response received: #{test.headers} #{test.status_code}") > >> > end > >> > > >> > > >> > As you can see from the example list, the method name download isn't > >> > always > >> > appropriate and maybe I should give it the http_query alias. What do > you > >> > think? > >> > What's nice with this approach, is that on top of being simple, the > >> > query > >> > and the response handling are async so the rest of your code can be > run > >> > and > >> > you get notified only when the response comes back. > >> > > >> > The underlying API looks like that: MacRubyHTTP::Query.new( url, > >> > http_method='GET', options={} ) > >> > Queries don't run in a custom runloop yet but that's something I want > to > >> > look at once IO work on the experimental branch will be done. > >> > > >> > > >> > So, here is my question, do you guys think that this is something that > >> > should be part of HotCocoa or it's better if it stays its own separate > >> > lib? > >> > Also, what do you think about having a default vendor folder for > >> > hotcocoa > >> > apps and autoload the vendor files if available? > >> > > >> > - Matt > >> > > >> > > >> > _______________________________________________ > >> > MacRuby-devel mailing list > >> > MacRuby-devel at lists.macosforge.org > >> > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > >> > > >> > > >> _______________________________________________ > >> MacRuby-devel mailing list > >> MacRuby-devel at lists.macosforge.org > >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > > > > _______________________________________________ > > MacRuby-devel mailing list > > MacRuby-devel at lists.macosforge.org > > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > > > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel at lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pete at notahat.com Tue Mar 31 17:58:07 2009 From: pete at notahat.com (Pete Yandell) Date: Wed, 1 Apr 2009 11:58:07 +1100 Subject: [MacRuby-devel] Accessing bytes within NSData In-Reply-To: References: <8B80CA03-E7D0-473C-A2A1-368A1D4E6A57@notahat.com> Message-ID: <8011C937-A0BA-4AC1-ADA5-4B83014B8DA8@notahat.com> On 25/03/2009, at 6:03 AM, Brian Chapados wrote: > Since you have an NSData object, you should be able to convert it to a > String (NSString) and then use unpack. For example: > > socket_port = NSSocketPort.alloc.initWithTCPPort(11111) > addr = socket_port.address > addr_str = NSString.alloc.initWithData(addr, > encoding:NSString.defaultCStringEncoding) > port = addr_str.unpack("nn")[1] # seems to work - not sure what > this should be Thanks, Brian. That was just the ticket. Not sure why I didn't think of it! - Pete From timrandg at gmail.com Tue Mar 31 22:55:06 2009 From: timrandg at gmail.com (Tim Rand) Date: Tue, 31 Mar 2009 22:55:06 -0700 Subject: [MacRuby-devel] macruby and sqlite3 gem Message-ID: Hi Jordon, Thanks for the idea. I tried it (arch -arch i386 macirb), but get the same error. Tim Jordon suggested: "does not contain a version for the current architecture" sounds like a 32-bit vs. 64-bit problem to me. MacRuby 0.4 has both i386 and x86_64 archs for macruby and macirb, on a capable system it will pick the x86_64 arch first, which means any frameworks you load while running that arch need to have x86_64 in their Framework/library/bundle as well. What happens if you try running with something like `arch -arch i386 macruby` or `arch -arch i386 macirb` instead?