Re: [MacRuby-devel] CVImageBufferRef vs __NSCFType

2010-08-27 Thread Steven Parkes

> ptr 
> = Pointer.new("{ProcessSerialNumber=II}"
> )

Thanks. I had tried Pointer.new_with_type (trying to go from examples I found). 
I don't understand the difference between the two (yet).

> However, please note that this will get the current **application** PSN, 
> which, in case you run the script in Terminal, will be Terminal's PSN, not 
> MacRuby's.

Yeah, I know. I can also get the PSN from NSWorkspace with less hassle. This 
was just an example since I figure I may have to do this in other places in the 
future ...

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


[MacRuby-devel] `bytesize' does not work on NSStrings

2010-08-27 Thread Alexander v. Below
Hello List,

I am using MacRuby/Control Tower and have another stupid question. In somthing 
like this

  def call(env)
res = @delegate.testEnvironment(env['REQUEST_PATH'])
[200, { 'Content-Type' => 'text/html' }, res ]
  end

I get the run time error:

#

And indeed, "testEnvironment" does return an NSString. How can I convert this?

Alex

Bonus Question: This is in a Control Tower context, but "env" is always nil. I 
want to access the requests parameters (i.e. foo?bar=5). That was easy in 
Webrick, but I can not figure out how to do it in Control Tower

@Joshua: Thanks a lot for your last reply! That helped me get going
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] `bytesize' does not work on NSStrings

2010-08-27 Thread Nick Ludlam
On 27 Aug 2010, at 15:37, Alexander v. Below wrote:

> Bonus Question: This is in a Control Tower context, but "env" is always nil. 
> I want to access the requests parameters (i.e. foo?bar=5). That was easy in 
> Webrick, but I can not figure out how to do it in Control Tower


Your env should most certainly not be empty. In there, you would normally find 
key/value pairs like:

"REQUEST_METHOD"=>"GET"
"REQUEST_URI"=>"/foo/bar?id=baz"
"QUERY_STRING"=>"id=baz"

Can you show us how you're creating your rack app for CT to run? And let us 
know what version of MacRuby and CT are you running, too.


Nick

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


[MacRuby-devel] Cocoa Slides in MacRuby

2010-08-27 Thread Matthew Smith
I'm looking at implementing the Cocoa Slides sample application 
(http://developer.apple.com/mac/library/samplecode/CocoaSlides/Introduction/Intro.html)
 in MacRuby. Has anyone attempted this yet or interested in contributing?

Thanks,

Matthew Smith

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