[MacRuby-devel] Problem with MacRuby in Objective-C project

2009-08-09 Thread Jaromír Šiška
I experimented with using MacRuby in ObjC projects. When I tried  
evaluteFileAtPath: method it worked fine until I tried to import  
another Ruby file into file under evaluation. E.g. if I put into  
evaluated file require 'csv'  and  I get in the debug console:


[Session started at 2009-08-09 17:00:51 +0200.]
2009-08-09 17:00:54.302 EmbedRubyFile[19113:10b] LoadError: no such  
file to load -- csv.rb.bundle

(
"/Users/jsiska/TEMP/pp_pascal2.rb:4:in `require'",
"/Users/jsiska/TEMP/pp_pascal2.rb:4:in `'"
)

Can anybody advice me where is the problem?

Thank you

Jaromir Siska

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


[MacRuby-devel] Problem with require in MacRuby

2009-08-09 Thread Jaromír Šiška
Actually I experience similar problem when I try to use require from  
macirb:

jsiska-3:Ruby jsiska$ macirb
irb(main):001:0> require 'csv'
LoadError: no such file to load -- stringio.rb.bundle
	from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
1.9.1/csv.rb:96:in `require'
	from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
1.9.1/csv.rb:96:in `'

from (irb):1:in `require'
from (irb):1
from /usr/local/bin/macirb:12:in `'
irb(main):002:0>

Best regards

jaromir

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


Re: [MacRuby-devel] Base64 specs

2009-08-09 Thread dan sinclair
Well, not all of the Base64 stuff was removed. Of the four base64 test  
files, two of them are obsolete and two of them appear to still be  
valid.


b64encode_spec.rb and decode_b_spec.rb are both invalid while  
decode64_spec.rb and encode64_spec.rb are both valid.


dan


On Aug 7, 2009, at 2:48 AM, Eloy Duran wrote:

Ok I see, Base64 was removed from 1.9 in favour of using Array#pack  
and String#unpack. Which means we only need to omit it from the ruby  
specific mspec script. In our case macruby.mspec. If it's not yet in  
the obsolete list of libraries in the ruby.1.9.mspec script, then it  
should be added there.


Eloy

On 7 aug 2009, at 02:13, dan sinclair wrote:

As far as I can tell, those methods don't exist in the Base64 class  
on Ruby 1.9.2.  Not sure if I'm missing something but I didn't find  
them.


dan





On Aug 6, 2009, at 3:53 AM, Eloy Duran wrote:


Hey Dan,

By just reading the patch it seems there are no new versions of  
these examples on how the method works on 1.9.x. Could you please  
add those as well?


Cheers,
Eloy

On Aug 5, 2009, at 5:44 AM, dan sinclair wrote:


Hello,

The attached patch marks some specs that don't execute on Ruby  
1.9.2 for me.  The other Base64 specs that are broken are due to  
the TODO in vm_method.c,  rb_mod_modfunc to do with changing scope.


dan


___
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


___
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] Base64 specs

2009-08-09 Thread Eloy Duran

Got it. Applied in r2269, thanks!

Eloy

On 9 aug 2009, at 18:52, dan sinclair wrote:

Well, not all of the Base64 stuff was removed. Of the four base64  
test files, two of them are obsolete and two of them appear to still  
be valid.


b64encode_spec.rb and decode_b_spec.rb are both invalid while  
decode64_spec.rb and encode64_spec.rb are both valid.


dan


On Aug 7, 2009, at 2:48 AM, Eloy Duran wrote:

Ok I see, Base64 was removed from 1.9 in favour of using Array#pack  
and String#unpack. Which means we only need to omit it from the  
ruby specific mspec script. In our case macruby.mspec. If it's not  
yet in the obsolete list of libraries in the ruby.1.9.mspec script,  
then it should be added there.


Eloy

On 7 aug 2009, at 02:13, dan sinclair wrote:

As far as I can tell, those methods don't exist in the Base64  
class on Ruby 1.9.2.  Not sure if I'm missing something but I  
didn't find them.


dan





On Aug 6, 2009, at 3:53 AM, Eloy Duran wrote:


Hey Dan,

By just reading the patch it seems there are no new versions of  
these examples on how the method works on 1.9.x. Could you please  
add those as well?


Cheers,
Eloy

On Aug 5, 2009, at 5:44 AM, dan sinclair wrote:


Hello,

The attached patch marks some specs that don't execute on Ruby  
1.9.2 for me.  The other Base64 specs that are broken are due to  
the TODO in vm_method.c,  rb_mod_modfunc to do with changing  
scope.


dan


___
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


___
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


[MacRuby-devel] URI specs

2009-08-09 Thread dan sinclair

Hello,

I started poking at the URI specs to see what I could get working. The  
attached patch was required to make the specs run (URI provides 11  
arguments to initialize).


I then started taking a look at why the equality spec fails and have  
tracked it back to the dup call not returning the same values in the  
duplicate object. This can be seen by doing a self.to_s and uri.to_s  
in the normalize function of lib/uri/generic.rb.


self.to_s -> http://example.com/#fragMENT
uri.to_s ->  http://example.com/

For some reason, the fragment instance variable is being dropped from  
the duplicated object while all of the other instance variables are  
being copied over.


You can see the same behaviour with the following script


class  Foo
  def initialize(a, b, c, d, e, f, g, h, i, j, k)
@a = a
@b = b
@c = c
@d = d
@e = e
@f = f
@g = g
@h = h
@i = i
@j = j
@k = k
  end

  def to_s
"#...@a} #...@b} #...@c} #...@d} #...@e} #...@f} #...@g} #...@h} #...@i} #...@j} 
#...@k}"
  end
end

f = Foo.new("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k")
g = f.dup

puts f.to_s
puts g.to_s
---

titania:test dj2$ macruby ./dup.rb
a b c d e f g h i j k
a b c d e f g h i j false

dan




vm_argc.diff
Description: Binary data




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