Re: [MacRuby-devel] macirb & awesome_print
Hi, I haven’t heard back from Matt (from the original thread) or you and am still wondering if this solved it in a satisfactory way? Cheers, Eloy On Sat, Oct 9, 2010 at 6:13 PM, Eloy Duran wrote: > Yes, see this email from wednesday: > http://lists.macosforge.org/pipermail/macruby-devel/2010-October/006146.html > > HTH, > Eloy > > On Sat, Oct 9, 2010 at 4:51 PM, Brad Hutchins wrote: >> Any head way on macirb issue that I understand some others have also >> experienced as well with awesome_print? >> localhost:~ Brad$ rvm macruby >> localhost:~ Brad$ rvm list >> rvm rubies >> jruby-1.5.2 [ x86_64-java ] >> => macruby-0.7 [ x86_64 ] >> rbx-1.0.1-20100603 [ x86_64 ] >> ruby-1.8.7-p302 [ x86_64 ] >> ruby-1.9.2-p0 [ x86_64 ] >> localhost:~ Brad$ macirb >> /Users/Brad/.irbrc:1:in `': uninitialized constant IRB::Irb >> (NameError) >> from /usr/local/bin/macirb:13:in `block' >> from /usr/local/bin/macirb:9:in `block' >> from /usr/local/bin/macirb:3:in `' >> localhost:~ Brad$ irb >> /Users/Brad/.irbrc:1:in `': uninitialized constant IRB::Irb >> (NameError) >> from /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/bin/macirb:13:in >> `block' >> from /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/bin/macirb:9:in >> `block' >> from /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/bin/macirb:3:in >> `' >> localhost:~ Brad$ gem list >> *** LOCAL GEMS *** >> awesome_print (0.2.1) >> >> >> >> >> >> ___ >> 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] Data Formatters Temporarily Unavailable?
Hi Everyone, I am having a problem running a ruby script as a shell script I am getting the same error when I call this script: puts `sudo restart.rb` or this: puts `restart.rb` The script runs perfectly when I use the macirb in terminal so I am a bit stumped. Here is the error message: Running… sharedlibrary apply-load-rules all warning: check_safe_call: could not restore current frame Data Formatters temporarily unavailable, will re-try after a 'continue'. (Can't find dlopen function, so it is not possible to load shared libraries.) (gdb) continue Continuing. shutdown: NOT super-user Debugger stopped. Program exited with status value:1.(gdb) Thanks, Shaun ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] [ANN] MacRuby 0.7
On Oct 5, 2010, at 22:40 , Antony Blakey wrote: > http://rvm.beginrescueend.com/ ? or use bundler from rails (which IIUC is > independent of rails) or isolate, the smaller cleaner happier alternative to bundler. I haven't tried using isolate on macruby yet, but let me know if you have any issues. ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] Strings Differ between Ruby and MacRuby?
I have a bit of an issue with Strings between MacRuby and Ruby.
I have a socket that is feeding me data and I am running a check on watching
for changes in the byte structure. The script works in ruby and I can get both
the "\030" and the "\220" values to test true
Here is the snippet.
if results == "\030"
puts "got $2"
# @nc.postNotificationName("coins_taken_complete", object:self)
elsif results == "\220"
puts "got $1"
# @nc.postNotificationName("coins_taken_complete", object:self)
end
When I get it into the MacRuby environment the "\030" is picked up by the code
but the "\220" is not picked up at all. I have also tried this with the hex
values "\x18" and "\x90" and I get the same result, the "\x18" is picked up
and the "\x90" is not. I can see in the console that "\x90" is the value being
passed to this test when building with xcode and as I mentioned when I build
the script in ruby with textmate everything functions normally.
So I am wondering two things:
Is this a bug?
If I have to do a work around is there any way to tell what encodings are being
seen by the Macruby loop so I can match them
Any help would be greatly appreciated
Thanks,
Shaun
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Strings Differ between Ruby and MacRuby?
On 2010-10-11, at 16:07 , Shaun August wrote: > > The script works in ruby and I can get both the "\030" and the "\220" values > to test true When in MRI, are you testing in ruby 1.9? This reeks of encoding issues. > If I have to do a work around is there any way to tell what encodings are > being seen by the Macruby loop so I can match them I assume you know of String#encoding and __ENCODING__? ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] [ANN] MacRuby 0.7
On Oct 11, 2010, at 11:54 AM, Ryan Davis wrote: > I haven't tried using isolate on macruby yet, but let me know if you have any > issues. The tests segfault on 0.7 right now, I have a note to look at this before the next Isolate release. ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Strings Differ between Ruby and MacRuby?
> Is this a bug?
Kind of. It looks like MacRuby differs from Ruby 1.9(and 1.8) in that it does
not return ASCII-8BIT strings(or "byte" strings) from IO objects.
Encoding.default_external is set to UTF-8, where as in Ruby 1.9 it is set to
ASCII-8BIT. Encoding.default_internal is set to nil, which means
data sent to and received from an IO stream will leave and be received in a
UTF-8 encoded string.
> If I have to do a work around is there any way to tell what encodings are
> being seen by the Macruby loop so I can match them
Sure, some things you can try:
Encoding.default_external=
Encoding.default_internal=
(I explain below…)
IO#set_encoding
TCPSocket.new(…).set_encoding('external:internal')
'external' is the external encoding you want to interpret the IO stream in.
'internal' is the encoding you want data received from the string to be
transcoded to.
When you are writing to the socket, 'internal' must be transcoded to 'external'.
When you are reading from the socket, 'external' must be transcoded to
'internal'.
If 'internal' is nil, no transcoding takes place (unless the string is encoded
in an encoding that does not match the external encoding).
String#encode
If those options fail, you can fall back to String#encode.
a = TCPSocket.new(…)
a.write("stuff\r\n")
results = a.read.encode('ASCII-8BIT')
I hope this helps you,
Rob.
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] [ANN] MacRuby 0.7
+1 for Isolate, I use it every day at work Sent from my iPhone On Oct 11, 2010, at 12:56, John Barnette wrote: > On Oct 11, 2010, at 11:54 AM, Ryan Davis wrote: >> I haven't tried using isolate on macruby yet, but let me know if you have >> any issues. > > The tests segfault on 0.7 right now, I have a note to look at this before the > next Isolate release. > > ___ > 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] BridgeSupport Preview 1
Hi guys, As promised for a long time, we finally prepared a preview of the next BridgeSupport implementation we have been working on. This new implementation has significant differences versus the current one; the generator has been rewritten on top of clang/llvm. It now offers accurate metadata representation of APIs, and it's also a lot faster and more stable. Also, the project now covers all system frameworks (the previous release only covered selected ones) and new API constructs (such as C-level blocks). I updated the project's homepage and pushed the latest sources, that you can build yourself. http://bridgesupport.macosforge.org/trac/wiki However, since the new generator depends on the clang binaries, clang must be built as part of the build process, so it may take some time. Therefore, I prepared a binary installer here: http://www.macruby.org/files/BridgeSupport%20Preview%201.zip For MacRuby, you will need trunk, or tonight's nightly build, in order to use the new files. I intend to release 0.7.1 tomorrow (or later) which will include the necessary minor fixes. A well-known side effect of installing the new BridgeSupport release is that `framework 'Cocoa'' takes more time to execute, since many more dependent frameworks are covered. It takes a good second on my MacBook Pro, vs 0.3s before. We will address this problem in the upcoming release of MacRuby, by optimizing the BridgeSupport loader and maybe pre-compiling the files as binary forms. But eventually this problem won't exist with static compilation, since the BridgeSupport metadata is then compiled into the binary and not loaded anymore at runtime. Laurent___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] macirb & awesome_print
Hi Brad, Could you paste your irbrc file? I suspect it contains more than requiring awesome_print, since Eloy was able to have it loaded separately. Thanks, Laurent On Oct 9, 2010, at 7:51 AM, Brad Hutchins wrote: > Any head way on macirb issue that I understand some others have also > experienced as well with awesome_print? > > localhost:~ Brad$ rvm macruby > localhost:~ Brad$ rvm list > > rvm rubies > >jruby-1.5.2 [ x86_64-java ] > => macruby-0.7 [ x86_64 ] >rbx-1.0.1-20100603 [ x86_64 ] >ruby-1.8.7-p302 [ x86_64 ] >ruby-1.9.2-p0 [ x86_64 ] > > localhost:~ Brad$ macirb > /Users/Brad/.irbrc:1:in `': uninitialized constant IRB::Irb (NameError) > from /usr/local/bin/macirb:13:in `block' > from /usr/local/bin/macirb:9:in `block' > from /usr/local/bin/macirb:3:in `' > localhost:~ Brad$ irb > /Users/Brad/.irbrc:1:in `': uninitialized constant IRB::Irb (NameError) > from > /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/bin/macirb:13:in > `block' > from > /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/bin/macirb:9:in `block' > from > /Library/Frameworks/MacRuby.framework/Versions/0.7/usr/bin/macirb:3:in > `' > > localhost:~ Brad$ gem list > > *** LOCAL GEMS *** > > awesome_print (0.2.1) > > > > > > ___ > 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] Strings Differ between Ruby and MacRuby?
Hi Guys, Thanks for your help. I am still running 1.8.6 on my machine so I guess it is time to upgrade so I don't chase my tail for too long. I am not familiar with the character encodings but I'm reading up on them now. Thanks for your help. Shaun ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
