nanoc 3.0.3 released

3 views
Skip to first unread message

Denis Defreyne

unread,
Jan 7, 2010, 4:27:34 AM1/7/10
to na...@googlegroups.com
Hi,

nanoc 3.0.3 is out! This is a patch release that fixes a couple of annoying bugs. The full release notes:

* The Blogging helper now properly handles item reps without paths
* The relativize_paths filter now only operates inside tags
* The autocompiler now handles escaped paths
* The link_to and tagging helpers now output escaped HTML
* Fixed played_at attribute assignment in Last.fm data source for tracks
playing now and added a now_playing attribute [Nicky Peeters]
* The filesystem_* data sources can now handle dots in identifiers
* Required enumerator to make sure #enum_with_index always works
* Array#stringify_keys now properly recurses

You can update nanoc3 the usual way, like this:

gem update nanoc3

Enjoy,

Denis

--
Denis Defreyne
denis.d...@stoneship.org

Eric Sunshine

unread,
Jan 7, 2010, 8:20:30 PM1/7/10
to nanoc
Hi Denis,

On Jan 7, 4:27 am, Denis Defreyne <denis.defre...@stoneship.org>
wrote:


> nanoc 3.0.3 is out! This is a patch release that fixes a couple of
> annoying bugs.

> * The filesystem_* data sources can now handle dots in identifiers

I am sorry to report that commit 8ba319e90103 (http://
projects.stoneship.org/hg/nanoc/rev/8ba319e90103) is buggy for
'filesystem_compact' and breaks website compilation. As an example, if
the website has the following content files in the same directory:

news.feed
news.yaml
product1news.feed
product1news.yaml
product2news.feed
product2news.yaml

Compilation throws the error:

RuntimeError: Expected 1 content file for the metafile
content/feeds/news.yaml but found 3

The problem is with the selection code in
FilesystemCompact#content_filename_for_meta_filename():

Dir.entries(dirname).select { |f| f =~ /#{base_filename}\.[^.]+$/ }

Unfortunately, the pattern is not anchored at the start of string, so
"news\.[^.]+$" matches "news.feed", "product1news.feed", and
"product2news.feed". The fix, of course, is to anchor the pattern by
changing the regular expression to:

/^#{base_filename}\.[^.]+$/

-- ES

Denis Defreyne

unread,
Jan 8, 2010, 3:23:34 AM1/8/10
to na...@googlegroups.com
On 08 Jan 2010, at 02:20, Eric Sunshine wrote:

> Hi Denis,
>
> On Jan 7, 4:27 am, Denis Defreyne <denis.defre...@stoneship.org>
> wrote:
>> nanoc 3.0.3 is out! This is a patch release that fixes a couple of
>> annoying bugs.
>> * The filesystem_* data sources can now handle dots in identifiers
>
> I am sorry to report that commit 8ba319e90103 (http://
> projects.stoneship.org/hg/nanoc/rev/8ba319e90103) is buggy for

> 'filesystem_compact' and breaks website compilation. [..]

Yikes, that’s no good. I’ve applied your fix and added a test case and I’ll likely be releasing 3.0.4 later today. Can you verify whether the patch fixes your issue? You can find the patch http://projects.stoneship.org/hg/nanoc/rev/b24a8675dafa (would also give you a github link, but github is down at the moment of writing).

Regards,

Eric Sunshine

unread,
Jan 8, 2010, 3:48:21 AM1/8/10
to na...@googlegroups.com
Hi Denis,

I downloaded and tested patch b24a8675dafa, and it worked fine. (Indeed,
I had already tested the fix locally before reporting the problem.)

Regarding the test case, in addition to testing that "bar" does not
incorrectly match "quxbar", it probably would not hurt also to verify
that it does not match "barfoo" or "quxbarfoo".

-- ES

On 1/8/2010 3:23 AM, Denis Defreyne wrote:
> On 08 Jan 2010, at 02:20, Eric Sunshine wrote:
>
>> Hi Denis,
>>
>> On Jan 7, 4:27 am, Denis Defreyne<denis.defre...@stoneship.org>
>> wrote:
>>> nanoc 3.0.3 is out! This is a patch release that fixes a couple of
>>> annoying bugs.
>>> * The filesystem_* data sources can now handle dots in identifiers
>>
>> I am sorry to report that commit 8ba319e90103 (http://
>> projects.stoneship.org/hg/nanoc/rev/8ba319e90103) is buggy for
>> 'filesystem_compact' and breaks website compilation. [..]
>

> Yikes, that�s no good. I�ve applied your fix and added a test case and I�ll likely be releasing 3.0.4 later today. Can you verify whether the patch fixes your issue? You can find the patch http://projects.stoneship.org/hg/nanoc/rev/b24a8675dafa (would also give you a github link, but github is down at the moment of writing).
>
> Regards,
>
> Denis
>
>

Denis Defreyne

unread,
Jan 8, 2010, 4:13:57 AM1/8/10
to na...@googlegroups.com
On 08 Jan 2010, at 09:48, Eric Sunshine wrote:

> Regarding the test case, in addition to testing that "bar" does not incorrectly match "quxbar", it probably would not hurt also to verify that it does not match "barfoo" or "quxbarfoo".

Good idea. Here’s the relevant patch: http://projects.stoneship.org/hg/nanoc/rev/cfd8ad2c6bce. It tests {bar, quxbar, barqux, quxbarqux}.yaml, as well as {qux.bar, bar.qux, qux.bar.qux}.yaml for good measure, because I don’t trust those periods. :)

Designbot

unread,
Jan 8, 2010, 1:29:23 PM1/8/10
to nanoc
I'm getting the same error: "RuntimeError: Expected 1 content file for
the metafile content/about/chef.yaml but found 2"

Denis Defreyne

unread,
Jan 8, 2010, 2:16:00 PM1/8/10
to na...@googlegroups.com
Hi,

I’ve released 3.0.4, which fixes this issue, and pushed the gem to gemcutter. I still need to do the announcements (ruby-talk, nanoc mailinglist, nanoc news) but I’ll get to that soon.

Regards,

Reply all
Reply to author
Forward
0 new messages