From alex at pivotallabs.com Sun May 3 15:07:19 2009 From: alex at pivotallabs.com (Alex Chaffee) Date: Sun, 3 May 2009 12:07:19 -0700 Subject: [Erector-devel] Erector + Merb? In-Reply-To: <7a93bd340905031132l71175cd8g35ba342bcb130340@mail.gmail.com> References: <7a93bd340905031132l71175cd8g35ba342bcb130340@mail.gmail.com> Message-ID: <7a93bd340905031207r63287070m9819cb084d1dbab1@mail.gmail.com> Got a tweet asking if Erector supports Merb. I've never Merbed so I can't answer... Anyone else know? And if not, what's needed to make it seamless? --- Alex Chaffee - alex at stinky.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com From alexch at gmail.com Sun May 3 15:19:11 2009 From: alexch at gmail.com (Alex Chaffee) Date: Sun, 3 May 2009 12:19:11 -0700 Subject: [Erector-devel] Updated docs for new API Message-ID: <7a93bd340905031219w626a006arb899e55fb2e62c89@mail.gmail.com> I updated the docs to reflect the new "content" and "needs" methods. It's on my branch?git at github.com:alexch/erector.git and it should be ready to integrate and publish. I definitely need someone else to code review it first, though, since I've been working without a pair. Right now I've got a failing spec because I can't figure out the metamagic to allow a subclass to look at class variables of its superclass. I'll figure it out someday... --- Alex Chaffee - alex at stinky.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com From alex at pivotallabs.com Sun May 3 15:22:21 2009 From: alex at pivotallabs.com (Alex Chaffee) Date: Sun, 3 May 2009 12:22:21 -0700 Subject: [Erector-devel] Fwd: We all have needs In-Reply-To: <7a93bd340905011616i576ee220q82b8a27d4216bf34@mail.gmail.com> References: <7a93bd340905011616i576ee220q82b8a27d4216bf34@mail.gmail.com> Message-ID: <7a93bd340905031222t693119e7jc4f9e0f935dba798@mail.gmail.com> Resending because I didn't see this come across the archive... O_o ---------- Forwarded message ---------- From: Alex Chaffee Date: Fri, May 1, 2009 at 4:16 PM Subject: We all have needs To: erector-devel Hot off the presses, my first pass at "needs." It's on GitHub at git://github.com/alexch/erector.git for your enjoyment. Here's the rdoc: Class method by which?widget?classes can declare that they need certain parameters. If needed parameters are not passed in to?new, then an exception will be thrown (with a hopefully useful message about which parameters are missing). This is intended to catch silly bugs like passing in a parameter called ?name? to a?widget?that expects a parameter called ?title?. You can also declare default values for parameters using hash syntax. You can put?needs?declarations on multiple lines or on the same line; the only caveat is that if there are default values, they all have to be at the end of the line (so they go into the magic hash parameter). If a?widget?has no?needs?declaration then it will accept any combination of parameters (and make accessors for them) just like normal. If a?widget?wants to declare that it takes no parameters, use the special incantation "needs?nil" (and don?t declare any other needs, or kittens will cry). Usage: class FancyForm < Erector::Widget needs :title, :show_okay => true, :show_cancel => false ... end That means that FancyForm.new(:title => 'Login') will succeed, as will FancyForm.new(:title => 'Login', :show_cancel => true) but FancyForm.new(:name => 'Login') will fail. --- Alex Chaffee - alex at stinky.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com From alex at pivotallabs.com Sun May 3 16:25:29 2009 From: alex at pivotallabs.com (Alex Chaffee) Date: Sun, 3 May 2009 13:25:29 -0700 Subject: [Erector-devel] Erector mailing list is b0rked Message-ID: <7a93bd340905031325y5180d409i1fb6b953091b9958@mail.gmail.com> It seems like the Rubyforge-hosted erector-devel mailing list is silently (!!) rejecting messages sent from an unsubscribed email address or containing "rich text" attachments. I trust you agree this is unacceptable. I've poked around the mailman settings but can't see anything obvious to fix this (like an unchecked "don't be b0rked" box) but I'm not inclined to look much more deeply at this. Given that we're already using GitHub for VC and Tracker for issues, I see no problem in moving our mailing list to a system that has a sensible UI and a searchable archive. I've taken the liberty of creating a Google Group (called "erector", another bonus) and unless people object I'll move us over to there and resubscribe everyone who's on this list now. So... any objections? (Hopefully this message won't get swallowed too...) - A --- Alex Chaffee - alex at stinky.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com From sconover at gmail.com Sun May 3 16:32:12 2009 From: sconover at gmail.com (Steve Conover) Date: Sun, 3 May 2009 13:32:12 -0700 Subject: [Erector-devel] Erector mailing list is b0rked In-Reply-To: <7a93bd340905031325y5180d409i1fb6b953091b9958@mail.gmail.com> References: <7a93bd340905031325y5180d409i1fb6b953091b9958@mail.gmail.com> Message-ID: Everything should start on google groups by default IMO... On Sun, May 3, 2009 at 1:25 PM, Alex Chaffee wrote: > It seems like the Rubyforge-hosted erector-devel mailing list is > silently (!!) rejecting messages sent from an unsubscribed email > address or containing "rich text" attachments. I trust you agree this > is unacceptable. I've poked around the mailman settings but can't see > anything obvious to fix this (like an unchecked "don't be b0rked" box) > but I'm not inclined to look much more deeply at this. > > Given that we're already using GitHub for VC and Tracker for issues, I > see no problem in moving our mailing list to a system that has a > sensible UI and a searchable archive. I've taken the liberty of > creating a Google Group (called "erector", another bonus) and unless > people object I'll move us over to there and resubscribe everyone > who's on this list now. > > So... any objections? (Hopefully this message won't get swallowed too...) > > ?- A > > --- > Alex Chaffee - alex at stinky.com > Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | > http://alexch.tumblr.com > _______________________________________________ > Erector-devel mailing list > Erector-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/erector-devel > From alex at pivotallabs.com Sun May 3 16:55:58 2009 From: alex at pivotallabs.com (Alex Chaffee) Date: Sun, 3 May 2009 13:55:58 -0700 Subject: [Erector-devel] Page base class In-Reply-To: <7a93bd340904291214m42db1e10gefd723cc14887cad@mail.gmail.com> References: <7a93bd340904291214m42db1e10gefd723cc14887cad@mail.gmail.com> Message-ID: <7a93bd340905031355q392afdecj2dda7768da979797@mail.gmail.com> Another one of my recent messages swallowed by Rubyforge... ---------- Forwarded message ---------- From: Alex Chaffee Date: Wed, Apr 29, 2009 at 12:14 PM Subject: Page base class To: erector-devel I extracted and cleaned up a Page object that I'm using in my current project. Please look at the code and tell me if you think this is useful. (I'm using the new API so the render method is now called content.) http://gist.github.com/103976 Does anyone else have a Page object they'd like to show off? I'd love to incorporate patterns others have found useful. >From the RDoc: Page?superclass. Allows for accumulation of?script?and?style?tags (see example below) with either external or inline?content. External references are ?uniq?d, so it?s a good idea to declare a?js?script?in all widgets that use it, so you don?t accidentally lose the?script?if you remove the one widget that happened to declare it. At minimum, child classes must override?body_content. You can also get a "quick and dirty" page by passing a block to Page.new but that doesn?t really buy you much. The?script?and?style?declarations are accumulated at class load time, This technique allows all widgets to add their own requirements to the page header without extra logic for declaring which pages include which nested widgets. Unfortunately, this means that every page in the application will share the same headers, which may lead to conflicts. If you want something to show up in the headers for just one page, override?head_content, call super, and emit it yourself. Example Usage: class MyPage < Page js "lib/jquery.js" script "$(document).ready(function(){...});" css "stuff.css" style "li.foo { color: red; }" def page_title "my app" end def body_content h1 "My App" p "welcome to my app" end end class WidgetWithCss < Erector::Widget Page.style "div.custom { border: 2px solid green; }" def content div :class => "custom" do text "green is good" end end end Thoughts: * It may be desirable to unify #js and #script, and #css and #style, and have the routine be smart enough to analyze its parameter to decide whether to add it to the list of external or inline references. From alex at pivotallabs.com Sun May 3 17:07:19 2009 From: alex at pivotallabs.com (Alex Chaffee) Date: Sun, 3 May 2009 14:07:19 -0700 Subject: [Erector-devel] Github Pages In-Reply-To: <1d7ddd110904191341q2e12690p3c3deea5ff977844@mail.gmail.com> References: <1d7ddd110904181437g451f6541kc07d8a39eb56e21a@mail.gmail.com> <7a93bd340904181500s7454e902l9f5d2e26b3d6d856@mail.gmail.com> <1d7ddd110904191341q2e12690p3c3deea5ff977844@mail.gmail.com> Message-ID: <7a93bd340905031407j3f3bf5afg546e4c828038e5ca@mail.gmail.com> OK, I've reread http://pages.github.com and I'm sold. Free web page hosting; deploy via "git push". What's not to like? The only possible problem is where to keep the .rb files? In the main project (so they stay in sync with updates in the API) or in the site project (so they stay in sync with the generated pages)? Probably the latter, which might entail putting a copy of erector inside the site repo... possibly using braid. --- Alex Chaffee - alex at stinky.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com On Sun, Apr 19, 2009 at 1:41 PM, Brian Takita wrote: > On Sat, Apr 18, 2009 at 3:00 PM, Alex Chaffee wrote: >> Can we keep using the existing documentation page objects (which are >> written in Erector and output HTML)? There's some logic in there for >> generating the navigation and faq index and stuff. > I don't see why not. It would require that the generated files go into > the erector.github.com project. > Perhaps we can use submodules or a clone that we manage (like rails) > in the erector project? >> >> I see something about Jekyll at http://pages.github.com/ but I don't >> really understand it yet. > I think Jekyll is a template system that enables the generation of > html files (like what you already did for Erector). >> >> --- >> Alex Chaffee - alex at stinky.com >> Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | >> http://alexch.tumblr.com >> >> >> >> On Sat, Apr 18, 2009 at 2:37 PM, Brian Takita wrote: >>> I propose that we create an Erector github project and use Github >>> Pages (http://erector.github.com) instead of using Rubyforge. >>> Their usage of Git to update the site is pretty slick. It would also >>> be much easier to administer than Rubyforge. >>> _______________________________________________ >>> Erector-devel mailing list >>> Erector-devel at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/erector-devel >>> >> > From alex at pivotallabs.com Tue May 5 11:02:21 2009 From: alex at pivotallabs.com (Alex Chaffee) Date: Tue, 5 May 2009 08:02:21 -0700 Subject: [Erector-devel] More Needs Message-ID: <7a93bd340905050802o10c7b01bsaff500d1a33f40ba@mail.gmail.com> Jeff and I paired yesterday to work on his RailsConf talk. We're doing it based on the new API so we'd like to do a release today or tomorrow if at all possible. Who knows how to do this? Is the gem on Github or Rubyforge or what? One of his terrorist demands was that we change the semantics of the "assigns" variables as follows: Before: all variables passed in via "assigns" get "attr_reader" accessors After: all and only variables declared in 'needs' get "attr_reader" accessors The previous way was hella confusing when you had a variable named, e.g. "title", which would define "def title; @title; end", which would mess with the existing "title" element emitter method. I made that change on my fork just now. Should we possibly go even further? And, say, throw an exception if you try to 'need' any variable whose name would overwrite an existing method? - A P.S. He also made me promise to rename 'erect' to 'erector' so he could talk about the tool (ahem) without blushing. I'll do that after I update History.txt for proper release notery. --- Alex Chaffee - alex at stinky.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com From alex at pivotallabs.com Tue May 5 11:28:44 2009 From: alex at pivotallabs.com (Alex Chaffee) Date: Tue, 5 May 2009 08:28:44 -0700 Subject: [Erector-devel] More Needs In-Reply-To: <7a93bd340905050802o10c7b01bsaff500d1a33f40ba@mail.gmail.com> References: <7a93bd340905050802o10c7b01bsaff500d1a33f40ba@mail.gmail.com> Message-ID: <7a93bd340905050828n8623506v192aedde52c124d0@mail.gmail.com> On Tue, May 5, 2009 at 8:02 AM, Alex Chaffee wrote: > Jeff and I paired yesterday to work on his RailsConf talk. We're doing > it based on the new API so we'd like to do a release today or tomorrow > if at all possible. Who knows how to do this? Is the gem on Github or > Rubyforge or what? Looks like the gem is still on Rubyforge. I just did a dry run and it looks like I can push a release to Rubyforge via my alexch/erector fork (since I'm still not a committer on the pivotal fork). So I guess we're good to go. I'll push release 0.6.0 today or tomorrow, and Jeff and I will make a corresponding blog post. Pivots (and C5s), please announce at standup(s) that this is imminent. Don't want to take anyone by surprise. - A From alex at pivotallabs.com Tue May 5 11:39:57 2009 From: alex at pivotallabs.com (Alex Chaffee) Date: Tue, 5 May 2009 08:39:57 -0700 Subject: [Erector-devel] More Needs In-Reply-To: <7a93bd340905050828n8623506v192aedde52c124d0@mail.gmail.com> References: <7a93bd340905050802o10c7b01bsaff500d1a33f40ba@mail.gmail.com> <7a93bd340905050828n8623506v192aedde52c124d0@mail.gmail.com> Message-ID: <7a93bd340905050839k3fd8a6abje6a9479f2fa43da0@mail.gmail.com> Actually wait, now it looks like the gem's on Github after all. Jeweler? erector.gemspec? class Alex needs :takita end --- Alex Chaffee - alex at stinky.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com On Tue, May 5, 2009 at 8:28 AM, Alex Chaffee wrote: > On Tue, May 5, 2009 at 8:02 AM, Alex Chaffee wrote: >> Jeff and I paired yesterday to work on his RailsConf talk. We're doing >> it based on the new API so we'd like to do a release today or tomorrow >> if at all possible. Who knows how to do this? Is the gem on Github or >> Rubyforge or what? > > Looks like the gem is still on Rubyforge. I just did a dry run and it > looks like I can push a release to Rubyforge via my alexch/erector > fork (since I'm still not a committer on the pivotal fork). So I guess > we're good to go. I'll push release 0.6.0 today or tomorrow, and Jeff > and I will make a corresponding blog post. > > Pivots (and C5s), please announce at standup(s) that this is imminent. > Don't want to take anyone by surprise. > > ?- A > From alex at pivotallabs.com Tue May 5 12:46:45 2009 From: alex at pivotallabs.com (Alex Chaffee) Date: Tue, 5 May 2009 09:46:45 -0700 Subject: [Erector-devel] DHH Message-ID: <7a93bd340905050946l3edba397kcdfe7eb1baef5c37@mail.gmail.com> I'm at RailsConf keynote... DHH is saying how awesome it is that Rails 3 ERB is going to emit html-escaped strings by default, and have a "raw" method and a way to tag strings as "html safe". Now where have I heard that before? --- Alex Chaffee - alex at stinky.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com From brian.takita at gmail.com Tue May 5 13:15:24 2009 From: brian.takita at gmail.com (Brian Takita) Date: Tue, 5 May 2009 10:15:24 -0700 Subject: [Erector-devel] More Needs In-Reply-To: <7a93bd340905050839k3fd8a6abje6a9479f2fa43da0@mail.gmail.com> References: <7a93bd340905050802o10c7b01bsaff500d1a33f40ba@mail.gmail.com> <7a93bd340905050828n8623506v192aedde52c124d0@mail.gmail.com> <7a93bd340905050839k3fd8a6abje6a9479f2fa43da0@mail.gmail.com> Message-ID: <1d7ddd110905051015t688f0675k41d8de54c9b18aa3@mail.gmail.com> On Tue, May 5, 2009 at 8:39 AM, Alex Chaffee wrote: > Actually wait, now it looks like the gem's on Github after all. > > Jeweler? erector.gemspec? > > class Alex > ?needs :takita > end Alex, you are now a collaborator on pivotal/erector. You should be able to deploy the site. Are you having issues? > > --- > Alex Chaffee - alex at stinky.com > Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | > http://alexch.tumblr.com > > > > On Tue, May 5, 2009 at 8:28 AM, Alex Chaffee wrote: >> On Tue, May 5, 2009 at 8:02 AM, Alex Chaffee wrote: >>> Jeff and I paired yesterday to work on his RailsConf talk. We're doing >>> it based on the new API so we'd like to do a release today or tomorrow >>> if at all possible. Who knows how to do this? Is the gem on Github or >>> Rubyforge or what? >> >> Looks like the gem is still on Rubyforge. I just did a dry run and it >> looks like I can push a release to Rubyforge via my alexch/erector >> fork (since I'm still not a committer on the pivotal fork). So I guess >> we're good to go. I'll push release 0.6.0 today or tomorrow, and Jeff >> and I will make a corresponding blog post. >> >> Pivots (and C5s), please announce at standup(s) that this is imminent. >> Don't want to take anyone by surprise. >> >> ?- A >> > _______________________________________________ > Erector-devel mailing list > Erector-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/erector-devel > From brian.takita at gmail.com Tue May 5 13:26:13 2009 From: brian.takita at gmail.com (Brian Takita) Date: Tue, 5 May 2009 10:26:13 -0700 Subject: [Erector-devel] Github Pages In-Reply-To: <7a93bd340905031407j3f3bf5afg546e4c828038e5ca@mail.gmail.com> References: <1d7ddd110904181437g451f6541kc07d8a39eb56e21a@mail.gmail.com> <7a93bd340904181500s7454e902l9f5d2e26b3d6d856@mail.gmail.com> <1d7ddd110904191341q2e12690p3c3deea5ff977844@mail.gmail.com> <7a93bd340905031407j3f3bf5afg546e4c828038e5ca@mail.gmail.com> Message-ID: <1d7ddd110905051026i7f325aadv3dd470d3034fe57c@mail.gmail.com> On Sun, May 3, 2009 at 2:07 PM, Alex Chaffee wrote: > OK, I've reread http://pages.github.com and I'm sold. Free web page > hosting; deploy via "git push". What's not to like? > > The only possible problem is where to keep the .rb files? In the main > project (so they stay in sync with updates in the API) or in the site > project (so they stay in sync with the generated pages)? Probably the > latter, which might entail putting a copy of erector inside the site > repo... possibly using braid. Cool. Sorry, I havn't been reading my emails. (I'm a little better than Sobo though). I can take a look at making this happen. I'll make a branch. Should I sign up Erector as a github user? > > --- > Alex Chaffee - alex at stinky.com > Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | > http://alexch.tumblr.com > > > > On Sun, Apr 19, 2009 at 1:41 PM, Brian Takita wrote: >> On Sat, Apr 18, 2009 at 3:00 PM, Alex Chaffee wrote: >>> Can we keep using the existing documentation page objects (which are >>> written in Erector and output HTML)? There's some logic in there for >>> generating the navigation and faq index and stuff. >> I don't see why not. It would require that the generated files go into >> the erector.github.com project. >> Perhaps we can use submodules or a clone that we manage (like rails) >> in the erector project? >>> >>> I see something about Jekyll at http://pages.github.com/ but I don't >>> really understand it yet. >> I think Jekyll is a template system that enables the generation of >> html files (like what you already did for Erector). >>> >>> --- >>> Alex Chaffee - alex at stinky.com >>> Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | >>> http://alexch.tumblr.com >>> >>> >>> >>> On Sat, Apr 18, 2009 at 2:37 PM, Brian Takita wrote: >>>> I propose that we create an Erector github project and use Github >>>> Pages (http://erector.github.com) instead of using Rubyforge. >>>> Their usage of Git to update the site is pretty slick. It would also >>>> be much easier to administer than Rubyforge. >>>> _______________________________________________ >>>> Erector-devel mailing list >>>> Erector-devel at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/erector-devel >>>> >>> >> > From brian.takita at gmail.com Tue May 5 13:29:21 2009 From: brian.takita at gmail.com (Brian Takita) Date: Tue, 5 May 2009 10:29:21 -0700 Subject: [Erector-devel] Erector + Merb? In-Reply-To: <7a93bd340905031207r63287070m9819cb084d1dbab1@mail.gmail.com> References: <7a93bd340905031132l71175cd8g35ba342bcb130340@mail.gmail.com> <7a93bd340905031207r63287070m9819cb084d1dbab1@mail.gmail.com> Message-ID: <1d7ddd110905051029p2cb87a29w42e16d4a4d888df0@mail.gmail.com> On Sun, May 3, 2009 at 12:07 PM, Alex Chaffee wrote: > Got a tweet asking if Erector supports Merb. I've never Merbed so I > can't answer... Anyone else know? And if not, what's needed to make it > seamless? I know Pat Maddox took a crack at it. I bet we can create a MerbWidget and deal with the API in there. > --- > Alex Chaffee - alex at stinky.com > Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | > http://alexch.tumblr.com > _______________________________________________ > Erector-devel mailing list > Erector-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/erector-devel > From brian.takita at gmail.com Tue May 5 13:30:20 2009 From: brian.takita at gmail.com (Brian Takita) Date: Tue, 5 May 2009 10:30:20 -0700 Subject: [Erector-devel] Erector mailing list is b0rked In-Reply-To: References: <7a93bd340905031325y5180d409i1fb6b953091b9958@mail.gmail.com> Message-ID: <1d7ddd110905051030q2b9db34cn8dd8f4f6e5b52c9f@mail.gmail.com> On Sun, May 3, 2009 at 1:32 PM, Steve Conover wrote: > Everything should start on google groups by default IMO... +1 > > On Sun, May 3, 2009 at 1:25 PM, Alex Chaffee wrote: >> It seems like the Rubyforge-hosted erector-devel mailing list is >> silently (!!) rejecting messages sent from an unsubscribed email >> address or containing "rich text" attachments. I trust you agree this >> is unacceptable. I've poked around the mailman settings but can't see >> anything obvious to fix this (like an unchecked "don't be b0rked" box) >> but I'm not inclined to look much more deeply at this. >> >> Given that we're already using GitHub for VC and Tracker for issues, I >> see no problem in moving our mailing list to a system that has a >> sensible UI and a searchable archive. I've taken the liberty of >> creating a Google Group (called "erector", another bonus) and unless >> people object I'll move us over to there and resubscribe everyone >> who's on this list now. >> >> So... any objections? (Hopefully this message won't get swallowed too...) >> >> ?- A >> >> --- >> Alex Chaffee - alex at stinky.com >> Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | >> http://alexch.tumblr.com >> _______________________________________________ >> Erector-devel mailing list >> Erector-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/erector-devel >> > _______________________________________________ > Erector-devel mailing list > Erector-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/erector-devel > From alexch at gmail.com Tue May 5 14:40:49 2009 From: alexch at gmail.com (Alex Chaffee) Date: Tue, 5 May 2009 11:40:49 -0700 Subject: [Erector-devel] Erector 0.6.0 Announcement Message-ID: <7a93bd340905051140u56924a1ah365c6fb5bfa83e54@mail.gmail.com> Here's the current announcement (saved in erector/doc), including a quick update guide. We put in deprecation warnings so it should hopefully be obvious where your code needs to change. Please look it over and let me know if there's anything unclear. We think we'll be making the actual release tomorrow. # Erector 0.6.0 Announcement This release is the first major API change to Erector. It will definitely break existing code. Sorry about that, but we promise it'll be cleaner afterwards. ## Quick Update Guide * Rename 'def render' to 'def content' in all your widgets * Change MyWidget.new(helpers, assigns, output) to just MyWidget.new(assigns) * To render a widget from inside another widget, use widget MyWidget, :foo=>2 or widget MyWidget.new(:foo => 2) * If you want your variables to have attr_readers, use 'needs' * If you want your widgets to be more self-documenting, use 'needs' ## Major API changes * "new" and "to\_s" have been changed to clarify the lifecycle of a widget, so "new" accepts permanent state ("assigns" variables) and "to_s" accepts temporary, rendering state (output stream, helpers, and prettyprinting). This lets you do things like make collections of widgets in once place in your code and render them in another place. * Renamed "render" to "content", which removes confusion/ambiguity with Rails' "render" method and concept, and also allows "render :partial" to be made to work (though we're not sure if that totally works yet). * To render a widget from outside code, the pattern is: w = DateWidget.new(:when => Time.now, :title => "Nap Time") puts w.to_s(:helpers => some_rails_view) * To render a widget from inside another widget: def content # first way... pass class and assigns widget DateWidget, :when => Time.now, :title => "Nap Time" # second way... pass instance widget DateWidget.new(:when => Time.now, :title => "Nap Time") end Using "widget" will improve performance over calling "raw foo.to\_s" or whatever since it reuses the same output stream. * To declare variables -- and raise an exception when one is not provided: class JohnLennon < Erector::Widget needs :love end * Formerly, every 'assigns' variable had an attr_reader defined for it. Now, only variables declared with 'needs' get attr_readers. * ## Other changes: * Removed Widget#to_s caching, which fixed indentation issues. * BUGFIX: Indentation level is now correctly propagated to nested widgets. * Erector's Rails support strategy has changed. The released version of Erector only supports the latest stable Rails version (currently 2.3.2). If you need support for earlier versions of Rails, there are separate Git branches for each one, but we will not be in the habit of keeping these up to date with the latest features and patches. If someone wants to do a merge to a prior Rails branch, Brian will be happy to help :-) From mpd at jesters-court.net Tue May 5 21:50:20 2009 From: mpd at jesters-court.net (mpd) Date: Tue, 5 May 2009 18:50:20 -0700 Subject: [Erector-devel] Erector + Merb? In-Reply-To: <7a93bd340905031207r63287070m9819cb084d1dbab1@mail.gmail.com> References: <7a93bd340905031132l71175cd8g35ba342bcb130340@mail.gmail.com> <7a93bd340905031207r63287070m9819cb084d1dbab1@mail.gmail.com> Message-ID: <20090506015020.GB38172@jesters-court.net> No, Erector does not support Merb in its current version. I took a spike at this one afternoon awhile back but did not know enough about Merb's render path or Erector in general to make it happen. I wonder how much time it's worth spending seeing as the Rails/Merb merge is supposed to occur at some point soon, though as a Merb user, I'd love to ditch Haml for Erector. peace, -mpd On Sun, May 03, 2009 at 12:07:19PM -0700, Alex Chaffee wrote: > Got a tweet asking if Erector supports Merb. I've never Merbed so I > can't answer... Anyone else know? And if not, what's needed to make it > seamless? > --- > Alex Chaffee - alex at stinky.com > Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | > http://alexch.tumblr.com > _______________________________________________ > Erector-devel mailing list > Erector-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/erector-devel -- From kingdon at panix.com Tue May 5 22:12:17 2009 From: kingdon at panix.com (Jim Kingdon) Date: Tue, 5 May 2009 22:12:17 -0400 (EDT) Subject: [Erector-devel] DHH In-Reply-To: <7a93bd340905050946l3edba397kcdfe7eb1baef5c37@mail.gmail.com> (message from Alex Chaffee on Tue, 5 May 2009 09:46:45 -0700) References: <7a93bd340905050946l3edba397kcdfe7eb1baef5c37@mail.gmail.com> Message-ID: <20090506021217.8580C242D0@panix5.panix.com> > I'm at RailsConf keynote... DHH is saying how awesome it is that Rails > 3 ERB is going to emit html-escaped strings by default, and have a > "raw" method and a way to tag strings as "html safe". Now where have I > heard that before? Heh. We did beat them by maybe 1.5 years, but erector can't claim to be too much of a groundbreaker on this. I got the idea from tiny template ( http://tinytemplate.org/ ), the DOM, and probably various other web frameworks (html-escaping by default is in fact conventional wisdom in many circles at least in a "do as I say, not as I do" kind of way). From alexch at gmail.com Wed May 6 21:34:11 2009 From: alexch at gmail.com (Alex Chaffee) Date: Wed, 6 May 2009 18:34:11 -0700 Subject: [Erector-devel] Erector 0.6.3 released Message-ID: <7a93bd340905061834l790c0fffw12e7c0aa4252074b@mail.gmail.com> Rubyforge Gem - http://rubyforge.org/projects/erector/ GitHub Gem and repo - http://github.com/pivotal/erector web site - http://erector.rubyforge.org rdocs - http://erector.rubyforge.org/rdoc blog post http://pivotallabs.com/users/alex/blog/articles/839-erector-0-6-3-now-ready-to-conquer-the-world From alexch at gmail.com Thu May 7 11:22:24 2009 From: alexch at gmail.com (Alex Chaffee) Date: Thu, 7 May 2009 08:22:24 -0700 Subject: [Erector-devel] 0.6.3 Release Notes Message-ID: <7a93bd340905070822m79d517fdib4884de35c179743@mail.gmail.com> Erector 0.6.3 has been released.? It's a major release that includes breaking changes and major updates to the API.? From the release notes: * 'render' renamed to 'content' * widget constructor only takes one parameter, an 'assigns' hash (plus the optional default block) * to render one widget from inside another, use the 'widget' method (not 'render_to'). This method accepts either a widget instance, or a widget class and an assigns hash. * 'needs' macro to declare the variables your widget accepts via the 'assigns' constructor parameter * Removed Widget#to_s caching, which fixed indentation issues. * BUGFIX: Indentation level is now correctly propagated to nested widgets. * Erector's Rails support strategy has changed. The released version of Erector only supports the latest stable Rails version (currently 2.3.2). If you need support for earlier versions of Rails, there are separate Git branches for each one, but we will not be in the habit of keeping these up to date with the latest features and patches. * Renamed the command line tool to 'erector' If you are using a widget in rails, you now need to inherit from RailsWidget to get helper goodness. From thewoolleyman at gmail.com Thu May 28 07:48:47 2009 From: thewoolleyman at gmail.com (Chad Woolley) Date: Thu, 28 May 2009 04:48:47 -0700 Subject: [Erector-devel] CI Message-ID: Your build is broken for days. Do you want the notifications to go to this list? Just edit cruise_config.rb if you do - let me know if I need to remove the default file. http://ci.pivotallabs.com:3333/builds/Erector