<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;AkMAQn4_cCp7ImA9WhdSGU8.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172</id><updated>2011-07-29T03:34:03.048-05:00</updated><category term="RubyCocoa" /><category term="ruby" /><category term="cocoa" /><category term="gsoc" /><category term="MacRuby" /><category term="ADC" /><category term="SSH" /><category term="TextMate" /><category term="Mac OS X" /><category term="Lucecita" /><category term="FreeBSD" /><category term="code" /><category term="blogger.tmbundle" /><category term="laptop $" /><category term="RoRGate" /><category term="screencast" /><category term="MacPorts" /><title>Ruby Xocolatl</title><subtitle type="html">Ruby, Cocoa, Mac OS X and things of my not so exciting life.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://xocoruby.blogspot.com/" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/RubyXocolatl" /><feedburner:info uri="rubyxocolatl" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;A0ABSHc6eyp7ImA9Wx5TEEo.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-1131911132459255897</id><published>2010-04-25T23:41:00.004-05:00</published><updated>2010-07-25T12:42:39.913-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-25T12:42:39.913-05:00</app:edited><title>HFS+ and Unicode madness</title><content type="html">&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;&lt;strong&gt;This is an old post that I wrote some while ago, but never published it. It is here just for historical|nostalgic|unburdening reasons. Original post begins here:&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Annoying scenario:&lt;/p&gt;&lt;p&gt;A file with unicode characters in its filename: Pétalo.java&lt;/p&gt;&lt;br /&gt;
&lt;script src="http://gist.github.com/489706.js?file=gistfile1.txt"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span id='fullpost'&gt;  &lt;p&gt;Why? That’s easy, because Mac OS X java wants everything with MacRoman encoding (&lt;span class='caps'&gt;WTF&lt;/span&gt;??). Then I tried with the -encoding flag and tab-autocompletion for the filename:&lt;/p&gt;&lt;br /&gt;
&lt;script src="http://gist.github.com/489709.js?file=gistfile1.txt"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;That is not good. When using autocompletion the filename is represented in &lt;span class='caps'&gt;NFD&lt;/span&gt; or Normalization Form Canonical Decomposition (é =&amp;gt; 65 cc81) but the class name in the file uses &lt;span class='caps'&gt;NFC&lt;/span&gt; or Normalization Form Canonical Composition (é =&amp;gt; c3a9). What a mess! Do you see the difference?:&lt;/p&gt;&lt;script src="http://gist.github.com/489712.js?file=gistfile1.txt"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;p&gt;You can’t see the difference until you see the actual bytes of the string, and that’s why Apple tries to protect us by storing everything in the Filesystem with the same representation: &lt;span class='caps'&gt;NFD&lt;/span&gt;. The first echo was done with autocompletion while the latter was typed directly with the keyboard. So if I compile the java sourcecode by fully typing the filename, it succeeds.&lt;/p&gt;&lt;h3&gt;¿What about version control?&lt;/h3&gt;&lt;p&gt;Then, this leads to a major problem. When someone in the world (including you and me) creates a file, he types its name with the keyboard, which as I have showed, it gives &lt;span class='caps'&gt;NFC&lt;/span&gt; in Mac OS X. But with &lt;span class='caps'&gt;HFS&lt;/span&gt;, the file is stored using &lt;span class='caps'&gt;NFD&lt;/span&gt; and if you clone a git repo created in another OS you’ll see that you have untracked files without modifying anything!!&lt;/p&gt;&lt;h3&gt;&lt;span class='caps'&gt;UFS&lt;/span&gt; to the rescue (kind of…)&lt;/h3&gt;&lt;p&gt;Maybe you could say “well, just use another filesystem”, and I’ve done that, but it seems that Apple uses it’s decomposition algorithms everywhere.&lt;/p&gt;&lt;p&gt;First I tried &lt;span class='caps'&gt;ZFS&lt;/span&gt; as I thought “That FS should work correctly in &lt;span class='caps'&gt;OSX&lt;/span&gt;, they can’t spoil it”. But I installed the read-write implementation from MacOS Forge and it did the same stupid conversion (&lt;span class='caps'&gt;UPDATE&lt;/span&gt;: &lt;span class='caps'&gt;ZFS&lt;/span&gt; is discontinued in MacOS Forge :( ).&lt;/p&gt;&lt;p&gt;&lt;span class='caps'&gt;FAT&lt;/span&gt; is a no-no since it only accepts &lt;span class='caps'&gt;ASCII&lt;/span&gt; characters for the filename and I don’t want to start a remote server nor a Virtual Machine every time I have to work with those files. This should work with my beloved OS!! And in fact, I have successfully made everything I’ve needed to work in Mac OS, until now :(.&lt;/p&gt;&lt;p&gt;So I needed to try &lt;span class='caps'&gt;UFS&lt;/span&gt;, I looked at DiskUtility, but it doesn’t support &lt;span class='caps'&gt;UFS&lt;/span&gt; and newfs fails to format my external &lt;span class='caps'&gt;USB&lt;/span&gt; disk.&lt;/p&gt;&lt;p&gt;But since I used hdiutil to create Pallet’s dmg, I thought of havin a &lt;span class='caps'&gt;UFS&lt;/span&gt; diskimage and guess what, you can!! This is the magic command:&lt;/p&gt;&lt;script src="http://gist.github.com/489715.js?file=gistfile1.txt"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;p&gt;Now I can mount my dmg, compile and use git!!&lt;/p&gt;&lt;p&gt;But still there are two little problems:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Snow Leopard doesn’t support &lt;span class='caps'&gt;UFS&lt;/span&gt;. I can’t even mount my &lt;span class='caps'&gt;UFS&lt;/span&gt; disk image :(&lt;/li&gt;
&lt;li&gt;Every app that uses Cocoa to open files can’t read files with &lt;span class='caps'&gt;NFC&lt;/span&gt; filenames. This means “forget about TextMate”. Noooooooo!!&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Update&lt;/h3&gt;&lt;p&gt;Now I’ve updated to Snow Leopard and is very disappointing and sad that I have to use a virtual machine to do my job.&lt;/p&gt;&lt;p&gt;The good thing is that I can work with TextMate via ssh and MacFusion.&lt;/p&gt;&lt;p&gt;Bad things: MacOS X can solve my problem, I can’t open files with &lt;span class='caps'&gt;NFC&lt;/span&gt; names in TextMate (but emacs.app still loves me) and although it seems there are some people working with File Systems at Apple I think this won’t be solved anytime soon.&lt;/p&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-1131911132459255897?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0tgAYYYYmj076t4A_x-dqZnHEFs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0tgAYYYYmj076t4A_x-dqZnHEFs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0tgAYYYYmj076t4A_x-dqZnHEFs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0tgAYYYYmj076t4A_x-dqZnHEFs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/BNmi0AdSOM4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/1131911132459255897/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=1131911132459255897" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/1131911132459255897?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/1131911132459255897?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/BNmi0AdSOM4/this-is-old-post-that-i-wrote-some.html" title="HFS+ and Unicode madness" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>0</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2010/04/this-is-old-post-that-i-wrote-some.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4HQXY4fyp7ImA9WxJVFEo.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-2910141067643300330</id><published>2009-07-01T14:48:00.004-05:00</published><updated>2009-07-01T15:08:50.837-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-01T15:08:50.837-05:00</app:edited><title>One week till Midterm evaluation!</title><content type="html">&lt;p&gt;I've been very busy in the last month and I haven't had the time to post here.&lt;/p&gt; 

&lt;p&gt;I love to learn new things and sometimes that's the reason I don't have enough time. I'm learning Cocoa, Objective-C and Tcl (just a little) and If if you think that's enough, read this: I can now watch the WWDC sessions videos and learn even more!&lt;/p&gt;

&lt;p&gt;I should have been there and know all that by now, but the US Embassy in Mexico denied me a visa :( (beleive be! I'm not a "MOJADO"!! :) )&lt;/p&gt;

&lt;p&gt;So, for anyone wondering how does the MacPorts GUI application I'm working on looks like now here it is a little screenshot (click it to see it bigger):&lt;/p&gt;

&lt;a href="http://content.screencast.com/users/juanger/folders/Jing/media/c35f7ed9-876d-4acb-ab87-7c1b8f958ab2/00000001.png"&gt;&lt;img class="embeddedObject" src="http://content.screencast.com/users/juanger/folders/Jing/media/c35f7ed9-876d-4acb-ab87-7c1b8f958ab2/00000001.png" width="300" border="0" /&gt;&lt;/a&gt;


&lt;p&gt;There's still a lot of work to be done (including some major changes in how the MacPorts framework sends notifications) but I hope to be releasing a usable app after the midterm week. I also made a weekly list of tasks and published here: &lt;a href="http://juanger.heroku.com/gsoc-09"&gt;Tasks&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Till then!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-2910141067643300330?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ppDMEVKxEeTUAdiBljpXjQzESOk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ppDMEVKxEeTUAdiBljpXjQzESOk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ppDMEVKxEeTUAdiBljpXjQzESOk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ppDMEVKxEeTUAdiBljpXjQzESOk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/c42-GOQxJ_Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/2910141067643300330/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=2910141067643300330" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2910141067643300330?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2910141067643300330?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/c42-GOQxJ_Y/one-week-till-midterm-evaluation.html" title="One week till Midterm evaluation!" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>0</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2009/07/one-week-till-midterm-evaluation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQEQH46fCp7ImA9WxJSEUQ.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-125407625839735883</id><published>2009-04-24T13:18:00.003-05:00</published><updated>2009-05-01T10:55:01.014-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-01T10:55:01.014-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MacPorts" /><category scheme="http://www.blogger.com/atom/ns#" term="gsoc" /><title>Accepted into GSoC!</title><content type="html">&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

 &lt;p&gt;This year my luck changed (well, maybe what changed was that my application was better than last year’s :)) and I’ve been accepted to work for the MacPorts project. I wanted to collaborate with MacPorts since some time ago and this is a very good chance to begin helping.&lt;/p&gt;
&lt;p&gt;I’ll be implementing the Cocoa &lt;span class='caps'&gt;GUI&lt;/span&gt; of MacPorts using the framework developed by Randall Wood and George Armah. Before sending my proposal, I began coding a sample application (&lt;a href='http://juanger.googlepages.com/Porton-app.zip'&gt;Porton.app&lt;/a&gt;, it only works on intel-Leopard) and I’d love to hear or read any comment and suggestion to improve the &lt;span class='caps'&gt;GUI&lt;/span&gt; and thus, I’ll do some releases for testing purposes for the community as the app gets implemented.&lt;/p&gt;
&lt;p&gt;To all the accepted students: Congrats and good luck in your projects!!&lt;/p&gt;
&lt;p&gt;To everyone that was rejected: :( I know how you feel, last year I wasn’t accepted and what bugged me the most was that who was selected didn’t made a good work in the project that I applied for and as I focused in my school courses, I didn’t help either. All I can say now is that I’ll do my best so that if you applied for the same project as me, you won’t feel as I felt last year and that I’ll do my best to help the MacPorts community.&lt;/p&gt;

&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-125407625839735883?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Amjb4nEXXM-o3_ruLblYaMR_B-o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Amjb4nEXXM-o3_ruLblYaMR_B-o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Amjb4nEXXM-o3_ruLblYaMR_B-o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Amjb4nEXXM-o3_ruLblYaMR_B-o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/7eqqPRzz49Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/125407625839735883/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=125407625839735883" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/125407625839735883?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/125407625839735883?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/7eqqPRzz49Y/accepted-into-gsoc.html" title="Accepted into GSoC!" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>0</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2009/04/accepted-into-gsoc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYCRXYzeCp7ImA9WxVSGE4.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-2517119672730080960</id><published>2009-01-13T03:16:00.001-06:00</published><updated>2009-01-13T03:16:04.880-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-13T03:16:04.880-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="TextMate" /><category scheme="http://www.blogger.com/atom/ns#" term="blogger.tmbundle" /><title>Blogger Bundle for TextMate</title><content type="html">
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;
&lt;p&gt;Yes, that’s right, I’ve been working in getting TextMate to love Blogger. Some time ago I realized that the Blogger &lt;span class='caps'&gt;API&lt;/span&gt; is no longer compatible with the TextMate’s blogging bundle and I really wanted it to work.&lt;/p&gt;
&lt;p&gt;It’s still in a very incomplete state, but at least I can post to my blog from my favourite text editing program, preview my post and add categories to it.&lt;/p&gt;
&lt;p&gt;Now I can have a “blogged from TextMate” badge in blogger!!&lt;/p&gt;
&lt;p&gt;You can download the bundle from github: &lt;a href='http://github.com/juanger/blogger.tmbundle'&gt;blogger.tmbundle&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The extended post also works (if you have the hack for it):&lt;/p&gt;
&lt;span id='fullpost'&gt;
 &lt;h3&gt;Setup&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;Make sure you have the GData, hpricot and RedCloth gems&lt;/li&gt;
	&lt;li&gt;You must set the GDATA_USER variable in TextMate:Preferences:Advanced:Shell Variables&lt;/li&gt;
	&lt;li&gt;Open a Post file from Blogger template&lt;/li&gt;
	&lt;li&gt;Use the publish command, select your blog and type any categories you want in the "Categories "token field.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The template is identical to the ones in the blogging bundle. All you have to do is write the title, the contents and call the Publish command, your password can be saved in the keychain and you’ll be able to see your post after publish it.&lt;/p&gt;
&lt;p&gt;I’m waiting for comments, suggestions, errors you encounter and why not, collaboration :)&lt;/p&gt;
&lt;p&gt;Happy blogging and new year.&lt;/p&gt;
 &lt;/span&gt;
    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-2517119672730080960?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FrmjGh1ErEBShqxpCcIv_w4iVa0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FrmjGh1ErEBShqxpCcIv_w4iVa0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FrmjGh1ErEBShqxpCcIv_w4iVa0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FrmjGh1ErEBShqxpCcIv_w4iVa0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/1JEq8k7VeQ0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/2517119672730080960/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=2517119672730080960" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2517119672730080960?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2517119672730080960?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/1JEq8k7VeQ0/blogger-bundle-for-textmate_13.html" title="Blogger Bundle for TextMate" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>2</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2009/01/blogger-bundle-for-textmate_13.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMMR388eCp7ImA9Wx5TEEU.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-1599317408975636663</id><published>2008-11-12T19:56:00.007-06:00</published><updated>2010-07-25T12:54:46.170-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-25T12:54:46.170-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="MacRuby" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><category scheme="http://www.blogger.com/atom/ns#" term="cocoa" /><category scheme="http://www.blogger.com/atom/ns#" term="screencast" /><category scheme="http://www.blogger.com/atom/ns#" term="RubyCocoa" /><title>Screencast with RubyCocoa</title><content type="html">&lt;p&gt;I know I promised a screencast about Lucecita, but that will be in the Holydays, now I post a little code that captures the screen and creates a video.&lt;/p&gt;&lt;p&gt;The not so good thing is that the frame rate isn't controlled by my code and it is very slow, but maybe with MacRuby and some threads we could make that code very fast and even parallelize the capturing and the creation of the movie (the other option is to use Objective-C) but MacRuby is under development and it doesn't have all the things we need.&lt;/p&gt;&lt;p&gt;What do you think? Can we improve it with a ruby/cocoa hack?&lt;/p&gt;&lt;p&gt;Leave any idea or comment, the code is in the full post:&lt;/p&gt;&lt;span id="fullpost"&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;script src="http://gist.github.com/489722.js"&gt; &lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-1599317408975636663?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vjd9p0hTa9fLyeq_kAmWDefSeOg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vjd9p0hTa9fLyeq_kAmWDefSeOg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vjd9p0hTa9fLyeq_kAmWDefSeOg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vjd9p0hTa9fLyeq_kAmWDefSeOg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/HBWM99JFfzE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/1599317408975636663/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=1599317408975636663" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/1599317408975636663?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/1599317408975636663?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/HBWM99JFfzE/screencast-with-rubycocoa.html" title="Screencast with RubyCocoa" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>0</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/11/screencast-with-rubycocoa.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcNR346fCp7ImA9WxRVFU4.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-4082948013337769191</id><published>2008-11-10T20:14:00.003-06:00</published><updated>2008-11-12T17:21:36.014-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-12T17:21:36.014-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="laptop $" /><category scheme="http://www.blogger.com/atom/ns#" term="ADC" /><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X" /><title>ADC Student Member</title><content type="html">I should have a new laptop now but awful things happen, specially in economy. Projects get cancelled and in contrast to the Mexican Peso a lot of things gain value, making me poorer and poorer(as I live in Mexico). But not everything is a bad new.

Last week, my ADC Orientation Kit arrived, I bought it three weeks ago at the Apple Online Store Mexico but the bad thing is that I haven't received any response to all my e-mails in which I ask for directions to use my hardware discount.

The good and cool things are:
&lt;ul&gt;
&lt;li&gt;I have a new Leopard copy and it is said that they will send me some more and any major update (Snow Leopard???)&lt;/li&gt;
&lt;li&gt;The package is really like the one that was pictured at the online store (big and black). I expected only a brown box with things, but it's Apple...&lt;/li&gt;
&lt;li&gt;I can apply for the WWDC scholarship program :)&lt;/li&gt;
&lt;li&gt;I have a new t-shirt (black with the legend: icode). Again, it's Apple...&lt;/li&gt;
&lt;li&gt;I &lt;strike&gt;supposedly&lt;/strike&gt; have a discount at the Apple Online Store&lt;/li&gt;
&lt;/ul&gt;

The other thing that they send is the Monthly Developer DVD but it's not the big reason to get the membership, anything inside the DVD is downloadable from ADC site. 

Now the only remaining thing is to know how the Hardware Discount works in Mexico and peacefully wait for the Mexican Peso to gain some value...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-4082948013337769191?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/98A9X-yDVRM_FPdlKrIPLelj48U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/98A9X-yDVRM_FPdlKrIPLelj48U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/98A9X-yDVRM_FPdlKrIPLelj48U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/98A9X-yDVRM_FPdlKrIPLelj48U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/1J58GdQCBWs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/4082948013337769191/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=4082948013337769191" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/4082948013337769191?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/4082948013337769191?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/1J58GdQCBWs/adc-student-member.html" title="ADC Student Member" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>1</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/11/adc-student-member.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEAFQH85fip7ImA9WxRVFUk.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-9030006615498295356</id><published>2008-10-26T22:11:00.004-06:00</published><updated>2008-11-12T20:18:31.126-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-12T20:18:31.126-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Lucecita" /><category scheme="http://www.blogger.com/atom/ns#" term="RubyCocoa" /><title>Lucecita 2.0</title><content type="html">I've been very busy this months and I haven't prepared the screencast, but here is a little present, the new version of Lucecita:

&lt;a href="http://www.flickr.com/photos/juanger/2976552527/" title="Lucecita.app 2.0 by Juanger, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3235/2976552527_8a9defd15f_o.png" width="221" height="334" alt="Lucecita.app 2.0" /&gt;&lt;/a&gt;

All the source code is hosted in github at &lt;a href="http://github.com/juanger/lucecita"&gt;http://github.com/juanger/lucecita&lt;/a&gt; and the DMG is here: &lt;a href="http://github.com/juanger/lucecita/tree/master%2FLucecita.dmg?raw=true"&gt;Lucecita.dmg&lt;/a&gt;

It's a universal binary and only works in Leopard.

Enjoy it!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-9030006615498295356?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/w2b-Vfsk4d7FKcrtF2vaMfs9wLI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w2b-Vfsk4d7FKcrtF2vaMfs9wLI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/w2b-Vfsk4d7FKcrtF2vaMfs9wLI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w2b-Vfsk4d7FKcrtF2vaMfs9wLI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/EOV7ina1aSg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/9030006615498295356/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=9030006615498295356" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/9030006615498295356?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/9030006615498295356?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/EOV7ina1aSg/lucecita-20.html" title="Lucecita 2.0" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>1</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/10/lucecita-20.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8CRXc6eyp7ImA9WxVSGE4.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-2016768462174006488</id><published>2008-07-25T23:17:00.010-05:00</published><updated>2009-01-13T02:54:24.913-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-13T02:54:24.913-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="Lucecita" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><category scheme="http://www.blogger.com/atom/ns#" term="RubyCocoa" /><title>Lucecita: RubyCocoa example</title><content type="html">&lt;p&gt;&lt;span style="font-weight:bold;"&gt;UPDATE:&lt;/span&gt; Version 2.0 of Lucecita is out. &lt;a href="http://xocoruby.blogspot.com/2008/10/lucecita-20.html"&gt;Lucecita 2.0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are some applications like Mouseposé, OmniDazzle or RemoteBuddy that allow you to have a rally nice light effect with your mouse. But as I have stated before, I am a poor student :) and since  I am saving money to buy a new laptop(by the way, please support me with the ads and with donations!!) I have written a little app called "Lucecita". For the impatient: &lt;a href="http://juanger.googlepages.com/Lucecita.zip"&gt;Lucecita.app&lt;/a&gt;.&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_WeoTLD0cYR0/SIqywKYJFoI/AAAAAAAAAB0/SIHWBCG1acA/s1600-h/LucecitaInAction.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_WeoTLD0cYR0/SIqywKYJFoI/AAAAAAAAAB0/SIHWBCG1acA/s400/LucecitaInAction.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5227186858005960322" /&gt;&lt;/a&gt;

&lt;span id="fullpost"&gt;

&lt;h3&gt;DarkWindow.rb&lt;/h3&gt;

&lt;pre class="prettyprint"&gt;
require 'osx/cocoa'
include OSX

class DarkWindow &lt; NSWindow
  
  def initWithContentRect_styleMask_backing_defer(contentRect, aStyle, bufferingType, flag)
    result = super_initWithContentRect_styleMask_backing_defer(NSScreen.mainScreen.frame,
                  NSBorderlessWindowMask,
                  bufferingType,
                  flag)
    if result
      result.setBackgroundColor(NSColor.clearColor)
      result.setOpaque(false)
      result.setIgnoresMouseEvents(true)
      result.setLevel(NSScreenSaverWindowLevel)
      result.setCollectionBehavior(NSWindowCollectionBehaviorCanJoinAllSpaces)
    end
    
    result
  end

end
&lt;/pre&gt;

&lt;h3&gt;LightView.rb&lt;/h3&gt;

&lt;pre class="prettyprint"&gt;
require 'osx/cocoa'
include OSX

class LuzView &lt;  OSX::NSView

  attr_accessor :center, :rect, :radius, :transparency, :enabled

  def initialize
    @radius = 50
    @transparency = 0.5
    @enabled = false
  end

  def initWithFrame(frame)
    self.setNeedsDisplay true
    return self
  end

  def drawRect(rect)
    if @enabled
    NSGraphicsContext.currentContext.setCompositingOperation NSCompositeSourceOut
    context = NSGraphicsContext.currentContext.graphicsPort
    @center = NSEvent.mouseLocation
    CGContextSetRGBFillColor(context, 0.0, 0.0, 0.0, @transparency)
    CGContextFillRect(context, rect)
    
    drawLight
    end
  end
  
  def drawLight
    context = NSGraphicsContext.currentContext.graphicsPort
    NSColor.colorWithCalibratedRed_green_blue_alpha(1.0,1.0,1.0,0.0).set
    
    CGContextSetGrayStrokeColor(context, 0, 1)
    CGContextSetLineWidth(context, 0)

    @rect = NSRect.new(@center.x - @radius, @center.y - @radius, @radius*2, @radius*2)
    CGContextAddEllipseInRect(context, @rect)
    CGContextDrawPath(context, KCGPathFill)
  end

end
&lt;/pre&gt;

&lt;h3&gt;LightController.rb&lt;/h3&gt;

&lt;pre class="prettyprint"&gt;
require 'osx/cocoa'

class LuzController &lt; OSX::NSObject
  
  ib_outlets :luz_view
  ib_outlets :menu, :size, :size_lbl, :alpha, :alpha_lbl, :enabled
  
  def awakeFromNib
    activateStatusMenu()
    @callback = lambda { |p,t,e,r|
      if (t == KCGEventOtherMouseDown &amp;&amp;
        CGEventGetFlags(e) &amp; KCGEventFlagMaskControl == KCGEventFlagMaskControl)
        toggle(self)
        return
      end
      if @luz_view.enabled
        @luz_view.center = CGEventGetLocation(e)
        @luz_view.setNeedsDisplayInRect NSInsetRect(@luz_view.rect, -30, -30)
      end
      e 
    }
    start_tapping()
  end
  
  ib_action :change_alpha do |sender|
    @luz_view.transparency = @alpha.floatValue
    @alpha_lbl.setStringValue "#{(@alpha.floatValue*100).to_i}%"
    @luz_view.setNeedsDisplay true
  end
  
  ib_action :change_size do |sender|
    @luz_view.radius = @size.floatValue
    @size_lbl.setStringValue "#{(@size.intValue)}px"
    @luz_view.setNeedsDisplay true
  end
  
  ib_action :toggle do |sender|
    @luz_view.enabled = !@luz_view.enabled
    @enabled.setState(@luz_view.enabled ? 1 : 0)
    @luz_view.setNeedsDisplay true
  end
  
  def activateStatusMenu()
      statusItem = NSStatusBar.systemStatusBar.statusItemWithLength(NSVariableStatusItemLength)
      statusItem.retain
      icon = NSImage.alloc.initWithContentsOfFile("#{NSBundle.mainBundle.resourcePath}/Lucecita.png")
      statusItem.setImage icon
      statusItem.setHighlightMode true
      statusItem.setMenu @menu
  end
  
  def start_tapping
    eventMask = 167772384 # Magic Number: LeftMouseDragged MouseMoved RightMouseDragged OtherMouseDragged OtherMouseDown
    eventTap = CGEventTapCreate(KCGSessionEventTap, KCGHeadInsertEventTap,
                                0, eventMask, @callback, nil)
    eventSrc = CFMachPortCreateRunLoopSource(nil, eventTap, 0)
    CFRelease(eventTap)
    CFRunLoopAddSource(CFRunLoopGetCurrent(),  eventSrc, KCFRunLoopCommonModes)
    CFRelease(eventSrc)
  end

  def applicationShouldTerminate
    CFRunLoopRemoveSource(CFRunLoopGetCurrent(), mEventSrc, KCFRunLoopCommonModes)
  end
  
end
&lt;/pre&gt;

&lt;p&gt;And the application is here: &lt;a href="http://juanger.googlepages.com/Lucecita.zip"&gt;Lucecita.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can activate it with the menu or with ctrl-Button3Click or ctrl-Button4Click if you have a three button mouse or a Mighty Mouse.&lt;/p&gt;

&lt;p&gt;I am preparing a screencast to show yo how I coded it but that will be later, until then you can see inside the app package and check  the ruby code.&lt;/p&gt;

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-2016768462174006488?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TDP2i23557bIPA23XUfaqAB8m1c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TDP2i23557bIPA23XUfaqAB8m1c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TDP2i23557bIPA23XUfaqAB8m1c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TDP2i23557bIPA23XUfaqAB8m1c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/glQZ9xEtVIM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/2016768462174006488/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=2016768462174006488" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2016768462174006488?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2016768462174006488?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/glQZ9xEtVIM/lucecita-rubycocoa-example.html" title="Lucecita: RubyCocoa example" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://bp1.blogger.com/_WeoTLD0cYR0/SIqywKYJFoI/AAAAAAAAAB0/SIHWBCG1acA/s72-c/LucecitaInAction.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/07/lucecita-rubycocoa-example.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QHQnY-fip7ImA9WxdVEU8.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-2710679898836455089</id><published>2008-07-15T06:15:00.005-05:00</published><updated>2008-07-15T06:28:53.856-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-15T06:28:53.856-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="RoRGate" /><title>New features in RoRGate 3.0 beta</title><content type="html">&lt;div&gt;These are three new features in RoRGate 3.0:&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;div&gt;Pictures as icons:&lt;/div&gt;&lt;div style="text-align: center;"&gt;
&lt;/div&gt;&lt;div style="text-align: center;"&gt;
&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://github.com/juanger/rorgate/tree/master%2Fmeta%2Fimages%2F2008-07-15%2FRoRgate-0.3b.png?raw=true"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 500px;" src="http://github.com/juanger/rorgate/tree/master%2Fmeta%2Fimages%2F2008-07-15%2FRoRgate-0.3b.png?raw=true" border="0" alt="" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;Now you can use png and jpeg files as icons&lt;/div&gt;&lt;div style="text-align: center;"&gt;
&lt;/div&gt;&lt;div style="text-align: left;"&gt;Web Inspector:&lt;/div&gt;&lt;div style="text-align: left;"&gt;
&lt;/div&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 500px;" src="http://github.com/juanger/rorgate/tree/master%2Fmeta%2Fimages%2F2008-07-15%2FInspector.png?raw=true" border="0" alt="" /&gt;&lt;div&gt;&lt;div style="text-align: center;"&gt;The WebKit inspector can be accessed through a contextual menu.&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;div&gt;Preferences:&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_WeoTLD0cYR0/SHyI6ktdN2I/AAAAAAAAABs/5vgsElW1JyQ/s400/Preferences.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5223200207711057762" /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Now you can change the name, port and icon of an existing app.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-2710679898836455089?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zSJKofPWTASwdm2UAWOqrblSHzY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zSJKofPWTASwdm2UAWOqrblSHzY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zSJKofPWTASwdm2UAWOqrblSHzY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zSJKofPWTASwdm2UAWOqrblSHzY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/tadxDlPV8sY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/2710679898836455089/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=2710679898836455089" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2710679898836455089?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2710679898836455089?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/tadxDlPV8sY/new-features-in-rorgate-30-beta.html" title="New features in RoRGate 3.0 beta" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://bp1.blogger.com/_WeoTLD0cYR0/SHyI6ktdN2I/AAAAAAAAABs/5vgsElW1JyQ/s72-c/Preferences.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/07/new-features-in-rorgate-30-beta.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UDQns7eCp7ImA9WxdWF0g.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-2625059326613325959</id><published>2008-07-10T19:28:00.006-05:00</published><updated>2008-07-11T00:47:53.500-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-11T00:47:53.500-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="RoRGate" /><category scheme="http://www.blogger.com/atom/ns#" term="laptop $" /><category scheme="http://www.blogger.com/atom/ns#" term="RubyCocoa" /><title>Server Output in RoRGate</title><content type="html">I've added a developer menu to the resulting apps in RoRGate, if you download the 0.3 beta version you will see the change:

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://github.com/juanger/rorgate/tree/master%2Fmeta%2Fimages%2FRoRGate-0.3b.png?raw=true"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://github.com/juanger/rorgate/tree/master%2Fmeta%2Fimages%2FRoRGate-0.3b.png?raw=true" alt="" border="0" /&gt;&lt;/a&gt;
With that, you as developer can use it to see your app in action, see the server output and edit it in TextMate.

The only thing is that the server output works strange with 2.x rails apps, I don't know why, but only the error output is displayed in such rails apps. I use the NSTask class with an NSPipe for both the standart output and error but with rails 2.x it behaves strangely.

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://github.com/juanger/rorgate/tree/master%2Fmeta%2Fimages%2FServerOut.png?raw=true"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://github.com/juanger/rorgate/tree/master%2Fmeta%2Fimages%2FServerOut.png?raw=true" alt="" border="0" /&gt;&lt;/a&gt;
Also I've embedded RubyCococa, but I can't make it work in both Leopard and Tiger because of libffi.dylib. Leopard's RubyCocoa has it installed in /usr/lib and I don't know where it is in Tiger. Maybe the solution is to create a Tiger version and a Leopard version, but I'm very lazy and I'd rather have only one.

Lastly, I need a new laptop (many of my friends will agree) and because of that, I've added a donations pledgie badge for RoRGate and some ads here in my blog. I'm a student and I own an iBook G3 which has been giving me a lot of trouble lately, so as I'm most of the time at school (school's computers ain't good either) deploying to or developing for a lot of platforms I need a new one, one in which running a single unit test doesn't seem to last forever and I hope some of you(friends or not) could help me. My-new-laptop blogthon :) has begun.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-2625059326613325959?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1E7vHJEocSEBE3wxDVtOQK1qzyY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1E7vHJEocSEBE3wxDVtOQK1qzyY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1E7vHJEocSEBE3wxDVtOQK1qzyY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1E7vHJEocSEBE3wxDVtOQK1qzyY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/rF33mf-sEQE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/2625059326613325959/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=2625059326613325959" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2625059326613325959?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2625059326613325959?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/rF33mf-sEQE/server-output-in-rorgate.html" title="Server Output in RoRGate" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>2</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/07/server-output-in-rorgate.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEABSHw_eyp7ImA9WxRVFUk.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-8240804465731452603</id><published>2008-07-04T18:53:00.008-05:00</published><updated>2008-11-12T20:19:19.243-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-12T20:19:19.243-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="RoRGate" /><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X" /><category scheme="http://www.blogger.com/atom/ns#" term="RubyCocoa" /><title>RoRGate</title><content type="html">&lt;p&gt;A few days ago, &lt;a href="http://blog.jasoncrystal.com/?p=7"&gt;Jason Crystal wrote in his blog&lt;/a&gt; a way to package rails applications in a Mac OS X one and I commented that I've been developing an application called RoRGate to automate that with another process.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://github.com/juanger/rorgate/tree/master%2Fmeta%2Fimages%2FRoRGate-v0.2.png?raw=true"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 497px; height: 236px;" src="http://github.com/juanger/rorgate/tree/master%2Fmeta%2Fimages%2FRoRGate-v0.2.png?raw=true" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I'll be posting more news about it as I improve my implementation. Today I added the posibility to manage multiple windows in a Gate(the resulting OS X app). Also, the RoRGate-dev.dmg will be the unsable version with all the latest changes, so if want to try the newest features you'll have to download it and not the versioned one.&lt;/p&gt;&lt;p&gt;The DMGs will be hosted (by now) in:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://code.google.com/p/rorgate/"&gt;http://code.google.com/p/rorgate/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The source code in:&lt;/p&gt;&lt;p&gt;&lt;a href="http://github.com/juanger/rorgate/tree/master"&gt;http://github.com/juanger/rorgate/tree/master&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I'd appreciate if you can send me any errors or comments to improve it.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-8240804465731452603?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/O5T6Hb8b-0mSCdr7F6OAxo8aZZQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/O5T6Hb8b-0mSCdr7F6OAxo8aZZQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/O5T6Hb8b-0mSCdr7F6OAxo8aZZQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/O5T6Hb8b-0mSCdr7F6OAxo8aZZQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/QBoEn0cWoLE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/8240804465731452603/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=8240804465731452603" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/8240804465731452603?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/8240804465731452603?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/QBoEn0cWoLE/rorgate.html" title="RoRGate" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>2</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/07/rorgate.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEECRXwzfyp7ImA9WxRVFUk.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-2595109339901221843</id><published>2008-05-26T01:16:00.004-05:00</published><updated>2008-11-12T20:17:44.287-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-12T20:17:44.287-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="FreeBSD" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><title>FreeBSD startup script with ruby</title><content type="html">Since some days ago I've been using FreeBSD in a Rails deployment server configuring it to use Capistrano, nginx and mongrel but then I wanted my mongrel instances to be run at startup and what I found was this message:

 &lt;blockquote&gt;Put your .sh script at /usr/local/etc/rc.d&lt;/blockquote&gt;

And since I like ruby, I began to code my script with it and the problems came:

&lt;blockquote&gt;env: ruby: No such file or directory&lt;/blockquote&gt;
&lt;blockquote&gt;custom_require.rb:27: command not found: mongrel_rails&lt;/blockquote&gt;

First, here is my final code that was inspired by &lt;a href="http://snippets.dzone.com/posts/show/2594"&gt;Tim Morgan's&lt;/a&gt;:

&lt;pre class="prettyprint"&gt;
#!/usr/local/bin/ruby
 
puts ENV["PATH"] += ":/usr/local/bin"
app_dir = '/usr/local/www'

apps = [
  scielo_index = { :name =&gt; "ScieloIndex",
                   :path =&gt; 'index.scielo.unam.mx/current',
                   :config =&gt; "config/mongrel_cluster.yml",
                   :cluster =&gt; true },
                   
  redmine = { :name =&gt; "Redmine",
              :path =&gt; 'dev.scielo.unam.mx/Redmine',
              :config =&gt; "config/mongrel_8000.yml",
              :pid =&gt; "log/mongrel.pid" }
  ]
 
if ['stop', 'restart'].include? ARGV.first
  apps.each do |app|
    path = File.join app_dir, app[:path]
    puts "Stopping #{app[:name]}..."
    if app[:cluster]
      `mongrel_rails cluster::stop -C #{path}/#{app[:config]}`
    else
      `mongrel_rails stop -c #{path} -P #{app[:pid]}`
    end
  end
end
 
if ['start', 'restart'].include? ARGV.first
  apps.each do |app|
    path = File.join app_dir, app[:path]
    puts "Starting #{app[:name]}..."
    if app[:cluster]
      `mongrel_rails cluster::start -C #{path}/#{app[:config]}`
    else
      `mongrel_rails start -C #{path}/#{app[:config]}`
    end
  end
end
 
unless ['start', 'stop', 'restart'].include? ARGV.first
    puts "Usage: mongrel {start|stop|restart}"
    exit
end
&lt;/pre&gt;

The key part is the ENV["PATH"] setup, that line is needed as FreeBSD's PATH at startup is "/sbin:/bin:/usr/sbin:/usr/bin" and this also leads us to change the interpreter path from something like "#!/usr/bin/env ruby" to "#!/usr/local/bin/ruby", i.e. its full path.

That's all, now our ruby script really runs at startup time without complaining.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-2595109339901221843?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xAx9vye7_tGz4rVhpBfElndEpXc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xAx9vye7_tGz4rVhpBfElndEpXc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xAx9vye7_tGz4rVhpBfElndEpXc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xAx9vye7_tGz4rVhpBfElndEpXc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/avz5muSI5mI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/2595109339901221843/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=2595109339901221843" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2595109339901221843?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/2595109339901221843?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/avz5muSI5mI/freebsd-startup-script-with-ruby.html" title="FreeBSD startup script with ruby" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>0</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/05/freebsd-startup-script-with-ruby.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIESX0_cSp7ImA9WxdSF0U.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-6364509457060449211</id><published>2008-05-20T14:39:00.005-05:00</published><updated>2008-05-26T01:15:08.349-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-26T01:15:08.349-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SSH" /><category scheme="http://www.blogger.com/atom/ns#" term="TextMate" /><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X" /><title>TextMate, SSH and github</title><content type="html">&lt;a href="http://macromates.com/"&gt;TextMate&lt;/a&gt; is a flexible Mac OS X text editor, it has everything i need, but some days ago I found that it can't prompt me for my password when needed(like when I want to push my changes to github) and that's not cool.

Fortunately, github uses ssh keys and with &lt;a href="http://www.sshkeychain.org/"&gt;SSHKeychain&lt;/a&gt; installed you can forget about passwords and it helps TextMate to pull and push to github(or any other server) without pubkey authentication errors. Now that's cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-6364509457060449211?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YimaOa0lp2LkRoU-JEjBHJd9SRA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YimaOa0lp2LkRoU-JEjBHJd9SRA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YimaOa0lp2LkRoU-JEjBHJd9SRA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YimaOa0lp2LkRoU-JEjBHJd9SRA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/bazodcGanT4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/6364509457060449211/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=6364509457060449211" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/6364509457060449211?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/6364509457060449211?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/bazodcGanT4/textmate-ssh-and-github.html" title="TextMate, SSH and github" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>3</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/05/textmate-ssh-and-github.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEMRHg9eip7ImA9WxRVFUk.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-4569649436892504015</id><published>2008-05-15T18:50:00.008-05:00</published><updated>2008-11-12T20:18:05.662-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-12T20:18:05.662-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><title>RTranscoder: jpeg to mpeg</title><content type="html">Some days ago I made some tests using mencoder to create a mpeg4 video with some jpeg images.

Then I tried to use RTranscoder to achieve the same result with ruby but it's kind of tricky to get it running correctly, because you can get an "error parsing command line" error if you don't give RTranscoder the correct information.

After a lot of attempts, my code got like this:

&lt;pre class="prettyprint"&gt;
 MEncoder.encode do |mencoder|
   mencoder.input = "mf://*.jpg"
   mencoder.mf.fps = 25
   mencoder.mf.type = "jpg"
   mencoder.output_video_codec = :lavc
   mencoder.lavc.vcodec = "mpeg4"
   mencoder.lavc.mbd = 2
   mencoder.lavc.trell = true
   mencoder.output_audio_codec = 'copy'
  
   mencoder.output = 'output.avi'
 end
&lt;/pre&gt;

As you can see, instead of doing something like mencoder.mf = "fps=25:type=jpg" (my error) you have to do it with mencoder.mf.fps and mencoder.mf.type respectively, the same with lavc and everytime you need to pass an argument with suboptions separated by ":".

Here is the page of &lt;a href="http://rtranscoder.rubyforge.org/"&gt;Rtranscoder&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-4569649436892504015?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aBK_5jEvtmIREsuCOeXEK4ksx90/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aBK_5jEvtmIREsuCOeXEK4ksx90/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aBK_5jEvtmIREsuCOeXEK4ksx90/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aBK_5jEvtmIREsuCOeXEK4ksx90/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/7tUFd3p1nQY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/4569649436892504015/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=4569649436892504015" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/4569649436892504015?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/4569649436892504015?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/7tUFd3p1nQY/rtranscoder-jpeg-to-mpeg.html" title="RTranscoder: jpeg to mpeg" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>0</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/05/rtranscoder-jpeg-to-mpeg.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEADRHg_eCp7ImA9WxRVFUk.&quot;"><id>tag:blogger.com,1999:blog-3487530982824953172.post-3465931592105603951</id><published>2008-03-08T10:36:00.017-06:00</published><updated>2008-11-12T20:19:35.640-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-12T20:19:35.640-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="MacRuby" /><category scheme="http://www.blogger.com/atom/ns#" term="cocoa" /><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X" /><title>MacRuby</title><content type="html">&lt;div style="text-align: justify;"&gt;Some days ago I found the MacRuby project and it seems it will bring a lot of new things to ruby+cocoa programming. And as I've been reading and writing some RubyCocoa apps in the last months I want to share the joy it gave me.
&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;First of all, it will use the new YARV interpreter that was released with the 1.9 version of ruby last christmas which is faster than the so called MRV(the "M" is for Matz), also, it doesn't use the ruby garbage collector, but the cocoa one. This allows the programs to not stop while the garbage collector is running cause the cocoa garbage collector runs in another thread.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;Speaking of threads, another feature of the new ruby 1.9 is that it allows users to use POSIX threads(cool!). &lt;/div&gt;&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Another cool feature are named parameters are also useful when calling methods, the message style when calling an object's "method" of Objective-C looks like: &lt;/div&gt;
&lt;pre class="prettyprint"&gt;
NSAlert *alert = [NSAlert alertWithMessageText: @"What?",
   defaultButton: @"OK",
   alternateButton: @"Cancel",
   otherButton: nil,
   informativeTextWithFormat: @"I am an alert!"];
&lt;/pre&gt;
&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;And the MacRuby counterpart:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="prettyprint"&gt;
alert = NSAlert.alertWithMessageText("What?",
  defaultButton: "OK",
  alternateButton: "Cancel",
  otherButton: nil,
  informativeTextWithFormat: "I am an alert!")
&lt;/pre&gt;
&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Isn't that sexy?? No more big method names:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;pre class="prettyprint"&gt;
alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat
&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;The last beautiful thing I am going to comment about are ruby hashes inheriting from NSDictionary. That's cool because you can pass a ruby hash to methods that need an NSDictionary instead of constructing one in the cocoa way.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;The bad things: MacRuby is under development, it needs Leopard and only runs on Intel Macs. But looks promising.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3487530982824953172-3465931592105603951?l=xocoruby.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LTnYB9Hcgsl3578GknH4mnL3vls/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LTnYB9Hcgsl3578GknH4mnL3vls/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LTnYB9Hcgsl3578GknH4mnL3vls/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LTnYB9Hcgsl3578GknH4mnL3vls/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RubyXocolatl/~4/Htgsd42lJHI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xocoruby.blogspot.com/feeds/3465931592105603951/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3487530982824953172&amp;postID=3465931592105603951" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/3465931592105603951?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3487530982824953172/posts/default/3465931592105603951?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RubyXocolatl/~3/Htgsd42lJHI/macruby.html" title="MacRuby" /><author><name>Juanger</name><uri>http://www.blogger.com/profile/08641206610292799452</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_WeoTLD0cYR0/SaIKJ7Kx9ZI/AAAAAAAAADY/q470Voh9Urg/s1600-R/024d0e8cd6abab5eb888ec477544ab3a%3Fs%3D80%26r%3Dg" /></author><thr:total>0</thr:total><feedburner:origLink>http://xocoruby.blogspot.com/2008/03/macruby.html</feedburner:origLink></entry></feed>

