Re: [MacRuby-devel] [MacRuby] #749: StringScanner doesn't match properly.

2010-06-18 Thread MacRuby
#749: StringScanner doesn't match properly.
+---
 Reporter:  kitchen.a...@…  |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  minor   |   Milestone:  MacRuby 0.7  
Component:  MacRuby |Keywords:   
+---

Comment(by martinlagarde...@…):

 hi!

 Thanks for the report.

 First of all, well, you know you shouldn't be using regexps to parse a
 file :D (especially ruby, since you have ripper for that).[[BR]]
 Second, I think the line you commented out is a better regexp than the one
 that is, in fact, not working correctly with Macruby.

 In the end, we do have problems with our regexps, and StringScanner
 suffers from it :-(. I'll keep the bug open with more information about it

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] [MacRuby] #749: Regexp issues / crashes affecting StringScanner (was: StringScanner doesn't match properly.)

2010-06-18 Thread MacRuby
#749: Regexp issues / crashes affecting StringScanner
+---
 Reporter:  kitchen.a...@…  |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  minor   |   Milestone:  MacRuby 0.7  
Component:  MacRuby |Keywords:   
+---

Old description:

> StringScanner fails to match a certain regular expressions properly.
> and diverges from MRI.

New description:

 StringScanner fails to match a certain regular expressions properly.
 and diverges from MRI.

 [EDIT] See comments.

--

Comment(by martinlagarde...@…):

 Infinite loop uses this loop:
 {{{
 #!ruby
 while ss.skip_until(/class(?![^ \n])|def(?![^ \n])/)
 }}}
 The segfault one is the same with the addition of surrounding parenthesis:
 {{{
 #!ruby
 while ss.skip_until(/(class(?![^ \n])|def(?![^ \n]))/)
 }}}

-- 
Ticket URL: 
MacRuby 

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


[MacRuby-devel] [MacRuby] #752: description -> to_s infinite loop

2010-06-18 Thread MacRuby
#752: description -> to_s infinite loop
--+-
 Reporter:  ryand-r...@…  |   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  blocker   |   Milestone:   
Component:  MacRuby   |Keywords:   
--+-
 I had a failing unit test that was causing an infinite stack trace. The
 code in question was:

 {{{
 class SimpleNodeData
   attr_accessor :name, :path, :image, :expandable, :selectable, :container

   def initialize name = "Untitled", path = nil
 self.name   = name
 self.path   = path
 self.expandable = true
 self.selectable = true
 self.container  = true
   end

   def compare other
 if SimpleNodeData === other
   return name.compare other.name
 end
 return NSOrderedAscending
   end

   alias :<=> :compare

   def description
 "%@ - '%@' expandable: %@, selectable: %@, container: %@" %
   [super, name, expandable, selectable, container]
   end

   alias :to_s :description
 end
 }}}

 That last alias is the real problem... comment it out and everything works
 fine.

 I believe the failing test line was:

 {{{
   assert child.representedObject.path,
 child.representedObject.description
 }}}

 and the representedObject was a SimpleNodeData instance.

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] [MacRuby] #744: map on an array delivered by terminal app via scripting bridge gives an immutable error

2010-06-18 Thread MacRuby
#744: map on an array delivered by terminal app via scripting bridge gives an
immutable error
+---
 Reporter:  jazz...@…   |Owner:  lsansone...@…
 Type:  defect  |   Status:  closed   
 Priority:  major   |Milestone:  MacRuby 0.7  
Component:  MacRuby |   Resolution:  invalid  
 Keywords:  |  
+---
Changes (by martinlagarde...@…):

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


Comment:

 I'm not sure how it worked in MacRuby 0.5. Are you sure it does work?
 Doesn't work with my copy of 0.5.

 In fact, it doesn't work in Obj-C either, so I'm not really sure how we
 can make it work within MacRuby :P

 {{{
 #!text/x-objc
 #import 
 #import 

 int main (int argc, const char * argv[]) {
 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

 SBApplication *app = [SBApplication
 applicationWithBundleIdentifier:@"com.apple.terminal"];
 SBElementArray *windows = [app windows];

 NSLog(@"%@", [windows class]);
 // This raises "can't add an object that already exists"
 [windows addObject:@"Window name"];
 int i = 0;
 for (id termWindow in windows) {
 // Same for that
 [windows replaceObjectAtIndex:i++ withObject:[termWindow name]];
 }

 [pool drain];
 return 0;
 }}}

 I'm closing the bug right now, bug feel free to re-open the bug if you
 have an Obj-C version that modifies the array that I would not have
 thought of.

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] [MacRuby] #752: description -> to_s infinite loop

2010-06-18 Thread MacRuby
#752: description -> to_s infinite loop
--+-
 Reporter:  ryand-r...@…  |Owner:  lsansone...@…
 Type:  defect|   Status:  closed   
 Priority:  blocker   |Milestone:  MacRuby 0.7  
Component:  MacRuby   |   Resolution:  wontfix  
 Keywords:|  
--+-
Changes (by martinlagarde...@…):

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


Old description:

> I had a failing unit test that was causing an infinite stack trace. The
> code in question was:
>
> {{{
> class SimpleNodeData
>   attr_accessor :name, :path, :image, :expandable, :selectable,
> :container
>
>   def initialize name = "Untitled", path = nil
> self.name   = name
> self.path   = path
> self.expandable = true
> self.selectable = true
> self.container  = true
>   end
>
>   def compare other
> if SimpleNodeData === other
>   return name.compare other.name
> end
> return NSOrderedAscending
>   end
>
>   alias :<=> :compare
>
>   def description
> "%@ - '%@' expandable: %@, selectable: %@, container: %@" %
>   [super, name, expandable, selectable, container]
>   end
>
>   alias :to_s :description
> end
> }}}
>
> That last alias is the real problem... comment it out and everything
> works fine.
>
> I believe the failing test line was:
>
> {{{
>   assert child.representedObject.path,
> child.representedObject.description
> }}}
>
> and the representedObject was a SimpleNodeData instance.

New description:

 I had a failing unit test that was causing an infinite stack trace. The
 code in question was:

 {{{
 #!ruby
 class SimpleNodeData
   attr_accessor :name, :path, :image, :expandable, :selectable, :container

   def initialize name = "Untitled", path = nil
 self.name   = name
 self.path   = path
 self.expandable = true
 self.selectable = true
 self.container  = true
   end

   def compare other
 if SimpleNodeData === other
   return name.compare other.name
 end
 return NSOrderedAscending
   end

   alias :<=> :compare

   def description
 "%@ - '%@' expandable: %@, selectable: %@, container: %@" %
   [super, name, expandable, selectable, container]
   end

   alias :to_s :description
 end
 }}}

 That last alias is the real problem... comment it out and everything works
 fine.

 I believe the failing test line was:

 {{{
   assert child.representedObject.path,
 child.representedObject.description
 }}}

 and the representedObject was a SimpleNodeData instance.

--

Comment:

 The problem is the following line:
 {{{
 #!ruby
   alias :to_s :description
 }}}

 When the programmer calls `-description` on MacRuby classes, MacRuby
 actually calls `#to_s`. This is both syntaxic sugar and needed in some
 cases. This also means that aliasing to_s to description is not needed.

 The reason it crashes it because of the `super` call actually.[[BR]]
 When you try to print it, Obj-C will send `-description` on the `super`
 object, which will actually dispatched to `#to_s`, because that's how
 `-description` is implemented on it.

 Note that your code works well if you replace `super` by `self`, since
 `self` re-implements `-description`. But MacRuby's default `-description`
 aliases to `#to_s` :-)

 Closing this as won't fix :-)

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] [MacRuby] #752: description -> to_s infinite loop

2010-06-18 Thread MacRuby
#752: description -> to_s infinite loop
--+-
 Reporter:  ryand-r...@…  |Owner:  lsansone...@…
 Type:  defect|   Status:  reopened 
 Priority:  blocker   |Milestone:   
Component:  MacRuby   |   Resolution:   
 Keywords:|  
--+-
Changes (by lsansone...@…):

  * status:  closed => reopened
  * resolution:  wontfix =>
  * milestone:  MacRuby 0.7 =>


Comment:

 Thibault, I believe we shouldn't go in an infinite loop here. Re-opening.

-- 
Ticket URL: 
MacRuby 

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


Re: [MacRuby-devel] [MacRuby] #752: description -> to_s infinite loop

2010-06-18 Thread MacRuby
#752: description -> to_s infinite loop
--+-
 Reporter:  ryand-r...@…  |Owner:  lsansone...@…
 Type:  defect|   Status:  closed   
 Priority:  blocker   |Milestone:  MacRuby 0.7  
Component:  MacRuby   |   Resolution:  fixed
 Keywords:|  
--+-
Changes (by martinlagarde...@…):

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


Comment:

 Sorry about that :-)

 Fixed in r4249 :-)

-- 
Ticket URL: 
MacRuby 

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


[MacRuby-devel] [MacRuby] #753: An error occurs when access to Webrick's HTTPServer.

2010-06-18 Thread MacRuby
#753: An error occurs when access to Webrick's HTTPServer.
--+-
 Reporter:  watson1...@…  |   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  blocker   |   Milestone:   
Component:  MacRuby   |Keywords:   
--+-
 {{{
 $ cat test_webrick.rb
 require 'webrick'
 include WEBrick

 root_dir = "./"
 s = HTTPServer.new(
 :Port => 8000,
 :DocumentRoot => File.join(Dir::pwd, root_dir)
 )
 trap("INT"){ s.shutdown }
 s.start
 }}}

 An error occurs when I access to HTTPServer with a browser.
 {{{
 $ macruby test_webrick.rb
 [2010-06-19 11:21:30] INFO  WEBrick 1.3.1
 [2010-06-19 11:21:30] INFO  ruby 1.9.2 (2008-06-03) [universal-darwin10.0]
 [2010-06-19 11:21:30] INFO  WEBrick::HTTPServer#start: pid= port=8000
 [2010-06-19 11:21:43] ERROR WEBrick::HTTPStatus::RequestURITooLarge
 [2010-06-19 11:21:43] ERROR RuntimeError: string frozen
 
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/webrick/httpresponse.rb:172:in
 `block'
 
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/webrick/httpresponse.rb:169:in
 `send_header:'
 
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/webrick/httpresponse.rb:101:in
 `send_response:'
 
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/webrick/httpserver.rb:45:in
 `run:'
 
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/webrick/server.rb:174:in
 `block'
 [2010-06-19 11:21:44] ERROR TypeError: no implicit conversion to float
 from nil
 
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/webrick/accesslog.rb:26:in
 `setup_params:'
 
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/webrick/httpserver.rb:164:in
 `access_log:'
 
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/webrick/httpserver.rb:45:in
 `run:'
 
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/webrick/server.rb:174:in
 `block'
 }}}

-- 
Ticket URL: 
MacRuby 

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