Re: [MacRuby-devel] How do I subclass Obj-C classes in MacRuby?

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

I believe the problem is that you were overriding the wrong init method. Here 
is what I changed to your code to make it work:

class MyNode < ODNode
def initWithSession(session, name:name, error:err)
if super
@session = session
self
end
end
end

session = ODSession.defaultSession
node = MyNode.nodeWithSession session, name: "/Local/Default", error: nil

I override initWithSession:name:error instead of init, and created a "MyNode" 
object the exact same way I would have created an ODNode :-)
The results were, I believe, what you would expect:

$> macruby od.rb 
{"dsAttrTypeStandard:AppleMetaNodeLocation"=>["/Local/Default"], ...}

Hope that helps!

-- 
Thibault Martin-Lagardette



On May 4, 2010, at 23:37, russell muetzelfeldt wrote:

> Hi All,
> 
> I've produced an ugly bunch of ruby that talks to OpenDirectory and am trying 
> to clean it up a bit. Currently I'm using pure ruby classes that proxy Obj-C 
> objects held in instance variables, but my goal is to have something 
> structured like this -
> 
> module OpenDirectory
>  class Node < ODNode
>def find_user_by_name name
>  ...
>end
>  end
> end
> 
> but I can't work out how to make a Ruby class that subclasses an Obj-C class 
> and overrides the initialiser. With classes that descend from Obj-C classes 
> the ruby "initialize" method doesn't seem to get called (because they're 
> missing descent from the Ruby base Object class?), and all my attempts to 
> override init result in
> 
> 2010-05-05 15:55:34.237 macruby[2600:903] object 0x200249900 with 0 
> retain-count passed to CFMakeCollectable.
> 
> and a segfault.
> 
> Attached below is a reduced case, if anyone can point out how to get a valid 
> MyNode object it'd be much appreciated. If node is a real ODNode (as in the 
> commented lines) all works correctly. I'm not calling super, since the object 
> has (I believe) already been alloc'd and I'm explicitly calling the 
> designated initializer later in my own init. If I *do* call super in my own 
> init, I just get an additional "object 0x... with 0 retain-count passed to 
> CFMakeCollectable" error. If I use ODNode.nodeWithSession:name:error: in my 
> own init the example below works, but I end up with an ODNode rather than a 
> MyNode so it's missing any methods I'm adding to my own class.
> 
> (I'm also unsure whether I need to be retaining the session in an instance 
> variable myself or if it's also being retained in the ODNode, but that's 
> another question.)
> 
> Any pointers very much appreciated...
> 
> Russell
> 
> 
> example:
> 
> 
> framework 'OpenDirectory'
> 
> # no BridgeSupport for CFOpenDirectory.framework... :(
> Users = "dsRecTypeStandard:Users"
> RecordName = "dsAttrTypeStandard:RecordName"
> MatchEqualTo = 0x2001
> RealName = "dsAttrTypeStandard:RealName"
> 
> # some account name to search for
> me = "russm"
> 
> class MyNode < ODNode
>  def init
>@session = ODSession.defaultSession
>STDERR.puts "= pre CFMakeCollectable error"
>self.initWithSession @session, name:"/Local/Default", error:nil
>STDERR.puts "= post CFMakeCollectable error"
>self
>  end
> end
> 
> node = MyNode.new
> #session = ODSession.defaultSession
> #node = ODNode.nodeWithSession session, name:"/Local/Default", error:nil
> query = ODQuery.queryWithNode node,
>  forRecordTypes: Users,
>  attribute: RecordName,
>  matchType: MatchEqualTo,
>  queryValues: me,
>  returnAttributes: RealName,
>  maximumResults:0,
>  error:nil
> STDERR.puts "= pre segfault"
> results = query.resultsAllowingPartial false, error:nil
> STDERR.puts "= post segfault"
> result_attributes = results[0].recordDetailsForAttributes nil, error:nil
> puts result_attributes.inspect
> 
> ___
> 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] How do I subclass Obj-C classes in MacRuby?

2010-05-05 Thread Thibault Martin-Lagardette
Oh and by the way, you can generate BridgeSupport for CFOpenDirectory yourself 
if you need:

$> gen_bridge_metadata -f 
/System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework
 -o CFOpenDirectory.bridgesupport

Then all you need to do is place `CFOpenDirectory.bridgesupport' wherever you 
need, and call from your script:

load_bridge_support_file '/path/to/CFOpenDirectory.bridgesupport'

And you should have access to `kODMatchEqualTo' etc.

-- 
Thibault Martin-Lagardette



On May 4, 2010, at 23:37, russell muetzelfeldt wrote:

> # no BridgeSupport for CFOpenDirectory.framework... :(
> Users = "dsRecTypeStandard:Users"
> RecordName = "dsAttrTypeStandard:RecordName"
> MatchEqualTo = 0x2001
> RealName = "dsAttrTypeStandard:RealName"

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


Re: [MacRuby-devel] How do I subclass Obj-C classes in MacRuby?

2010-05-05 Thread Matt Aimonetti
>
> And you should have access to `kODMatchEqualTo' etc.
>

Which should be available as  KODMatchEqualTo and not kODMatchEqualTo
(Ruby's constants start by an upper case letter)

- Matt


On Wed, May 5, 2010 at 12:26 AM, Thibault Martin-Lagardette  wrote:

> Oh and by the way, you can generate BridgeSupport for CFOpenDirectory
> yourself if you need:
>
> $> gen_bridge_metadata -f
> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework
> -o CFOpenDirectory.bridgesupport
>
>
> Then all you need to do is place `CFOpenDirectory.bridgesupport' wherever
> you need, and call from your script:
>
> load_bridge_support_file '/path/to/CFOpenDirectory.bridgesupport'
>
>
> And you should have access to `kODMatchEqualTo' etc.
>
> --
> Thibault Martin-Lagardette
>
>
>
> On May 4, 2010, at 23:37, russell muetzelfeldt wrote:
>
> # no BridgeSupport for CFOpenDirectory.framework... :(
> Users = "dsRecTypeStandard:Users"
> RecordName = "dsAttrTypeStandard:RecordName"
> MatchEqualTo = 0x2001
> RealName = "dsAttrTypeStandard:RealName"
>
>
>
> ___
> 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] How do I subclass Obj-C classes in MacRuby?

2010-05-05 Thread russell muetzelfeldt
> From: Thibault Martin-Lagardette 
> 
> Hi!
> 
> I believe the problem is that you were overriding the wrong init method. Here 
> is what I changed to your code to make it work:
> 
> class MyNode < ODNode
>def initWithSession(session, name:name, error:err)
>if super
>@session = session
>self
>end
>end
> end
> 
> session = ODSession.defaultSession
> node = MyNode.nodeWithSession session, name: "/Local/Default", error: nil
> 
> I override initWithSession:name:error instead of init, and created a "MyNode" 
> object the exact same way I would have created an ODNode :-)
> The results were, I believe, what you would expect:



Thanks, but unfortunately that doesn't actually help - there's no difference in 
use between that and not wrapping the object init... For example, what I'm 
doing currently is this -

module OpenDirectory
  class Node
attr_reader :node
def initialize config = { :node_name => "/Local/Default" }
  if config[:node_name].eql? "/Local/Default"
@session = ODSession.defaultSession
  else
@session = ODSession.sessionWithOptions config[:session_options], 
error:nil
  end
  @node = ODNode.nodeWithSession @session, name:config[:node_name], 
error:nil
end
  end
end

so I can either

local_node = OpenDirectory::Node.new

or

remote_node = OpenDirectory::Node.new proxy_config

where proxy_config is a hash containing info for a DS remote connection to our 
directory master. I then access the ODNode as either local_node.node or 
remote_node.node where required. What I want to be able to do is just use 
local_node or remote_node as if they were ODNode objects (or subclasses of 
ODNode) to remove the ruby proxying wrapper around the core Obj-C objects, but 
still hide the ugliness of OpenDirectory behind some simpler Model style 
wrappers.

(I hope that makes sense)

cheers

Russell

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


[MacRuby-devel] [MacRuby] #687: Build of MacRuby 0.6 on OSX 10.5.8 fails

2010-05-05 Thread MacRuby
#687: Build of MacRuby 0.6 on OSX 10.5.8 fails
-+--
 Reporter:  d...@…|   Owner:  lsansone...@…   
 Type:  defect   |  Status:  new 
 Priority:  blocker  |   Milestone:  MacRuby 0.6 
Component:  MacRuby  |Keywords:  10.5.8 rake ModuleProvider.h
-+--
 The first part installing LLVM 2.7 wents well. But '''rake''' ends up with
 this error message:


 {{{
 
 /usr/bin/gcc-4.2 -I. -I./include -I/usr/include/libxml2 -arch i386 -arch
 x86_64 -fno-common -pipe -O3 -g -Wall -fexceptions -Wno-parentheses -Wno-
 deprecated-declarations -Werror -std=c99 -I./icu-1060 -c encoding.c -o
 encoding.o
 /usr/bin/g++-4.2 -I/usr/local/include  -D_DEBUG -D_GNU_SOURCE
 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2   -fno-rtti -fno-common
 -Woverloaded-virtual -I. -I./include -g -Wall -arch i386 -arch x86_64
 -Wno-parentheses -Wno-deprecated-declarations -Werror -I./icu-1060 -c
 main.cpp -o main.o
 In file included from main.cpp:8:
 llvm.h:12:33: error: llvm/ModuleProvider.h: No such file or directory
 In file included from main.cpp:17:
 vm.h:602: error: ISO C++ forbids declaration of ‘ExistingModuleProvider’
 with no type
 vm.h:602: error: expected ‘;’ before ‘*’ token
 In file included from main.cpp:8:
 llvm.h:12:33: error: llvm/ModuleProvider.h: No such file or directory
 In file included from main.cpp:17:
 vm.h:602: error: ISO C++ forbids declaration of ‘ExistingModuleProvider’
 with no type
 vm.h:602: error: expected ‘;’ before ‘*’ token
 lipo: can't figure out the architecture type of: /var/folders/9K/9KrO-
 h3CGYWISnBx7Gh2dTI/-Tmp-//ccNbr6LJ.out
 rake aborted!
 Command failed with status (1): [/usr/bin/g++-4.2 -I/usr/local/include
 -D_...]

 (See full trace by running task with --trace)

 }}}

-- 
Ticket URL: 
MacRuby 

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


[MacRuby-devel] Comparison between String and nil fails.

2010-05-05 Thread Michel Steuwer
Hi everyone,
yesterday i migrated my little MacRuby project to 0.6 and i found a kind of 
strange behavior in a comparison between a string and nil. In MacRuby 0.5 the 
line worked as expected.
I get the following error message in a comparison between a string on the left 
and nil on the right:
can't convert nil into String (TypeError)

I made a little demo project to show the problem.
The string i want to compare comes out of a userInfo dictionary i get when 
iTunes send a notification through the NSDistributredNotificationCenter.
In the demo project the error occurs, if you play, pause, or skip a song in 
iTunes (every time i get a notification from iTunes).

So here the code in which the error occurs:

def songChanged(notification)
NSLog("notification.userInfo[Name]  
#{notification.userInfo['Name']}.")
NSLog("notification.userInfo[Name].nil? 
#{notification.userInfo['Name'].nil?}.")
NSLog("notification.userInfo[Name].class
#{notification.userInfo['Name'].class}.")
NSLog("notification.userInfo[Name] != nil   
#{notification.userInfo['Name'] != nil}")
end

The method receives a notification from iTunes and the last line in the method 
fails ( notification.userInfo['Name'] != nil ).

I don't know where the problem is, but i guess the comparison should just 
return false. One again, in MacRuby 0.5 the line worked as expected.

You can find the hole demo project at:
http://github.com/michelSt/MacRubyBug

Thanks,
Michel
--
Michel Steuwer | michel.steu...@onlinehome.de

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


Re: [MacRuby-devel] Aaron answer about convert the code of the Book to MacRuby

2010-05-05 Thread Christian Bryan
Daniel, 

I have the RandomApp example from chapter 2, which I will add to the 
fork. Chapter 4 was about manual memory management using the retain/release 
mechanism and is not really applicable to a MacRubyist. Chapter 3 I skipped, 
probably due to realising that converting the LotteryEntry class and the 'main' 
function to idiomatic ruby would be far too trivial to worth bothering about.

Cheers

Christian

On 5 May 2010, at 00:24, Daniel Lopes wrote:

> I already did all code up to chapter 11 but I think I lost the code of 2,3 
> and 4 chapters. 
> 
> My code is in github: http://github.com/danielvlopes/HillegassMacRuby . Could 
> you fork it and send me a pull request with these chapters? (don't forget to 
> remove your build folders).
> 
> Thanks.
> 
> On Tue, May 4, 2010 at 6:05 PM, Christian Bryan  wrote:
> Perhaps I can get you started. I have converted the examples up to chapter 7 
> (something I did whilst looking for a new job) but stopped at that point 
> because the KVO bindings was not working correctly. Just tried it with 
> MacRuby 0.6 and all is working again. I can donate my code if you wish and 
> you could carry on with the RaiseMan examples.
> 
> Regards
> 
> Christian
> ___
> 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] Aaron answer about convert the code of the Book to MacRuby

2010-05-05 Thread Daniel Lopes

You're right I back in the book and conclude the same.

Sent from my iPhone

On 05/05/2010, at 07:01, Christian Bryan  wrote:


Daniel,

	I have the RandomApp example from chapter 2, which I will add to  
the fork. Chapter 4 was about manual memory management using the  
retain/release mechanism and is not really applicable to a  
MacRubyist. Chapter 3 I skipped, probably due to realising that  
converting the LotteryEntry class and the 'main' function to  
idiomatic ruby would be far too trivial to worth bothering about.


Cheers

Christian

On 5 May 2010, at 00:24, Daniel Lopes wrote:

I already did all code up to chapter 11 but I think I lost the code  
of 2,3 and 4 chapters.


My code is in github: http://github.com/danielvlopes/ 
HillegassMacRuby . Could you fork it and send me a pull request  
with these chapters? (don't forget to remove your build folders).


Thanks.

On Tue, May 4, 2010 at 6:05 PM, Christian Bryan > wrote:
Perhaps I can get you started. I have converted the examples up to  
chapter 7 (something I did whilst looking for a new job) but  
stopped at that point because the KVO bindings was not working  
correctly. Just tried it with MacRuby 0.6 and all is working again.  
I can donate my code if you wish and you could carry on with the  
RaiseMan examples.


Regards

Christian
___
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
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Aaron answer about convert the code of the Book to MacRuby

2010-05-05 Thread Matthew Ratzloff
Nice!  Good work.

-Matt

On Mon, May 3, 2010 at 11:48 AM, Daniel Lopes wrote:

> Hello folks, Some days ago I sent a message here with the idea to convert
> the Cocoa Programming For Mac OSX to MacRuby. Definitely MacRuby is a
> fantastical project but we need more examples and places where people, like
> me, could start your journey. I think if we have resources like this code
> for Aaron's book (and also Aimonetti's book) will be much easier for people
> to learn MacRuby or even learn pure Objc/Cocoa through MacRuby. I got in
> touch with Aaron asking if I can convert all his examples to the current
> version of MacRuby and share it with the community and his answer was:
> "Sounds great! You have my permission to make and distribute a set of
> solutions for "cocoa programming for mac OS x" in Ruby." My idea is place
> all the code in github and share it in MacRuby site. What do you think?
> Thanks
>
> ___
> 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] Aaron answer about convert the code of the Book to MacRuby

2010-05-05 Thread Daniel Lopes
Hi Christian,

I did the merge. I also change the organization of folders... I'm currently
working on chapter 12.
http://github.com/danielvlopes/HillegassMacRuby

Thanks,


On Wed, May 5, 2010 at 12:22 PM, Matthew Ratzloff
wrote:

> Nice!  Good work.
>
> -Matt
>
> On Mon, May 3, 2010 at 11:48 AM, Daniel Lopes wrote:
>
>> Hello folks, Some days ago I sent a message here with the idea to convert
>> the Cocoa Programming For Mac OSX to MacRuby. Definitely MacRuby is a
>> fantastical project but we need more examples and places where people, like
>> me, could start your journey. I think if we have resources like this code
>> for Aaron's book (and also Aimonetti's book) will be much easier for people
>> to learn MacRuby or even learn pure Objc/Cocoa through MacRuby. I got in
>> touch with Aaron asking if I can convert all his examples to the current
>> version of MacRuby and share it with the community and his answer was:
>> "Sounds great! You have my permission to make and distribute a set of
>> solutions for "cocoa programming for mac OS x" in Ruby." My idea is place
>> all the code in github and share it in MacRuby site. What do you think?
>> Thanks
>>
>> ___
>> 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


[MacRuby-devel] Passing a string buffer to a C function

2010-05-05 Thread Mike Taylor

Hi all, 

I'm trying to do some GLSL shaders with MacRuby. However, I'm a bit stumped as 
to how to call glGetShaderInfoLog if the shader compilation fails. The C 
function's prototype is:

void glGetShaderInfoLog(GLuint shader, GLsizei maxLength, GLsizei * length, 
GLchar * infoLog);

I couldn't find any docs on how Pointer.new_with_type, so I tried a few things, 
such as:

log_info = Pointer.new_with_type('c', 4096)
length = Pointer.new_with_type('i')

glGetShaderInfoLog(@shader_id, 4096, length, log_info)

However, I get the error:

TypeError: can't convert Pointer into String

It seems that the bridge wants log_info to be a String object. But, using a 
String causes a bus error. I'm expecting that the bridge isn't expecting the 
string to be mutated.

Any suggestions would be appreciated!

/\/\ike

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


Re: [MacRuby-devel] How do I subclass Obj-C classes in MacRuby?

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

What you can do is a "factory" just like this:

module OpenDirectory
class Node < ODNode
def self.create(config = { :node_name => "/Local/Default" })
if config[:node_name].eql? "/Local/Default"
session = ODSession.defaultSession
else
session = ODSession.sessionWithOptions 
config[:session_options], error:nil
end
return self.nodeWithSession session, name:config[:node_name], 
error:nil
end

def initWithSession(session, name:name, error:err)
if super
@session = session
self
end
end
end
end

And then call:

local_node = OpenDirectory::Node.create
remote_node = OpenDirectory::Node.create proxy_config

And then you can pass these nodes directly to the OD methods :-)

You can also do a more Cocoa-ish way:

def self.nodeWithConfig(config)
config ||= { :node_name => "/Local/Default" }
if config[:node_name].eql? "/Local/Default"
session = ODSession.defaultSession
else
session = ODSession.sessionWithOptions 
config[:session_options], error:nil
end
return self.nodeWithSession session, name:config[:node_name], 
error:nil
end

Then you can OpenDirectory::Node.nodeWithConfig(nil) or 
OpenDirectory::Node.nodeWithConfig(proxy_config).
You could even just call OpenDirectory::Node.nodeWithConfig(config), whether 
it's a proxy config or nothing :-)

Hope that helps!

-- 
Thibault Martin-Lagardette



On May 5, 2010, at 00:49, russell muetzelfeldt wrote:

>> From: Thibault Martin-Lagardette 
>> 
>> Hi!
>> 
>> I believe the problem is that you were overriding the wrong init method. 
>> Here is what I changed to your code to make it work:
>> 
>> class MyNode < ODNode
>>   def initWithSession(session, name:name, error:err)
>>   if super
>>   @session = session
>>   self
>>   end
>>   end
>> end
>> 
>> session = ODSession.defaultSession
>> node = MyNode.nodeWithSession session, name: "/Local/Default", error: nil
>> 
>> I override initWithSession:name:error instead of init, and created a 
>> "MyNode" object the exact same way I would have created an ODNode :-)
>> The results were, I believe, what you would expect:
> 
> 
> 
> Thanks, but unfortunately that doesn't actually help - there's no difference 
> in use between that and not wrapping the object init... For example, what I'm 
> doing currently is this -
> 
> module OpenDirectory
>  class Node
>attr_reader :node
>def initialize config = { :node_name => "/Local/Default" }
>  if config[:node_name].eql? "/Local/Default"
>@session = ODSession.defaultSession
>  else
>@session = ODSession.sessionWithOptions config[:session_options], 
> error:nil
>  end
>  @node = ODNode.nodeWithSession @session, name:config[:node_name], 
> error:nil
>end
>  end
> end
> 
> so I can either
> 
> local_node = OpenDirectory::Node.new
> 
> or
> 
> remote_node = OpenDirectory::Node.new proxy_config
> 
> where proxy_config is a hash containing info for a DS remote connection to 
> our directory master. I then access the ODNode as either local_node.node or 
> remote_node.node where required. What I want to be able to do is just use 
> local_node or remote_node as if they were ODNode objects (or subclasses of 
> ODNode) to remove the ruby proxying wrapper around the core Obj-C objects, 
> but still hide the ugliness of OpenDirectory behind some simpler Model style 
> wrappers.
> 
> (I hope that makes sense)
> 
> cheers
> 
> Russell
> 
> ___
> 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] #687: Build of MacRuby 0.6 on OSX 10.5.8 fails

2010-05-05 Thread MacRuby
#687: Build of MacRuby 0.6 on OSX 10.5.8 fails
--+-
 Reporter:  d...@… |Owner:  lsansone...@…   
 
 Type:  defect|   Status:  closed   
 Priority:  blocker   |Milestone:   
Component:  MacRuby   |   Resolution:  wontfix  
 Keywords:  10.5.8 rake ModuleProvider.h  |  
--+-
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => wontfix
  * milestone:  MacRuby 0.6 =>


Comment:

 Please build the version of LLVM mentioned in the README.rdoc file. The
 2.7 release will unfortunately not work (it contains a regression with
 float constants).

-- 
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] #336: NoMethodError with shoulda tests

2010-05-05 Thread MacRuby
#336: NoMethodError with shoulda tests
+---
 Reporter:  macr...@…   |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  major   |   Milestone:   
Component:  MacRuby |Keywords:  shoulda  
+---
Changes (by lsansone...@…):

  * milestone:  MacRuby 0.5 =>


Comment:

 We need a reduction for that problem.

-- 
Ticket URL: 
MacRuby 

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


[MacRuby-devel] [MacRuby] #688: IB fails to read classfile in Ruby Cocoa project

2010-05-05 Thread MacRuby
#688: IB fails to read classfile in Ruby Cocoa project
--+-
 Reporter:  tmow...@… |   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  major |   Milestone:  MacRuby 0.5  
Component:  MacRuby   |Keywords:  IB XCode project 
--+-
 Had a problem with Interface Builder parsing a XCode project using
 MacRuby. Raised a bug in Radar but Apple Engineering have responded that
 the issue is with macruby. Therefore raised as a ticket here. Full text of
 email thread reproduced below:

 Hi Timothy,

 This is a courtesy email regarding Bug ID# 7464509.

 Engineering has determined that this issue originates with MacRuby
 mailing-list.

 There is information here: http://www.macruby.org/contact-us.html

 The IB parser has been tested many times recently (especially the last few
 days), so we would be tempted to say that this is a problem with the
 project.

 Bug reports requiring your attention will appear under ‘My Originated
 Problems’.  Please review this bug report and provide the requested
 information via the Apple Bug Reporter. Once your report has been updated,
 Engineering will be alerted of the new information.

 

 Thank you for your assistance in helping us discover and isolate bugs
 within our products.

 Best Regards,

 Yvonne Villa
 Apple Developer Support
 Worldwide Developer Relations
 **
 THE INFORMATION CONTAINED IN THIS MESSAGE IS UNDER NON-DISCLOSURE
 **
 ---
 Bug ID #: 7464509
 Bug Title: IB fails to read classfile in Ruby Cocoa project
 ---
 
 Summary:
 I have a Ruby Cocoa application project created using the template. At
 first IB was correctly seeing the .rb file as a class and discovering its
 outlets. But it has stopped doing so. Now if I select File->Read Class
 Files to force a re-read it parses the file then shows a red dimple in the
 IB project window at the bottom and displays an error message saying
 "Parsed 1 source file, but no classes were found or changed".

 I tried editing the source .rb and saving it. I also closed and reopened
 both IB and XCode but IB will not read the source any more.

 I did a Clean Build at some point before this behaviour started that could
 be related although I have no evidence to show that this was the cause.

 Steps to Reproduce:
 1. Create a Ruby Cocoa project
 2. Create a .rb class add some code and save it
 3. Add some GUI objects eg buttons, popups, etc to the window in the main
 NIB
 4. Add an Object to the NIB project window from the Library
 5. Show the inspector, go the Identity tab and look  for the ruby class in
 the Class popup

 Expected Results:
 The .rb class should show up and be selectable to set the class as the
 type of the object added to the IB project in step 4

 Actual Results:

 IB completely refuses to see the .rb as a class.
 Also editing and saving the .rb file in XCode, reopening the apps or
 File->Reread class files should all cause a sync between XCode and IB. The
 .rb should then show up in the popup. It doesn't as described.

 Regression:
 none

 Notes:
 Please note that the project was working normally. Then it stopped working
 for no obvious reason.
 I can provide the project zipped up if required. But the code is
 proprietary (I am doing contract work for a client) so confidentiality
 would need to be respected in that case.

 
 Yes I can see the class in the classes tab of the IB Library window. It
 shows as a blue cube. The Lineage, Definitions, Outlets and Actions tabs
 also show what appears to be correct content yet the bug as described on
 File -> Read Class Files persists.

 
 'GenRegData.zip' was successfully uploaded

 
 See attached. I have obfuscated the code to protect client confidentiality
 but the problem was still present.

-- 
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] #688: IB fails to read classfile in Ruby Cocoa project

2010-05-05 Thread MacRuby
#688: IB fails to read classfile in Ruby Cocoa project
--+-
 Reporter:  tmow...@… |   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  major |   Milestone:  MacRuby 0.5  
Component:  MacRuby   |Keywords:  IB XCode project 
--+-
Description changed by martinlagarde...@…:

Old description:

> Had a problem with Interface Builder parsing a XCode project using
> MacRuby. Raised a bug in Radar but Apple Engineering have responded that
> the issue is with macruby. Therefore raised as a ticket here. Full text
> of email thread reproduced below:
>
> Hi Timothy,
>
> This is a courtesy email regarding Bug ID# 7464509.
>
> Engineering has determined that this issue originates with MacRuby
> mailing-list.
>
> There is information here: http://www.macruby.org/contact-us.html
>
> The IB parser has been tested many times recently (especially the last
> few days), so we would be tempted to say that this is a problem with the
> project.
>
> Bug reports requiring your attention will appear under ‘My Originated
> Problems’.  Please review this bug report and provide the requested
> information via the Apple Bug Reporter. Once your report has been
> updated, Engineering will be alerted of the new information.
>
> 
>
> Thank you for your assistance in helping us discover and isolate bugs
> within our products.
>
> Best Regards,
>
> Yvonne Villa
> Apple Developer Support
> Worldwide Developer Relations
> **
> THE INFORMATION CONTAINED IN THIS MESSAGE IS UNDER NON-DISCLOSURE
> **
> ---
> Bug ID #: 7464509
> Bug Title: IB fails to read classfile in Ruby Cocoa project
> ---
> 
> Summary:
> I have a Ruby Cocoa application project created using the template. At
> first IB was correctly seeing the .rb file as a class and discovering its
> outlets. But it has stopped doing so. Now if I select File->Read Class
> Files to force a re-read it parses the file then shows a red dimple in
> the IB project window at the bottom and displays an error message saying
> "Parsed 1 source file, but no classes were found or changed".
>
> I tried editing the source .rb and saving it. I also closed and reopened
> both IB and XCode but IB will not read the source any more.
>
> I did a Clean Build at some point before this behaviour started that
> could be related although I have no evidence to show that this was the
> cause.
>
> Steps to Reproduce:
> 1. Create a Ruby Cocoa project
> 2. Create a .rb class add some code and save it
> 3. Add some GUI objects eg buttons, popups, etc to the window in the main
> NIB
> 4. Add an Object to the NIB project window from the Library
> 5. Show the inspector, go the Identity tab and look  for the ruby class
> in the Class popup
>
> Expected Results:
> The .rb class should show up and be selectable to set the class as the
> type of the object added to the IB project in step 4
>
> Actual Results:
>
> IB completely refuses to see the .rb as a class.
> Also editing and saving the .rb file in XCode, reopening the apps or
> File->Reread class files should all cause a sync between XCode and IB.
> The .rb should then show up in the popup. It doesn't as described.
>
> Regression:
> none
>
> Notes:
> Please note that the project was working normally. Then it stopped
> working for no obvious reason.
> I can provide the project zipped up if required. But the code is
> proprietary (I am doing contract work for a client) so confidentiality
> would need to be respected in that case.
>
> 
> Yes I can see the class in the classes tab of the IB Library window. It
> shows as a blue cube. The Lineage, Definitions, Outlets and Actions tabs
> also show what appears to be correct content yet the bug as described on
> File -> Read Class Files persists.
>
> 
> 'GenRegData.zip' was successfully uploaded
>
> 
> See attached. I have obfuscated the code to protect client
> confidentiality but the problem was still present.

New description:

 Had a problem with Interface Builder parsing a XCode project using
 MacRuby. Raised a bug in Radar but Apple Engineering have responded that
 the issue is with macruby. Therefore raised as a ticket here. Full text of
 email thread reproduced below:

 {{{
 Hi Timothy,

 This is a courtesy email regarding Bug ID# 7464509.

 Engineering has determined that this issue originates with MacRuby
 mailing-list.

 There is information here: http://www.macruby.org/contact-us.html

 The IB parser has been tested many times recently (especially the last few
 days), so we would be tempte

Re: [MacRuby-devel] [MacRuby] #688: IB fails to read classfile in Ruby Cocoa project

2010-05-05 Thread MacRuby
#688: IB fails to read classfile in Ruby Cocoa project
--+-
 Reporter:  tmow...@… |   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  major |   Milestone:  MacRuby 0.5  
Component:  MacRuby   |Keywords:  IB XCode project 
--+-
Description changed by martinlagarde...@…:

Old description:

> Had a problem with Interface Builder parsing a XCode project using
> MacRuby. Raised a bug in Radar but Apple Engineering have responded that
> the issue is with macruby. Therefore raised as a ticket here. Full text
> of email thread reproduced below:
>
> {{{
> Hi Timothy,
>
> This is a courtesy email regarding Bug ID# 7464509.
>
> Engineering has determined that this issue originates with MacRuby
> mailing-list.
>
> There is information here: http://www.macruby.org/contact-us.html
>
> The IB parser has been tested many times recently (especially the last
> few days), so we would be tempted to say that this is a problem with the
> project.
>
> Bug reports requiring your attention will appear under ‘My Originated
> Problems’.  Please review this bug report and provide the requested
> information via the Apple Bug Reporter. Once your report has been
> updated, Engineering will be alerted of the new information.
>
> 
>
> Thank you for your assistance in helping us discover and isolate bugs
> within our products.
>
> Best Regards,
>
> Yvonne Villa
> Apple Developer Support
> Worldwide Developer Relations
> **
> THE INFORMATION CONTAINED IN THIS MESSAGE IS UNDER NON-DISCLOSURE
> **
> ---
> Bug ID #: 7464509
> Bug Title: IB fails to read classfile in Ruby Cocoa project
> ---
> 
> Summary:
> I have a Ruby Cocoa application project created using the template. At
> first IB was correctly seeing the .rb file as a class and discovering its
> outlets. But it has stopped doing so. Now if I select File->Read Class
> Files to force a re-read it parses the file then shows a red dimple in
> the IB project window at the bottom and displays an error message saying
> "Parsed 1 source file, but no classes were found or changed".
>
> I tried editing the source .rb and saving it. I also closed and reopened
> both IB and XCode but IB will not read the source any more.
>
> I did a Clean Build at some point before this behaviour started that
> could be related although I have no evidence to show that this was the
> cause.
>
> Steps to Reproduce:
> 1. Create a Ruby Cocoa project
> 2. Create a .rb class add some code and save it
> 3. Add some GUI objects eg buttons, popups, etc to the window in the main
> NIB
> 4. Add an Object to the NIB project window from the Library
> 5. Show the inspector, go the Identity tab and look  for the ruby class
> in the Class popup
>
> Expected Results:
> The .rb class should show up and be selectable to set the class as the
> type of the object added to the IB project in step 4
>
> Actual Results:
>
> IB completely refuses to see the .rb as a class.
> Also editing and saving the .rb file in XCode, reopening the apps or
> File->Reread class files should all cause a sync between XCode and IB.
> The .rb should then show up in the popup. It doesn't as described.
>
> Regression:
> none
>
> Notes:
> Please note that the project was working normally. Then it stopped
> working for no obvious reason.
> I can provide the project zipped up if required. But the code is
> proprietary (I am doing contract work for a client) so confidentiality
> would need to be respected in that case.
>
> 
> Yes I can see the class in the classes tab of the IB Library window. It
> shows as a blue cube. The Lineage, Definitions, Outlets and Actions tabs
> also show what appears to be correct content yet the bug as described on
> File -> Read Class Files persists.
>
> 
> 'GenRegData.zip' was successfully uploaded
>
> 
> See attached. I have obfuscated the code to protect client
> confidentiality but the problem was still present.
> }}}

New description:

 Had a problem with Interface Builder parsing a XCode project using
 MacRuby. Raised a bug in Radar but Apple Engineering have responded that
 the issue is with macruby. Therefore raised as a ticket here. Full text of
 email thread reproduced below:

 {{{
 Hi Timothy,

 This is a courtesy email regarding Bug ID# 7464509.
 Engineering has determined that this issue originates with MacRuby
 mailing-list.
 [...]
 The IB parser has been tested many times recently (especially the last few
 days), so we would be tempted to say that this is a problem with the
 project.

[MacRuby-devel] [MacRuby] #689: Net::HTTP.post_form() is broken.

2010-05-05 Thread MacRuby
#689: Net::HTTP.post_form() is broken.
-+--
 Reporter:  r...@…|   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--
 I'm running the latest nightly(05/05/2010), to reproduce:

 {{{
 require 'net/http'
 Net::HTTP.post_form(URI.parse('http://www.google.com/foobar', { :foo =>
 'bar' })

 # ... Produces:
 ArgumentError: method `force_encoding:' does not work on NSStrings
 }}}

 Thanks.

-- 
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] #689: Net::HTTP.post_form() is broken.

2010-05-05 Thread MacRuby
#689: Net::HTTP.post_form() is broken.
-+--
 Reporter:  r...@…|   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--

Comment(by r...@…):

 Replying to [ticket:689 r...@…]:
 > I'm running the latest nightly(05/05/2010), to reproduce:
 >
 > {{{
 > require 'net/http'
 > Net::HTTP.post_form(URI.parse('http://www.google.com/foobar', { :foo =>
 'bar' })
 >
 > # ... Produces:
 > ArgumentError: method `force_encoding:' does not work on NSStrings
 > }}}
 >
 > Thanks.
 Syntax error in the last demo, should be:
 {{{
 require 'net/http'
 Net::HTTP.post_form(URI.parse('http://www.google.com/foobar'), { :foo =>
 'bar' })

 # ... Produces:
 ArgumentError: method `force_encoding:' does not work on NSStrings
 }}}

-- 
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-devel Digest, Vol 27, Issue 13

2010-05-05 Thread Tiago Ribeiro
Thanks a lot for the information Thibault, very useful!!

Take care

>Date: Tue, 4 May 2010 15:13:13 -0700
>From: Thibault Martin-Lagardette 
>To: "MacRuby development discussions."
>   
>Subject: Re: [MacRuby-devel] [ANN] MacRuby 0.6
>Message-ID:
>   
>Content-Type: text/plain; charset="iso-8859-1"
>
>Hi Tiago!
>
>We are sorry that the PostgreSQL gem is not yet fully installable via
>macgem.
>The one we managed to install was ruby-pg 0.9.0 (
>http://bitbucket.org/ged/ruby-pg/downloads).
>However, the gem in itself has an extconf.rb file with a syntax that is not
>yet supported in MacRuby and probably won't be soon enough.
>
>To install and use ruby-pg, you'll need to do the following:
>- Download ruby-pg 0.9.0 from http://bitbucket.org/ged/ruby-pg/downloads
>- Extract wherever you want, let's say in /tmp/ruby-pg for example
>- Go in the extracted ruby-pg directory, and apply the patch (
>https://gist.github.com/00be9e82ed4fd548c29d ) by doing: patch -p0 <
>/path/to/extconf.rb
>- cd into the "ext" directory, and run the following commands:
>$> macruby extconf.rb # potentially add --with-pg-config if you need
>$> make
>$> sudo make install
>You will have to make sure that your local installation of PostgreSQL is
>compiled for both i386 and x86_64 bits, MacRuby requires it.
>
>Once you have issued the latest command, the extension "pg_ext" will be
>installed (without needing gems). You can either rename pg_ext to pg, or
>create a pg.rb file that requires pg_ext (which is exactly what the gem does
>when installed, however installing ruby-pg has proven to less than
>straightforward [even with ruby19], so it's easier to do it this way ;-)).
>
>Hope this helps, good luck with that!
>-- 
>Thibault Martin-Lagardette
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] NSObject.to_s question

2010-05-05 Thread Jordan Breeding
Right now for custom objects on the Objective-C side even if you provide a 
-[Object description] call to_s will fall through and hit to_s from NSObject 
which right now just has the class name and pointer.

Is it already planned for the future to use the description method in to_s on 
the MacRuby side? Should I file a bug report?

Jordan

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


[MacRuby-devel] [MacRuby] #690: calling `!= nil' on an NSString raises a TypeError exception

2010-05-05 Thread MacRuby
#690: calling `!= nil' on an NSString raises a TypeError exception
---+
 Reporter:  lsansone...@…  |   Owner:  lsansone...@…
 Type:  defect |  Status:  new  
 Priority:  blocker|   Milestone:   
Component:  MacRuby|Keywords:   
---+
 {{{
 $ ./miniruby -e "p NSString.stringWithString('42') != nil"
 /Users/lrz/src/macruby-trunk/-e:1:in `': can't convert nil into
 String (TypeError)
 }}}

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] Comparison between String and nil fails.

2010-05-05 Thread Laurent Sansonetti
Hi Michel,

Thanks for the report. Thibault reduced the problem, we will track it here:

https://www.macruby.org/trac/ticket/690

Laurent

On May 5, 2010, at 2:11 AM, Michel Steuwer wrote:

> Hi everyone,
> yesterday i migrated my little MacRuby project to 0.6 and i found a kind of 
> strange behavior in a comparison between a string and nil. In MacRuby 0.5 the 
> line worked as expected.
> I get the following error message in a comparison between a string on the 
> left and nil on the right:
> can't convert nil into String (TypeError)
> 
> I made a little demo project to show the problem.
> The string i want to compare comes out of a userInfo dictionary i get when 
> iTunes send a notification through the NSDistributredNotificationCenter.
> In the demo project the error occurs, if you play, pause, or skip a song in 
> iTunes (every time i get a notification from iTunes).
> 
> So here the code in which the error occurs:
> 
> def songChanged(notification)
>   NSLog("notification.userInfo[Name]  
> #{notification.userInfo['Name']}.")
>   NSLog("notification.userInfo[Name].nil? 
> #{notification.userInfo['Name'].nil?}.")
>   NSLog("notification.userInfo[Name].class
> #{notification.userInfo['Name'].class}.")
>   NSLog("notification.userInfo[Name] != nil   
> #{notification.userInfo['Name'] != nil}")
> end
> 
> The method receives a notification from iTunes and the last line in the 
> method fails ( notification.userInfo['Name'] != nil ).
> 
> I don't know where the problem is, but i guess the comparison should just 
> return false. One again, in MacRuby 0.5 the line worked as expected.
> 
> You can find the hole demo project at:
> http://github.com/michelSt/MacRubyBug
> 
> Thanks,
> Michel
> --
> Michel Steuwer | michel.steu...@onlinehome.de
> 
> ___
> 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] Passing a string buffer to a C function

2010-05-05 Thread Laurent Sansonetti
Hi Mike,

Thanks for the report. I think this is because GLchar* is typed in the runtime 
as a C-style string. The compiler should allow Pointer objects for this runtime 
type. Currently, it only allows nil, symbols and strings.

Could you file a bug? We will track this...

Thanks,

Laurent

On May 5, 2010, at 10:43 AM, Mike Taylor wrote:

> 
> Hi all, 
> 
> I'm trying to do some GLSL shaders with MacRuby. However, I'm a bit stumped 
> as to how to call glGetShaderInfoLog if the shader compilation fails. The C 
> function's prototype is:
> 
> void glGetShaderInfoLog(GLuint shader, GLsizei maxLength, GLsizei * length, 
> GLchar * infoLog);
> 
> I couldn't find any docs on how Pointer.new_with_type, so I tried a few 
> things, such as:
> 
> log_info = Pointer.new_with_type('c', 4096)
> length = Pointer.new_with_type('i')
> 
> glGetShaderInfoLog(@shader_id, 4096, length, log_info)
> 
> However, I get the error:
> 
> TypeError: can't convert Pointer into String
> 
> It seems that the bridge wants log_info to be a String object. But, using a 
> String causes a bus error. I'm expecting that the bridge isn't expecting the 
> string to be mutated.
> 
> Any suggestions would be appreciated!
> 
> /\/\ike
> 
> ___
> 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] [MacRuby] #691: Runtime should allow pointer types for C-string arguments

2010-05-05 Thread MacRuby
#691: Runtime should allow pointer types for C-string arguments
+---
 Reporter:  m...@…  |   Owner:  lsansone...@…
 Type:  enhancement |  Status:  new  
 Priority:  major   |   Milestone:   
Component:  MacRuby |Keywords:   
+---
 The MacRuby runtime does not allow calls to C functions that take a string
 buffer using Pointer types. So, any C functions that need to fill a string
 buffer cannot be called.

 For example, I'm trying to do some GLSL shaders with MacRuby. I cannot
 call glGetShaderInfoLog if the shader compilation fails. The C function's
 prototype is:

 void glGetShaderInfoLog(GLuint shader, GLsizei maxLength, GLsizei *
 length, GLchar * infoLog);

 I couldn't find any docs on how Pointer.new_with_type, so I tried a few
 things, such as:

 log_info = Pointer.new_with_type('c', 4096)
 length = Pointer.new_with_type('i')

 glGetShaderInfoLog(@shader_id, 4096, length, log_info)

 However, I get the error:

 TypeError: can't convert Pointer into String

 It seems that the bridge wants log_info to be a String object. But, using
 a String causes a bus error. I'm expecting that the bridge isn't expecting
 the string to be mutated.

-- 
Ticket URL: 
MacRuby 

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


[MacRuby-devel] [MacRuby] #692: Embedded MacRuby still tries to use ruby library from /Library/Frameworks

2010-05-05 Thread MacRuby
#692: Embedded MacRuby still tries to use ruby library from /Library/Frameworks
+---
 Reporter:  m...@…  |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  minor   |   Milestone:   
Component:  MacRuby |Keywords:   
+---
 I have embedded MacRuby in my app using the macruby_deploy script, but it
 still tries to load library files from /Library/Frameworks.

 In the case of C extensions, this actually caused libmacruby.dylib to be
 loaded twice, which is bad.

 I worked around this by changing the RUBY_LIB before initializing MacRuby.

 Shouldn't MacRuby set up it's path relative to the framework from which it
 is loaded?

-- 
Ticket URL: 
MacRuby 

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


[MacRuby-devel] [MacRuby] #693: 0.6 Abort traps caused by 'require' and 'framework' in that order

2010-05-05 Thread MacRuby
#693: 0.6 Abort traps caused by 'require' and 'framework' in that order
-+--
 Reporter:  mar...@… |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  major|   Milestone:   
Component:  MacRuby  |Keywords:   
-+--
 Here's a program:

 {{{
 require 'rubygems'
 gem 'test-unit'# Note this is 2.0.7.
 require 'test/unit'
 framework 'Cocoa'
 }}}

 Much of the time (but not always), this fails with:

 {{{
 method dispatch is b0rked
 Abort trap
 }}}

 Sometimes it's this:

 {{{
 unknown: [BUG] Segmentation fault
 MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64]

 Abort trap
 }}}

 Sometimes it exits successfully.

 Here's a way to make it consistently exit successfully: put the "framework
 Cocoa" before the "gem test-unit".

 Another fun way to make it consistently exit successfully is to replace
 "require test/unit' with the *contents* of that file.

 Even though there's a simple workaround, I'm calling it "major" because
 the workaround is hard to find.

-- 
Ticket URL: 
MacRuby 

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


[MacRuby-devel] FTP in MacRuby

2010-05-05 Thread Daniel Fontaine
Does Net::FTP not work on MacRuby 0.6? I am trying a simple 
Net::FTP.new(server, user, password) and receive

EOFError: end of file reached
from 
/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/1.9.0/monitor.rb:188:in
 `synchronize'
from 
/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/1.9.0/monitor.rb:188:in
 `synchronize'

The same method works fine under standard ruby.

I am new to MacRuby, so sorry if this is a known issue.

thanks,
Dan


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


Re: [MacRuby-devel] NSObject.to_s question

2010-05-05 Thread B. Ohr
Jordan,

you can do something like that:

class Object
  alias :old_inspect :inspect
 
  def inspect
i = old_inspect
if i.start_with?('#<')
  d = description
  d.start_with?('<') ? i : d
else
  i
end
  end
end

But you’re right, a better integration of „description“ would be nice.

Bernd


Am 05.05.2010 um 22:30 schrieb Jordan Breeding:

> Right now for custom objects on the Objective-C side even if you provide a 
> -[Object description] call to_s will fall through and hit to_s from NSObject 
> which right now just has the class name and pointer.
> 
> Is it already planned for the future to use the description method in to_s on 
> the MacRuby side? Should I file a bug report?
> 
> Jordan___
> 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] NSObject.to_s question

2010-05-05 Thread Jordan Breeding
Yeah, I was doing something similar right now, just hoping for a better long 
term solution in MacRuby.

On May 05, 2010, at 20:11, B. Ohr wrote:

> Jordan,
> 
> you can do something like that:
> 
> class Object
>  alias :old_inspect :inspect
> 
>  def inspect
>i = old_inspect
>if i.start_with?('#<')
>  d = description
>  d.start_with?('<') ? i : d
>else
>  i
>end
>  end
> end
> 
> But you’re right, a better integration of „description“ would be nice.
> 
> Bernd
> 
> 
> Am 05.05.2010 um 22:30 schrieb Jordan Breeding:
> 
>> Right now for custom objects on the Objective-C side even if you provide a 
>> -[Object description] call to_s will fall through and hit to_s from NSObject 
>> which right now just has the class name and pointer.
>> 
>> Is it already planned for the future to use the description method in to_s 
>> on the MacRuby side? Should I file a bug report?
>> 
>> Jordan___
>> 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



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] #628: CTFramesetterCreateFrame doesn't like the CFRange type

2010-05-05 Thread Paul Howson
On 26/04/2010, at 1:33 PM, MacRuby wrote:

> #628: CTFramesetterCreateFrame doesn't like the CFRange type
> ---+
> Reporter:  ea...@…|Owner:  lsansone...@…
> Type:  defect |   Status:  closed   
> Priority:  major  |Milestone:  MacRuby 0.6  
> Component:  MacRuby|   Resolution:  fixed
> Keywords: |  
> ---+
> Changes (by lsansone...@…):
> 
>  * status:  new => closed
>  * resolution:  => fixed
>  * milestone:  => MacRuby 0.6

Hi Laurent,

What would be a feasible workaround for this problem, given than I'm using 
MacRuby 0.5 ?

i.e. I'm also trying to call:

CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, nil)

The second argument is a range which produces the error.

Can I edit the bridge support file? Or is there some other workaround? Can I 
use a more recent built of MacRuby? Or are these too buggy compared to 0.5?

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


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

2010-05-05 Thread Laurent Sansonetti
Hi Paul,

On May 5, 2010, at 7:57 PM, Paul Howson wrote:

> On 26/04/2010, at 1:33 PM, MacRuby wrote:
> 
>> #628: CTFramesetterCreateFrame doesn't like the CFRange type
>> ---+
>> Reporter:  ea...@…|Owner:  lsansone...@…
>>Type:  defect |   Status:  closed   
>> Priority:  major  |Milestone:  MacRuby 0.6  
>> Component:  MacRuby|   Resolution:  fixed
>> Keywords: |  
>> ---+
>> Changes (by lsansone...@…):
>> 
>> * status:  new => closed
>> * resolution:  => fixed
>> * milestone:  => MacRuby 0.6
> 
> Hi Laurent,
> 
> What would be a feasible workaround for this problem, given than I'm using 
> MacRuby 0.5 ?
> 
> i.e. I'm also trying to call:
> 
> CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, nil)
> 
> The second argument is a range which produces the error.
> 
> Can I edit the bridge support file? Or is there some other workaround? Can I 
> use a more recent built of MacRuby? Or are these too buggy compared to 0.5?

Do you have any reason why you cannot use 0.6? It's much stabler than 0.5 :)

http://www.macruby.org/blog/2010/04/30/macruby06.html

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


[MacRuby-devel] v0.7 and v0.6 timeout problem

2010-05-05 Thread B. Ohr
Hi, I have strange timeout problems with 0.6 and 0.7

$ time macruby_select 0.7 -e 'framework "Cocoa"'
2010-05-06 07:03:55.018 macruby[1922:607] 
__CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs
real0m1.588s
user0m0.699s
sys 0m0.096s

0.6 takes even longer:

$ time macruby_select 0.6 -e 'framework "Cocoa"'
2010-05-06 07:03:43.672 macruby[1913:607] 
__CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs
real0m2.170s
user0m0.698s
sys 0m0.102s

while 0.5 has no timeout:

$ time macruby_select 0.5 -e 'framework "Cocoa“‘
real0m0.398s
user0m0.380s
sys 0m0.057s

I’m still on OS X Version 10.6.2, is that the reason?

In the meantime I removed the MacRuby runtimes ala Matt Aimonetti, but that 
did’nt help.

- Bernd


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