<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Random Hacks: Ruby-style metaprogramming in JavaScript (plus a port of RSpec)</title>
    <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Technology and Other Fun Stuff</description>
    <item>
      <title>"Ruby-style metaprogramming in JavaScript (plus a port of RSpec)" by Eric</title>
      <description>&lt;p&gt;meekish: Good question. :-) Now that I think about it, RSpec&amp;#8217;s choice of name is pretty good.&lt;/p&gt;


	&lt;p&gt;Nicolás: I&amp;#8217;m working to make &amp;#8216;def&amp;#8217; quite a bit less clunky, and to make this style of JavaScript programming as pleasant as possible.&lt;/p&gt;


	&lt;p&gt;There&amp;#8217;s some new stuff in Subversion, which will eventually appear as another blog post.&lt;/p&gt;</description>
      <pubDate>Thu, 26 Jul 2007 09:27:57 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:36c61bfc-d1b9-4e2a-b7f4-d2c4574ad4e0</guid>
      <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd#comment-482</link>
    </item>
    <item>
      <title>"Ruby-style metaprogramming in JavaScript (plus a port of RSpec)" by meekish</title>
      <description>&lt;p&gt;I&amp;#8217;m curious why you chose the method name &amp;#8216;spec&amp;#8217; instead of &amp;#8216;describe&amp;#8217;?&lt;/p&gt;</description>
      <pubDate>Wed, 25 Jul 2007 23:21:22 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:d2df15d4-ea0c-4068-8534-1a0395649e1d</guid>
      <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd#comment-481</link>
    </item>
    <item>
      <title>"Ruby-style metaprogramming in JavaScript (plus a port of RSpec)" by Eric</title>
      <description>&lt;p&gt;Please feel free to use my RSpec clone in other projects. It should play nicely with Prototype, and if it doesn&amp;#8217;t, I&amp;#8217;ll be happy to fix it.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m also quite happy to fill in many of the missing features. Just let me know what you need!&lt;/p&gt;</description>
      <pubDate>Wed, 04 Jul 2007 19:19:10 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:8aab0ff8-c985-4272-8b16-698c6dadec26</guid>
      <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd#comment-480</link>
    </item>
    <item>
      <title>"Ruby-style metaprogramming in JavaScript (plus a port of RSpec)" by Nicolás Sanguinetti</title>
      <description>&lt;p&gt;Gahh, bad copy pasting while editing the comment and an unfortunate click on submit instead of preview (preview should be automatic! or farther away from the submit button!)&lt;/p&gt;</description>
      <pubDate>Tue, 03 Jul 2007 11:59:35 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:94d0a5b5-6728-4c70-a75f-29a146c44f62</guid>
      <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd#comment-479</link>
    </item>
    <item>
      <title>"Ruby-style metaprogramming in JavaScript (plus a port of RSpec)" by Nicolás Sanguinetti</title>
      <description>&lt;p&gt;I&amp;#8217;m not really sure about the &amp;#8216;def&amp;#8217; to construct classes (although it&amp;#8217;s a nice way of adding stuff dynamically, it seems clunky to do that when defining the class).&lt;/p&gt;


	&lt;p&gt;Other than thatHeh, great stuff! Specially since I was looking to port rspec to javascript :)&lt;/p&gt;


	&lt;p&gt;As for the spec component, seems nice, I&amp;#8217;ll have a closer look at the source and comment on it :)&lt;/p&gt;


	&lt;p&gt;Have a look at &lt;a href="http://code.google.com/p/active-support-for-javascript" rel="nofollow"&gt;ActiveSupport for JavaScript&lt;/a&gt; . It&amp;#8217;s a library I&amp;#8217;ve uploaded yesterday to port a lot of Ruby&amp;#8217;s syntactic sugar to javascript (some of core Ruby, a lot of ActiveSupport).&lt;/p&gt;


	&lt;p&gt;It works on top of Prototype to add all the magic (only trunk, for now, you need &lt;code&gt;Function.prototype.curry&lt;/code&gt; and &lt;code&gt;Function.prototype.methodize&lt;/code&gt; for a few aliases and shortcuts).&lt;/p&gt;


	&lt;p&gt;I intended to write a rspec-clone in JS to test my ActiveSupport (I find the one on script.aculo.us a bit over-restrictive), but might end using yours ;)&lt;/p&gt;</description>
      <pubDate>Tue, 03 Jul 2007 11:55:24 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:588bd1a1-1a39-43f1-9297-bd4589de79c4</guid>
      <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd#comment-478</link>
    </item>
    <item>
      <title>"Ruby-style metaprogramming in JavaScript (plus a port of RSpec)" by Eric</title>
      <description>&lt;p&gt;I&amp;#8217;m glad to hear that you&amp;#8217;ll be working on TrimPath again! I&amp;#8217;ll be watching your work closely, and looking for opportunities for cross-pollination.&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jul 2007 17:26:51 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:b51bf799-dc13-4a96-9b05-ef644c9a4558</guid>
      <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd#comment-477</link>
    </item>
    <item>
      <title>"Ruby-style metaprogramming in JavaScript (plus a port of RSpec)" by Steve Yen</title>
      <description>&lt;p&gt;I&amp;#8217;ve been recently defrosting the TrimPath codebase, all because of Google Gears which finally gives us a true &lt;span class="caps"&gt;RDBMS&lt;/span&gt; on the client side.  I hope to have an updated TrimPath library out soon.&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jul 2007 12:19:58 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:2a9a9303-3413-4382-b440-16e8d4b80069</guid>
      <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd#comment-475</link>
    </item>
    <item>
      <title>"Ruby-style metaprogramming in JavaScript (plus a port of RSpec)" by Eric</title>
      <description>&lt;p&gt;Thanks for the link! RubyJS is an interesting approach. It does all the metaprogramming in Ruby, than introspects the result and compiles it down to JavaScript. Given what I know about the innards the Ruby interpreter, that sounds pretty painful. :-)&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m hoping that a native JavaScript approach will reduce download size. But I&amp;#8217;ll keep an eye on RubyJS!&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jul 2007 07:34:15 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:adef6189-0edb-4433-a94d-faf7c8e7a38d</guid>
      <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd#comment-474</link>
    </item>
    <item>
      <title>"Ruby-style metaprogramming in JavaScript (plus a port of RSpec)" by Michael Neumann</title>
      <description>&lt;p&gt;While I share everything you say about Javascript, I&amp;#8217;m going a different route. Translating Ruby code into Javascript code automatically using &lt;a href="http://blog.ntecs.de/articles/2007/01/08/rubyjs-javascript-no-thank-you" rel="nofollow"&gt;RubyJS&lt;/a&gt;. All top-level meta-programming tricks that are available in Ruby can be abused&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jul 2007 04:54:25 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:5558195b-7eb3-4bb3-a878-59a5178fea52</guid>
      <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd#comment-473</link>
    </item>
    <item>
      <title>Ruby-style metaprogramming in JavaScript (plus a port of RSpec)</title>
      <description>&lt;p&gt;Programming in Ruby makes me happy.  It&amp;#8217;s a lovable language, with a
pleasantly quirky syntax and lots of expressive power.&lt;/p&gt;

&lt;p&gt;Programming in JavaScript, on the other hand, frustrates me to no end.
JavaScript &lt;i&gt;could&lt;/i&gt; be a reasonable language, but it has all sorts of
ugly corner cases, and it forces me to roll everything from scratch.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve been trying to make JavaScript a bit more like Ruby.  In particular, I
want to support Ruby-style metaprogramming in JavaScript.  This would make it possible to port over many advanced Ruby libraries.&lt;/p&gt;

&lt;p&gt;You can
check out the &lt;a href="http://www.randomhacks.net/svn/planetary/tags/0.1.0/spec_checker.html"&gt;interactive specification&lt;/a&gt;, or look at some examples
below.  If the &lt;a href="http://www.randomhacks.net/svn/planetary/tags/0.1.0/spec_checker.html"&gt;specification&lt;/a&gt; gives you any errors, please post them in the comment
thread, and let me know what browser you&amp;#8217;re running!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd"&gt;Read More&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 01 Jul 2007 19:00:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:421e0747-a145-4fc3-b0f1-8a5323eaea01</guid>
      <author>Eric Kidd</author>
      <link>http://www.randomhacks.net/articles/2007/07/01/ruby-metaprogramming-javascript-rspec-bdd</link>
      <category>Ruby</category>
      <category>JavaScript</category>
      <category>Macros</category>
      <category>Planetary</category>
      <trackback:ping>http://www.randomhacks.net/articles/trackback/472</trackback:ping>
    </item>
  </channel>
</rss>
