Re: [MacRuby-devel] [MacRuby] #746: Net::HTTP assertion failed

2010-06-17 Thread MacRuby
#746: Net::HTTP assertion failed
-+--
 Reporter:  mattaimone...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:  MacRuby 0.7  
Component:  MacRuby  |Keywords:   
-+--

Comment(by watson1...@…):

 This problem did not reproduce with r4233.
 Please check it.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Objects instantiated as anonymous class by Bindings mechanism

2010-06-17 Thread Wladj
Hi,

i spent a little time with the problem i had some time ago, in effect there is 
a problem with bindings mechanism in MacRuby 0.6 :

- create a new MacRuby Document based project 

- MyDocument.nib
create a new ObjectController binded with File's Owner Content, model 
key path "dummy"
create a new text field binded with ObjectController selection, model 
key path "name"

- MyDocument.rb

class MyDocument < NSDocument
attr_accessor :dummy

def init
super

setDummy({"name"=>"dummy"})
puts "in init class of Hash is : #[email protected]}"

return self
end

def windowNibName
'MyDocument'
end

# Document data representation for saving (return NSData)
def dataOfType(type, error:outError)
puts "in save class of Hash is : #[email protected]}"

return true
end

# Read document from data (return non-nil on success)
def readFromData(data, ofType:type, error:outError)
return true
end

# Return lowercase 'untitled', to comply with HIG
def displayName
fileURL ? super : super.sub(/^[[:upper:]]/) {|s| s.downcase}
end
end

bindings works, but when i try to save the document...

in init class of Hash is : [Hash, NSMutableDictionary, NSDictionary, 
Enumerable, NSObject, Kernel]
in save class of Hash is : [#, Hash, NSMutableDictionary, 
NSDictionary, Enumerable, NSObject, Kernel]

of course if i try to serialize the object i obtain :

`fileWrapperOfType:error:': can't dump anonymous class # 
(TypeError)

if i remove the bindings with text field all works again...well i mean no data 
in it, but at least the class of object remain the same

au contraire in MacRuby 0.5 all works fine

in init class of Hash is : [NSMutableDictionary, NSDictionary, Enumerable, 
NSObject, Kernel]
in save class of Hash is : [NSMutableDictionary, NSDictionary, Enumerable, 
NSObject, Kernel]

Thanks for any help and workaround
Ciao

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #750: Net::HTTP.get fails

2010-06-17 Thread MacRuby
#750: Net::HTTP.get fails
---+
 Reporter:  joecanna...@…  |   Owner:  lsansone...@…
 Type:  defect |  Status:  new  
 Priority:  blocker|   Milestone:  MacRuby 0.6  
Component:  MacRuby|Keywords:  net http 
---+
 On certain files, a simple HTTP GET will fail with the error: "TypeError:
 can't convert nil into String". It happens on the same remote html files
 every time and I cannot determine the cause. Use this code to recreate:

 Net::HTTP.start('books.inomadics.com') do |http|
 req = Net::HTTP::Get.new('/iPadia/2010/June/aboutsoccer.html')
 res = http.request req
 puts res.body
 end

 NOTE: works fine in irb, but fails in macirb

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #750: Net::HTTP.get fails

2010-06-17 Thread MacRuby
#750: Net::HTTP.get fails
---+
 Reporter:  joecanna...@…  |   Owner:  lsansone...@…
 Type:  defect |  Status:  new  
 Priority:  blocker|   Milestone:  MacRuby 0.6  
Component:  MacRuby|Keywords:  net http 
---+

Comment(by watson1...@…):

 I think that your test code works with r4233.

 But if WebSite's encoding do not use a UTF-8, I think that Net::HTTP.get
 fails.
 A encoding of "www.google.co.jp" use a Shift_JIS when I accessed it with
 Net::HTTP.

 $ cat test_http.rb
 {{{
 # -*- coding: utf-8 -*-
 require 'net/http'

 body = Net::HTTP.get('www.google.co.jp', '/')
 puts body
 }}}
 {{{
 $ macruby test_http.rb
 wrong chunk size line:  (Net::HTTPBadResponse)
 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Building Cocoa Apps with MacRuby

2010-06-17 Thread dan sinclair
Hello,

I wrote up some thoughts on building cocoa applications with MacRuby last night 
and would love to hear any thoughts other people have. You can see the article 
at http://everburning.com/news/ramblings-on-programming-cocoa-with-ruby/ .

I've been trying several different methods, HotCocoa, XCode templates, command 
line and haven't quite figured out a way that feels right and would love some 
insight from other developers.

Thanks,
dan


___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Building Cocoa Apps with MacRuby

2010-06-17 Thread Rich Morin
Xcode has some scripting capability.  Might you be able to
hack up some scripts to automate away some of the hassle?

-r
-- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume [email protected]
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Technical editing and writing, programming, system design
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Building Cocoa Apps with MacRuby

2010-06-17 Thread dan sinclair
I tried using TextMate with XCode for a while but I didn't like having to 
switch back and forth between the two all the time. It felt clunky to develop 
in TextMate and build and see the debug output in XCode. Having to run XCode 
just to be able to build the application felt heavy. That was part of the 
reason why I switched to a pure Rakefile method.

dan



On 2010-06-17, at 1:43 PM, Rich Morin wrote:

> Xcode has some scripting capability.  Might you be able to
> hack up some scripts to automate away some of the hassle?
> 
> -r
> -- 
> http://www.cfcl.com/rdmRich Morin
> http://www.cfcl.com/rdm/resume [email protected]
> http://www.cfcl.com/rdm/weblog +1 650-873-7841
> 
> Technical editing and writing, programming, system design
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #746: Net::HTTP assertion failed

2010-06-17 Thread MacRuby
#746: Net::HTTP assertion failed
-+--
 Reporter:  mattaimone...@…  |Owner:  lsansone...@…
 Type:  defect   |   Status:  closed   
 Priority:  blocker  |Milestone:  MacRuby 0.7  
Component:  MacRuby  |   Resolution:  fixed
 Keywords:   |  
-+--
Changes (by martinlagarde...@…):

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


Comment:

 I confirm, fixed with r4233. Suspected as much :-)

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #750: Net::HTTP.get fails

2010-06-17 Thread MacRuby
#750: Net::HTTP.get fails
---+
 Reporter:  joecanna...@…  |Owner:  lsansone...@…
 Type:  defect |   Status:  closed   
 Priority:  blocker|Milestone:  MacRuby 0.7  
Component:  MacRuby|   Resolution:  fixed
 Keywords:  net http   |  
---+
Changes (by martinlagarde...@…):

  * status:  new => closed
  * resolution:  => fixed
  * milestone:  MacRuby 0.6 => MacRuby 0.7


Old description:

> On certain files, a simple HTTP GET will fail with the error: "TypeError:
> can't convert nil into String". It happens on the same remote html files
> every time and I cannot determine the cause. Use this code to recreate:
>
> Net::HTTP.start('books.inomadics.com') do |http|
> req = Net::HTTP::Get.new('/iPadia/2010/June/aboutsoccer.html')
> res = http.request req
> puts res.body
> end
>
> NOTE: works fine in irb, but fails in macirb

New description:

 On certain files, a simple HTTP GET will fail with the error: "TypeError:
 can't convert nil into String". It happens on the same remote html files
 every time and I cannot determine the cause. Use this code to recreate:

 {{{
 #!ruby
 Net::HTTP.start('books.inomadics.com') do |http|
 req = Net::HTTP::Get.new('/iPadia/2010/June/aboutsoccer.html')
 res = http.request req
 puts res.body
 end
 }}}

 NOTE: works fine in irb, but fails in macirb

--

Comment:

 Both example works with r4233:

 {{{
 $> macruby t.rb
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

 http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
 
 
   

 [...]
 $> macruby t2.rb
 Google

Re: [MacRuby-devel] [MacRuby] #340: http.get failing with the error "wrong chunk size line: (Net::HTTPBadResponse)"

2010-06-17 Thread MacRuby
#340: http.get failing with the error "wrong chunk size line:
(Net::HTTPBadResponse)"
+---
 Reporter:  bobsteven...@…  |Owner:  lsansone...@…
 Type:  defect  |   Status:  closed   
 Priority:  blocker |Milestone:  MacRuby 0.7  
Component:  MacRuby |   Resolution:  fixed
 Keywords:  http get|  
+---
Changes (by martinlagarde...@…):

  * status:  new => closed
  * resolution:  => fixed
  * milestone:  => MacRuby 0.7


Comment:

 Fixed with r4234

 {{{
 #!ruby

 require 'net/http'
 require 'rexml/document'
 require 'uri'

 token ='mCHpMz2L_a_OrEkz3FSiDg'
 hostname = 'api.kayak.com'
 port = 80

 Net::HTTP.start(hostname, port) do |http|
   p http
   response = http.get("/k/ident/apisession?token=#{token}")
   p response
 end
 }}}
 {{{
 $> macruby t.rb
 #
 #
 $>
 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Objects instantiated as anonymous class by Bindings mechanism

2010-06-17 Thread Wladj
as workaround i can create the hash via NSMutableDictionary.dictionary or in my 
case :

temp = YAML::load( NSString.alloc.initWithData( 
fileWrapper.regularFileContents, encoding:NSString.defaultCStringEncoding))
@data = NSMutableDictionary.dictionary
@data.setDictionary(temp)

is a bug or a behaviour that i do not understand?
Ciao___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Objects instantiated as anonymous class by Bindings mechanism

2010-06-17 Thread Laurent Sansonetti
Hi,

It looks like a bug indeed. Could you file a ticket on trac? We will get this 
corrected in 0.7.

Thanks!
Laurent

On Jun 17, 2010, at 1:46 PM, Wladj wrote:

> as workaround i can create the hash via NSMutableDictionary.dictionary or in 
> my case :
> 
> temp = YAML::load( NSString.alloc.initWithData( 
> fileWrapper.regularFileContents, encoding:NSString.defaultCStringEncoding))
> @data =   NSMutableDictionary.dictionary
> @data.setDictionary(temp)
> 
> is a bug or a behaviour that i do not understand?
> Ciao
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #751: Objects instantiated as anonymous class by Bindings mechanism

2010-06-17 Thread MacRuby
#751: Objects instantiated as anonymous class by  Bindings mechanism
+---
 Reporter:  wladj...@…  |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  minor   |   Milestone:  MacRuby 0.6  
Component:  MacRuby |Keywords:   
+---
 there is a problem with bindings mechanism in MacRuby 0.6 :

 - create a new MacRuby Document based project

 - MyDocument.nib
 create a new ObjectController binded with File's Owner Content,
 model key path "dummy"

 create a new text field binded with ObjectController selection,
 model key path "name"

 - MyDocument.rb

 {{{
 class MyDocument < NSDocument
 attr_accessor :dummy

 def init
 super

 setDummy({"name"=>"dummy"})
 puts "in init class of Hash is :
 #[email protected]}"

 return self
 end

 def windowNibName
 'MyDocument'
 end

 # Document data representation for saving (return NSData)
 def dataOfType(type, error:outError)
 puts "in save class of Hash is :
 #[email protected]}"

 return true
 end

 # Read document from data (return non-nil on success)
 def readFromData(data, ofType:type, error:outError)
 return true
 end

 # Return lowercase 'untitled', to comply with HIG
 def displayName
 fileURL ? super : super.sub(/^[[:upper:]]/) {|s|
 s.downcase}
 end
 end
 }}}


 bindings works, but when i try for to save the document, or already in the
 windowDidLoad (NSWindowController) method...

 {{{
 in init class of Hash is : [Hash, NSMutableDictionary, NSDictionary,
 Enumerable, NSObject, Kernel]
 in save class of Hash is : [#, Hash,
 NSMutableDictionary, NSDictionary, Enumerable, NSObject, Kernel]
 }}}

 of course if i try to serialize the object i obtain :

 {{{

 `fileWrapperOfType:error:': can't dump anonymous class #
 (TypeError)
 }}}


 if i remove the bindings with text field all works again...well i mean no
 data in it, but at least the class of object remain the same

 as workaround i can create the hash via NSMutableDictionary.dictionary or
 in my case :

 {{{
 temp = YAML::load( NSString.alloc.initWithData(
 fileWrapper.regularFileContents,
 encoding:NSString.defaultCStringEncoding))
 @data = NSMutableDictionary.dictionary
 @data.setDictionary(temp)
 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Building Cocoa Apps with MacRuby

2010-06-17 Thread Michael Jackson
The way I'm currently doing it is with two separate apps as well. I
keep the Xcode GDB window open for building and debug output and I
have MacVim open for editing the code. Of course, I have to open up
the main project window if I want to add some files to the project,
but I find that having Xcode open anyways is a good idea because I
need to consult the documentation quite often (I'm new to Cocoa).

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Thu, Jun 17, 2010 at 11:52 AM, dan sinclair  wrote:
> I tried using TextMate with XCode for a while but I didn't like having to 
> switch back and forth between the two all the time. It felt clunky to develop 
> in TextMate and build and see the debug output in XCode. Having to run XCode 
> just to be able to build the application felt heavy. That was part of the 
> reason why I switched to a pure Rakefile method.
>
> dan
>
>
>
> On 2010-06-17, at 1:43 PM, Rich Morin wrote:
>
>> Xcode has some scripting capability.  Might you be able to
>> hack up some scripts to automate away some of the hassle?
>>
>> -r
>> --
>> http://www.cfcl.com/rdm            Rich Morin
>> http://www.cfcl.com/rdm/resume     [email protected]
>> http://www.cfcl.com/rdm/weblog     +1 650-873-7841
>>
>> Technical editing and writing, programming, system design
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #503: connect to udp socket: getaddrinfo: nodename nor servname provided, or not known (SocketError)

2010-06-17 Thread MacRuby
#503: connect to udp socket: getaddrinfo: nodename nor servname provided, or not
known (SocketError)
-+--
 Reporter:  mar...@… |Owner:  lsansone...@…
 Type:  defect   |   Status:  closed   
 Priority:  blocker  |Milestone:  MacRuby 0.7  
Component:  MacRuby  |   Resolution:  fixed
 Keywords:   |  
-+--
Changes (by martinlagarde...@…):

  * status:  new => closed
  * resolution:  => fixed
  * milestone:  => MacRuby 0.7


Comment:

 Fixed with r4236.

 It takes forever, but it seems to work.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel