Re: [MacRuby-devel] [MacRuby] #713: Growl is broken on MacRuby 0.6

2010-05-26 Thread MacRuby
#713: Growl is broken on MacRuby 0.6
--+-
 Reporter:  ylp...@…  |   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  blocker   |   Milestone:  MacRuby 0.6  
Component:  MacRuby   |Keywords:  growl
--+-

Comment(by ylp...@…):

 My first public, open-source MacRuby project is currently stalling as it's
 inevitably dependent on Growl callbacks.
 Is there any way I could contribute to fixing this bug, without touching
 MacRuby's C core?

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] [MacRuby] #713: Growl is broken on MacRuby 0.6

2010-05-26 Thread MacRuby
#713: Growl is broken on MacRuby 0.6
--+-
 Reporter:  ylp...@…  |   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  blocker   |   Milestone:  MacRuby 0.6  
Component:  MacRuby   |Keywords:  growl
--+-

Comment(by jakub.su...@…):

 I'm using Growl in my own open source MacRuby project, and after the
 update from ticket #662 it works fine on 0.6. I use the method
 GrowlApplicationBridge#notifyWithTitle to send growls (plus a call to
 GrowlApplicationBridge.growlDelegate = "" in application delegate when the
 app starts, and a growlRegDict file). See the code at
 
http://github.com/psionides/MacBlip/blob/master/Controllers/MainWindowController.rb#L217
 . Hope that helps...

-- 
Ticket URL: 
MacRuby 

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


[MacRuby-devel] [MacRuby] #731: uninitialized constant IO::WaitReadable / IO::WaitWritable

2010-05-26 Thread MacRuby
#731: uninitialized constant IO::WaitReadable / IO::WaitWritable
--+-
 Reporter:  watson1...@…  |   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  blocker   |   Milestone:   
Component:  MacRuby   |Keywords:   
--+-
 {{{
 $ macirb
 irb(main):001:0> require 'net/http'
 => true
 irb(main):002:0> Net::HTTP.get('www.apple.com', '/')
 NameError: uninitialized constant IO::WaitReadable
 }}}

 I think that IO::WaitReadable and IO::WaitWritable are not defined.

 {{{
 $ grep "WaitReadable" -r *
 ext/openssl/lib/openssl/buffering.rb:  # IO::WaitReadable or
 IO::WaitWritable.
 ext/openssl/lib/openssl/buffering.rb:  # IO::WaitReadable means SSL needs
 to read internally.
 ext/openssl/lib/openssl/buffering.rb:  #  rescue IO::WaitReadable
 ext/openssl/lib/openssl/buffering.rb:  # IO::WaitReadable or
 IO::WaitWritable.
 ext/openssl/lib/openssl/buffering.rb:  # IO::WaitReadable means SSL needs
 to read internally.
 ext/openssl/lib/openssl/buffering.rb:  #  rescue IO::WaitReadable
 ext/openssl/ossl_ssl.c://rb_extend_object(exc, rb_mWaitReadable);
 ext/openssl/ossl_ssl.c: *   rescue IO::WaitReadable
 ext/openssl/ossl_ssl.c: *   rescue IO::WaitReadable
 lib/net/protocol.rb:  rescue IO::WaitReadable

 $ grep "WaitWritable" -r *
 ext/openssl/lib/openssl/buffering.rb:  # IO::WaitReadable or
 IO::WaitWritable.
 ext/openssl/lib/openssl/buffering.rb:  # IO::WaitWritable means SSL needs
 to write internally.
 ext/openssl/lib/openssl/buffering.rb:  #  rescue IO::WaitWritable
 ext/openssl/lib/openssl/buffering.rb:  # IO::WaitReadable or
 IO::WaitWritable.
 ext/openssl/lib/openssl/buffering.rb:  # IO::WaitWritable means SSL needs
 to write internally.
 ext/openssl/lib/openssl/buffering.rb:  #  rescue IO::WaitWritable
 ext/openssl/ossl_ssl.c://rb_extend_object(exc, rb_mWaitWritable);
 ext/openssl/ossl_ssl.c: *   rescue IO::WaitWritable
 ext/openssl/ossl_ssl.c: *   rescue IO::WaitWritable
 lib/net/protocol.rb:  rescue IO::WaitWritable
 lib/net/protocol.rb:# OpenSSL::Buffering#read_nonblock may fail
 with IO::WaitWritable.
 }}}

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] [MacRuby] #726: Methods added to String do not get added to all strings

2010-05-26 Thread MacRuby
#726: Methods added to String do not get added to all strings
-+--
 Reporter:  dy...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--

Comment(by dy...@…):

 The fix works. Thanks!

 Still, the ancestor list is the same for the string I create and the one
 coming back from the mutable string (they're both [String,
 NSMutableString, NSString, Comparable, NSObject, Kernel]). Is this not
 just masquerading as a String when it comes back and is really and
 instance of NSMutableString or NSString ?

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] [MacRuby] #726: Methods added to String do not get added to all strings

2010-05-26 Thread MacRuby
#726: Methods added to String do not get added to all strings
-+--
 Reporter:  dy...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--

Comment(by martinlagarde...@…):

 Yes, there is some kind of "masquerading", because we want Strings to be
 NSStrings, and vice-versa, this is how you can send Strings to Obj-C APIs
 and NSString to ruby APIs :-)

-- 
Ticket URL: 
MacRuby 

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


[MacRuby-devel] c++ lib

2010-05-26 Thread Louis-Philippe
Hi folks,

I need to work with a c++ sdk in my code.
Is this possible within macruby?

I tried loading the files all sorts of way and making a bundle with it and
got no luck at this point...

thanks!

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


Re: [MacRuby-devel] c++ lib

2010-05-26 Thread Gregoire LEJEUNE
I do it with a C lib (but it must be the same with C++). First I
create a ObjC class over my C lib. Then i can use my ObjC class within
MacRuby.

Greg

2010/5/26 Louis-Philippe :
> Hi folks,
> I need to work with a c++ sdk in my code.
> Is this possible within macruby?
> I tried loading the files all sorts of way and making a bundle with it and
> got no luck at this point...
> thanks!
> L-P
> ___
> MacRuby-devel mailing list
> MacRuby-devel@lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] c++ lib

2010-05-26 Thread Thibault Martin-Lagardette
Hi!

That's exactly what I was going to recommend.
MacRuby is able to interact with Obj-C, so you can write an Obj-C++ wrapper 
(.mm files) around your SDK, and then use it with MacRuby :-)

Any of you two, if you manage / managed to do it, please do not hesitate 
sharing the recipe to the world :-).

-- 
Thibault Martin-Lagardette



On May 26, 2010, at 11:31, Gregoire LEJEUNE wrote:

> I do it with a C lib (but it must be the same with C++). First I
> create a ObjC class over my C lib. Then i can use my ObjC class within
> MacRuby.
> 
> Greg
> 
> 2010/5/26 Louis-Philippe :
>> Hi folks,
>> I need to work with a c++ sdk in my code.
>> Is this possible within macruby?
>> I tried loading the files all sorts of way and making a bundle with it and
>> got no luck at this point...
>> thanks!
>> L-P
>> ___
>> MacRuby-devel mailing list
>> MacRuby-devel@lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> 
>> 
> ___
> MacRuby-devel mailing list
> MacRuby-devel@lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

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


Re: [MacRuby-devel] [MacRuby] #724: malloc warning with bookmarkDataWithContentsOfURL on aliases

2010-05-26 Thread Terry Moore
thanks. 

On 26/05/2010, at 12:15 PM, MacRuby wrote:

> #724: malloc warning with bookmarkDataWithContentsOfURL on aliases
> -+--
> Reporter:  tvmo...@…|Owner:  lsansone...@…
> Type:  defect   |   Status:  closed   
> Priority:  minor|Milestone:  MacRuby 0.6  
> Component:  MacRuby  |   Resolution:  invalid  
> Keywords:   |  
> -+--
> Changes (by martinlagarde...@…):
> 
>  * status:  new => closed
>  * resolution:  => invalid
> 
> 
> Comment:
> 
> This is a bug in the OS actually:
> 
> {{{
> $> cat t.m
> #import 
> 
> int main(void)
> {
> NSURL *url = [NSURL fileURLWithPath:@"/tmp/test"];
> NSData *data = [NSURL bookmarkDataWithContentsOfURL:url error:nil];
> printf("-> %p\n", data);
> return 0;
> }
> $> gcc /tmp/t.m -o /tmp/t -framework Foundation -fobjc-gc
> $> ./t
> 
> t(61211,0x7fff70982be0) malloc: reference count underflow for 0x2f580,
> break on auto_refcount_underflow_error to debug.
> -> 0x2f540
> $>
> }}}
> 
> Well I say bug, but it's just a simple warning. It has been reported
> anyway :-).
> 
> -- 
> Ticket URL: 
> MacRuby 
> 
> ___
> MacRuby-devel mailing list
> MacRuby-devel@lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

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


[MacRuby-devel] [PATCH] perf/run.rb patch for ignoring ERROR

2010-05-26 Thread Jordan Breeding
Currently ERROR is not thrown out of the results before they are tested to see 
which is best, this means that ERROR is actually considered the winner after 
running .to_f on it.

My current patch probably doesn't handle the case of each of the rubies being 
tested all having ERROR, but it does work if at least one real value was 
returned. This patch also changes it so that if you are testing a large number 
of ruby installations (4 or more) on a wide terminal window the "" 
underline will cover all of the names instead of stopping at 80 characters.

diff --git a/perf/run.rb b/perf/run.rb
index 14af044..7279136 100644
--- a/perf/run.rb
+++ b/perf/run.rb
@@ -31,9 +31,10 @@ end
 
 rubies_names = rubies.map { |x| `#{x} -v`.scan(/^\w+\s+[^\s]+/)[0] }
 
-print 'Name'.ljust(20)
-rubies_names.each { |x| print x.ljust(20) }
-puts '', '-' * 80
+header_string = 'Name'.ljust(20)
+rubies_names.each { |x| header_string += x.ljust(20) }
+print header_string
+puts '', '-' * header_string.length
 
 booter = File.join(cwd, 'boot.rb')
 perf_files.each do |file, suite|
@@ -53,7 +54,7 @@ perf_files.each do |file, suite|
 print "#{prefix}:#{title}".ljust(20)
 winner = nil
 if res.size > 1
-  winner = res.sort { |a, b| a[:best].to_f <=> b[:best].to_f }.first[:best]
+  winner = res.reject { |a| a[:best] == 'ERROR' }.sort { |a, b| 
a[:best].to_f <=> b[:best].to_f }.first[:best]
 end
 res.each do |rb|
   best = rb[:best]

smime.p7s
Description: S/MIME cryptographic signature
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #730: macrubyc is failing on trunk

2010-05-26 Thread MacRuby
#730: macrubyc is failing on trunk
+---
 Reporter:  martinlagarde...@…  |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  critical|   Milestone:  MacRuby 0.7  
Component:  MacRuby |Keywords:   
+---

Comment(by lsansone...@…):

 

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] [MacRuby] #730: macrubyc is failing on trunk

2010-05-26 Thread MacRuby
#730: macrubyc is failing on trunk
+---
 Reporter:  martinlagarde...@…  |Owner:  lsansone...@…
 Type:  defect  |   Status:  closed   
 Priority:  critical|Milestone:  MacRuby 0.7  
Component:  MacRuby |   Resolution:  fixed
 Keywords:  |  
+---
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Should be fixed in r r4166.

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] [PATCH] perf/run.rb patch for ignoring ERROR

2010-05-26 Thread Thibault Martin-Lagardette
Thanks a lot!
I applied the patch in 4167 (along with some minor improvement).

-- 
Thibault Martin-Lagardette



On May 26, 2010, at 14:39, Jordan Breeding wrote:

> Currently ERROR is not thrown out of the results before they are tested to 
> see which is best, this means that ERROR is actually considered the winner 
> after running .to_f on it.
> 
> My current patch probably doesn't handle the case of each of the rubies being 
> tested all having ERROR, but it does work if at least one real value was 
> returned. This patch also changes it so that if you are testing a large 
> number of ruby installations (4 or more) on a wide terminal window the "" 
> underline will cover all of the names instead of stopping at 80 characters.
> 
> diff --git a/perf/run.rb b/perf/run.rb
> index 14af044..7279136 100644
> --- a/perf/run.rb
> +++ b/perf/run.rb
> @@ -31,9 +31,10 @@ end
> 
> rubies_names = rubies.map { |x| `#{x} -v`.scan(/^\w+\s+[^\s]+/)[0] }
> 
> -print 'Name'.ljust(20)
> -rubies_names.each { |x| print x.ljust(20) }
> -puts '', '-' * 80
> +header_string = 'Name'.ljust(20)
> +rubies_names.each { |x| header_string += x.ljust(20) }
> +print header_string
> +puts '', '-' * header_string.length
> 
> booter = File.join(cwd, 'boot.rb')
> perf_files.each do |file, suite|
> @@ -53,7 +54,7 @@ perf_files.each do |file, suite|
> print "#{prefix}:#{title}".ljust(20)
> winner = nil
> if res.size > 1
> -  winner = res.sort { |a, b| a[:best].to_f <=> b[:best].to_f 
> }.first[:best]
> +  winner = res.reject { |a| a[:best] == 'ERROR' }.sort { |a, b| 
> a[:best].to_f <=> b[:best].to_f }.first[:best]
> end
> res.each do |rb|
>   best = rb[:best]___
> MacRuby-devel mailing list
> MacRuby-devel@lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

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


[MacRuby-devel] [NEW FILE] add string performance tests

2010-05-26 Thread Jordan Breeding
Right now MacRuby is really quite slow for string operations, I noticed it a 
while back when doing large amounts of string creation, characters swapping, 
and pushing/popping strings into/out of a priority queue.

The attached file is a string performance test and here is a run on my 15" Core 
i7 MBP with ruby 1.9.1, jruby, and MacRuby:

Nameruby 1.9.1p378  MacRuby version jruby 1.5.0.RC1 

array:<<0.7510821.1686931.29
array:new   0.3949971.9176010.277000
array:[]0.3244540.7550540.472000
array:[]=   1.6918400.7652250.822000
hash:new1.5015954.5635490.444000
hash:[] 0.6127011.0515020.589000
hash:[]=2.0123671.1358560.902000
ivar:get0.2154240.3448731.087000
ivar:set1.3494660.2439091.902000
ivar:attr_writer1.2458944.5874880.655000
ivar:attr_reader1.0457792.7553030.482000
loop:upto   1.2115985.2151690.874000
loop:times  1.2107815.2150540.876000
loop:while  0.5993300.1570190.937000
loop:for1.4421540.8118751.132000
method:args 0.7282480.6820971.434000
method:noarg0.8224630.5783830.837000
method:splat0.4786101.8057600.227000
method:empty0.8074050.5278511.062000
method:opt  1.0271462.5797150.944000
misc:ao_bench   7.8380538.5299543.248000
misc:sudoku 1.7401962.1725812.461000
misc:tak1.2773990.1555341.563000
misc:mandelbrot 2.9563190.1245880.854000
misc:fib3.8271940.5749004.935000
misc:ack1.0491000.1162991.217000
proc:call+splat 0.3183461.1196650.191000
proc:call+args  2.4771121.1008482.995000
proc:call+noarg 2.4962781.0719533.507000
string:store swap   0.1537840.4792020.033000
string:<<   0.481788143.615735  0.099000
string:new  0.2769541.5747150.207000
string:[]   0.4281821.8992330.072000
string:tuple swap   0.1813180.7217780.045000
yield:noarg 0.7832810.7202541.269000
yield:splat 0.1592190.9657130.094000
yield:less_arity0.1924180.8438670.345000
yield:same_arity0.9378230.7633441.547000
yield:more_arity0.1925160.8481790.421000

Jordan

perf_test('new') do
  i = 0
  while i < 10
b = "#{i}"
c = "#{i} #{i}"
d = "#{i} #{i} #{i}"
i += 1
  end
end

perf_test('<<') do
  i = 0
  a = ""
  while i < 10
a << "1"; a << "2"; a << "3"; a << "4"; a << "5"
a << "5"; a << "4"; a << "3"; a << "2"; a << "1"
a << "1"; a << "2"; a << "3"; a << "4"; a << "5"
a << "5"; a << "4"; a << "3"; a << "2"; a << "1"
i += 1
  end
end

perf_test('[]') do
  i = 0
  a = "12345"
  while i < 10
a[0]; a[1]; a[2]; a[3]; a[4]
a[0]; a[1]; a[2]; a[3]; a[4]
a[0]; a[1]; a[2]; a[3]; a[4]
a[0]; a[1]; a[2]; a[3]; a[4]
i += 1
  end
end

perf_test('tuple swap') do
  i = 0
  a = "12345"
  while i < 10
a[4], a[0] = a[0], a[4]
a[3], a[1] = a[1], a[3]
i += 1
  end
end

perf_test('store swap') do
  i = 0
  a = "12345"
  while i < 10
temp = a[0]
a[0] = a[4]
a[4] = temp
temp = a[1]
a[1] = a[3]
a[3] = temp
i += 1
  end
end


smime.p7s
Description: S/MIME cryptographic signature
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel