nanoc 3.3.5 released

84 views
Skip to first unread message

Denis Defreyne

unread,
Apr 23, 2012, 4:05:27 PM4/23/12
to na...@googlegroups.com
Hi all,

I’ve just pushed nanoc 3.3.5, a release with a couple of bug fixes. For details, check the release notes at [1].

You can update your gems using “gem update”. If you experience issues with this release, please do not hesitate to let me know either on this mailing list or on the issue tracker at <http://github.com/ddfreyne/nanoc/issues>!

nanoc 3.3.5 follows very closely on 3.3.4, which lacked one important bug fix.

Enjoy!

Denis



[1]: http://nanoc.stoneship.org/release-notes/
signature.asc

Justin Clift

unread,
Apr 24, 2012, 12:39:01 AM4/24/12
to na...@googlegroups.com
On 24/04/2012, at 6:05 AM, Denis Defreyne wrote:
> Hi all,
>
> I’ve just pushed nanoc 3.3.5, a release with a couple of bug fixes. For details, check the release notes at [1].

Oops, this upgrade breaks our site generation. :(

3.3.3 works, 3.3.5 breaks with the output below.

Any ideas?

If anyone wants to investigate, the git repo is public, here:
(master branch)

https://github.com/aeolusproject/aeolus-website

+ Justin

*********************************************************

$ rm -rf tmp output; nanoc co
Loading site data...
Compiling site...
create [0.00s] output/gsg/0.9.0/images/new_deployment.png
create [0.00s] output/gsg/0.9.0/images/thumbnails/new_deployment_thumb.png
create [0.00s] output/styles/subnav-pointer.png
create [0.00s] output/static-redmine/plugin_assets/redmine_backlogs.new/javascripts/jquery.jqplot/usage.txt
create [0.00s] output/gsg/0.9.0/images/initial_welcome_screen_user_options.png
create [0.00s] output/styles/navbarbg.png
create [0.00s] output/static-redmine/plugin_assets/redmine_backlogs.new/stylesheets/rb_default/images/ui-bg_highlight-soft_75_cccccc_1x100.png
create [0.00s] output/fonts/liberation_sans/Red Hat Liberation License.txt
create [0.00s] output/gsg/0.9.0/images/initial_welcome_screen_view.png
create [0.00s] output/static-redmine/images/bullet_toggle_minus.png
create [0.00s] output/static-redmine/images/task_todo.png
create [0.00s] output/static-redmine/plugin_assets/redmine_backlogs.new/javascripts/jquery.jqplot/plugins/jqplot.ohlcRenderer.js
create [0.00s] output/static-redmine/images/jstoolbar/bt_pre.png
create [0.00s] output/static-redmine/images/project_marker.png
create [0.00s] output/static-redmine/themes/alternate/stylesheets/application.css
create [0.00s] output/static-redmine/javascripts/calendar/calendar.js
create [0.00s] output/gsg/0.9.0/images/new_deployment_details.png
create [0.00s] output/static-redmine/stylesheets/jstoolbar.css
create [0.00s] output/static-redmine/images/milestone_late.png
create [0.00s] output/static-redmine/javascripts/jstoolbar/lang/jstoolbar-mn.js
create [0.00s] output/gsg/0.6.0/images/user_update_successful.png
create [0.00s] output/static-redmine/plugin_assets/redmine_backlogs.new/javascripts/jquery.jqplot/plugins/jqplot.barRenderer.min.js
create [0.00s] output/static-redmine/plugin_assets/redmine_backlogs/stylesheets/rb_default/jquery-ui.css

Captain! We’ve been hit!

=== MESSAGE:

ArgumentError: different prefix: "" and "/gsg/0.6.0"

=== COMPILATION STACK:

- [item] /gsg/0.6.0/configuring_aeolus/ (rep default)

=== BACKTRACE:

0. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:723:in `relative_path_from'
1. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/helpers/link_to.rb:144:in `relative_path_to'
2. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/filters/relativize_paths.rb:80:in `nokogiri_process'
3. /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.2/lib/nokogiri/xml/node_set.rb:239:in `each'
4. /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.2/lib/nokogiri/xml/node_set.rb:238:in `upto'
5. /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.2/lib/nokogiri/xml/node_set.rb:238:in `each'
6. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/filters/relativize_paths.rb:78:in `nokogiri_process'
7. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/filters/relativize_paths.rb:77:in `each'
8. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/filters/relativize_paths.rb:77:in `nokogiri_process'
9. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/filters/relativize_paths.rb:61:in `run'
10. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/result_data/item_rep.rb:344:in `filter'
11. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/compilation/item_rep_proxy.rb:47:in `filter'
12. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/compilation/rule_context.rb:54:in `filter'
13. ./Rules:32:in `load'
14. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/compilation/rule.rb:68:in `instance_eval'
15. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/compilation/rule.rb:68:in `apply_to'
16. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/compilation/compiler.rb:381:in `compile_rep'
17. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/compilation/compiler.rb:337:in `compile_reps'
18. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/compilation/compiler.rb:330:in `loop'
19. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/compilation/compiler.rb:330:in `compile_reps'
20. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/compilation/compiler.rb:85:in `run'
21. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/source_data/site.rb:57:in `compile'
22. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/commands/compile.rb:57:in `run'
23. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/command_runner.rb:14:in `call'
24. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/error_handler.rb:42:in `handle_while'
25. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/error_handler.rb:23:in `handle_while'
26. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/command_runner.rb:13:in `call'
27. /Library/Ruby/Gems/1.8/gems/cri-2.2.1/lib/cri/command_dsl.rb:175:in `runner'
28. /Library/Ruby/Gems/1.8/gems/cri-2.2.1/lib/cri/command.rb:291:in `call'
29. /Library/Ruby/Gems/1.8/gems/cri-2.2.1/lib/cri/command.rb:291:in `run_this'
30. /Library/Ruby/Gems/1.8/gems/cri-2.2.1/lib/cri/command.rb:244:in `run'
31. /Library/Ruby/Gems/1.8/gems/cri-2.2.1/lib/cri/command.rb:257:in `run'
32. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli.rb:44:in `run'
33. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/error_handler.rb:42:in `handle_while'
34. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/error_handler.rb:23:in `handle_while'
35. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli.rb:41:in `run'
36. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/bin/nanoc:19
37. /usr/bin/nanoc:19:in `load'
38. /usr/bin/nanoc:19

=== VERSION INFORMATION:

nanoc 3.3.5 © 2007-2012 Denis Defreyne.
Running ruby 1.8.7 (2010-01-10) on universal-darwin11.0 with RubyGems 1.3.6.

If you believe this is a bug in nanoc, please do report it at
<https://github.com/ddfreyne/nanoc/issues/new>--thanks!

*********************************************************

Denis Defreyne

unread,
Apr 24, 2012, 2:25:40 AM4/24/12
to na...@googlegroups.com
On 24 Apr 2012, at 06:39, Justin Clift wrote:

> On 24/04/2012, at 6:05 AM, Denis Defreyne wrote:
>> Hi all,
>>
>> I’ve just pushed nanoc 3.3.5, a release with a couple of bug fixes. For details, check the release notes at [1].
>
> Oops, this upgrade breaks our site generation. :(
>
> 3.3.3 works, 3.3.5 breaks with the output below.
>
> Any ideas?

Yikes, the 3.3.5 update was actually meant to address exactly that issue. Will look into it.

Denis

signature.asc

Denis Defreyne

unread,
Apr 24, 2012, 2:48:17 AM4/24/12
to na...@googlegroups.com
Hi Justin,

This should fix it: https://github.com/ddfreyne/nanoc/commit/e69cbb646c7100bd574a121c7bc6cfafba3180d2.

The problem occurs because at some point, you are linking to "screenshots.html" instead of "/screenshots.html". This obviously shouldn’t crash; it should simple not try to relativize already relative paths. (It broke when I switched away from a regex-based parser to a proper HTML parser.)

Can you verify that the current release-3.3.x branch fixes the problem? (I’ve tried it locally and works fine.)

Cheers

Denis

On 24 Apr 2012, at 06:39, Justin Clift wrote:

> --
> You received this message because you are subscribed to the nanoc discusssion group.
>
> To post to this group, send email to na...@googlegroups.com
> To unsubscribe from this group, send email to
> nanoc+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nanoc?hl=en

signature.asc

xbonell

unread,
Apr 25, 2012, 3:56:16 PM4/25/12
to nanoc
Hi, same problem here. I've tried the fix in diferent sites and then
the filter seems to run fine but it corrupts the HTML output.

e.g In a HTML5 site it breaks the DOCTYPE declaration:

!doctype html&gt;
<html xmlns="http://www.w3.org/1999/xhtml" class="no-js" lang="en"
xml:lang="en">

In a XHTML site, if the :type parameter is set to :html it removes the
HTML, HEAD and BODY tags, and the DOCTYPE declaration.
If :type is set to :xhtml I get this error:

Captain! We’ve been hit!

=== MESSAGE:

TypeError: can't modify frozen string

=== COMPILATION STACK:

- [item] /invitaciones-envio-error/ (rep default)

=== BACKTRACE:

0. lib/filters/relativize_paths.rb:58:in `sub!'
1. lib/filters/relativize_paths.rb:58:in `run'
2. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
result_data/item_rep.rb:344:in `filter'
3. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
compilation/item_rep_proxy.rb:47:in `filter'
4. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
compilation/rule_context.rb:54:in `filter'
5. ./Rules:100:in `load'
6. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
compilation/rule.rb:68:in `instance_eval'
7. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
compilation/rule.rb:68:in `apply_to'
8. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
compilation/compiler.rb:381:in `compile_rep'
9. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
compilation/compiler.rb:337:in `compile_reps'
10. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
compilation/compiler.rb:330:in `loop'
11. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
compilation/compiler.rb:330:in `compile_reps'
12. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
compilation/compiler.rb:85:in `run'
13. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/base/
source_data/site.rb:57:in `compile'
14. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/commands/
compile.rb:57:in `run'
15. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/
command_runner.rb:14:in `call'
16. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/
error_handler.rb:42:in `handle_while'
17. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/
error_handler.rb:23:in `handle_while'
18. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/
command_runner.rb:13:in `call'
19. /Library/Ruby/Gems/1.8/gems/cri-2.2.1/lib/cri/command_dsl.rb:
175:in `runner'
20. /Library/Ruby/Gems/1.8/gems/cri-2.2.1/lib/cri/command.rb:291:in
`call'
21. /Library/Ruby/Gems/1.8/gems/cri-2.2.1/lib/cri/command.rb:291:in
`run_this'
22. /Library/Ruby/Gems/1.8/gems/cri-2.2.1/lib/cri/command.rb:244:in
`run'
23. /Library/Ruby/Gems/1.8/gems/cri-2.2.1/lib/cri/command.rb:257:in
`run'
24. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli.rb:44:in
`run'
25. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/
error_handler.rb:42:in `handle_while'
26. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli/
error_handler.rb:23:in `handle_while'
27. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/lib/nanoc/cli.rb:41:in
`run'
28. /Library/Ruby/Gems/1.8/gems/nanoc-3.3.5/bin/nanoc:19
29. /usr/bin/nanoc:19:in `load'
30. /usr/bin/nanoc:19

=== VERSION INFORMATION:

nanoc 3.3.5 © 2007-2012 Denis Defreyne.
Running ruby 1.8.7 (2010-01-10) on universal-darwin11.0 with RubyGems
1.3.6.

--

Xavi



On Apr 24, 8:48 am, Denis Defreyne <denis.defre...@stoneship.org>
wrote:
> Hi Justin,
>
> This should fix it:https://github.com/ddfreyne/nanoc/commit/e69cbb646c7100bd574a121c7bc6....
>  signature.asc
> < 1KViewDownload

Steve K

unread,
Apr 25, 2012, 4:53:44 PM4/25/12
to na...@googlegroups.com
Hi Dennis

Also having problems with 3.5.5 using filter :relativize_paths, :type => :html

Just adding this filter to the basic "nanoc create_site" causes it to somehow swallow the doctype, and the html and head tags at the top and bottom of the output document:

(3 blank Lines)
    <meta charset="utf-8"><title>A Brand New nanoc Site - Home</title><link rel="stylesheet" type="text/css" href="style.css" media="screen"><meta name="generator" content="nanoc 3.3.5"><div id="main">
      <h1>A Brand New nanoc Site</h1>
      </ul>
</div>
  

Also get the frozen string error of Xavi using :type => :xhtml on an XHTML doc with the following at the top of the doc:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en-GB" lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
  <head>


This also exists in 3.3.3 - didn't notice it at first as was using html filter by mistake.

Using nokogiri 1.5.2. 

Regards

Steve


Justin Clift

unread,
Apr 26, 2012, 12:57:16 AM4/26/12
to na...@googlegroups.com
On 26/04/2012, at 6:53 AM, Steve K wrote:
<snip>
> This also exists in 3.3.3 - didn't notice it at first as was using html filter by mistake.

Heh, it's kinda sounding like nanoc's now at the point where having automated regression
testing of commits (or maybe potential releases?) would be useful.

Anyone here familiar with the various testing suites that are around? I've heard good
things about Hudson and autotest, but haven't actually used either myself.

?

Regards and best wishes,

Justin Clift

Denis Defreyne

unread,
Apr 26, 2012, 12:59:11 AM4/26/12
to na...@googlegroups.com
Hi,

The HTML output being corrupted is likely because I am erroneously using #fragment instead of #parse at https://github.com/ddfreyne/nanoc/blob/release-3.3.x/lib/nanoc/filters/relativize_paths.rb#L76. I don’t have the time to take a look at it right now, but I will ASAP.

As for the “can't modify frozen string” issue: are you using a modified version of the relativize_paths filter? If so, remember that you can’t modify the incoming content (e.g. with #sub!). Instead of content.sub!(…), you could use content = content.sub(…).

Now I have to run!

Cheers

Denis

signature.asc

Denis Defreyne

unread,
Apr 26, 2012, 1:01:58 AM4/26/12
to na...@googlegroups.com
On 26 Apr 2012, at 06:57, Justin Clift wrote:

> Heh, it's kinda sounding like nanoc's now at the point where having automated regression
> testing of commits (or maybe potential releases?) would be useful.
>
> Anyone here familiar with the various testing suites that are around? I've heard good
> things about Hudson and autotest, but haven't actually used either myself.

Hi,

Quite recently for the 3.3.4 release I’ve set up Travis with the help of a friend. This way, when I push code, it is tested on a clean system for both 1.8.7 and 1.9.3. Here’s the URL: http://travis-ci.org/#!/ddfreyne/nanoc.

nanoc does have a fairly large test suite, but there are always (edge) cases you didn’t think of when writing the tests…

Denis

signature.asc

arnau siches

unread,
Apr 26, 2012, 4:12:02 AM4/26/12
to na...@googlegroups.com
Hi Denis,

I'm trying to remember the issues I ran into when I added Nokogiri to
parse XML. One of them was parsing XHTML as a full document rather
than a fragment.

Another one was how Nokogiri closes not properly closed tags when runs
through the HTML parser.

I ended keeping HTML as a regexp until find a better HTML parser,
hopefully against the HTML5 rules.
--
arnau siches
esbudellat.net

Steve K

unread,
Apr 26, 2012, 8:57:37 AM4/26/12
to na...@googlegroups.com

As for the “can't modify frozen string” issue: are you using a modified version of the relativize_paths filter? If so, remember that you can’t modify the incoming content (e.g. with #sub!). Instead of content.sub!(…), you could use content = content.sub(…).

Hi,

I'm not using a modified version of the filter.  I think it might be this that's causing the "frozen string" issue:

        when :xhtml
          klass = ::Nokogiri::XML
          # FIXME cleanup because it is ugly
          # this cleans the XHTML namespace to process fragments and full
          # documents in the same way. At least, Nokogiri adds this namespace
          # if detects the `html` element.
          content.sub!(%r{(<html[^>]+)xmlns="http://www.w3.org/1999/xhtml"}, '\1')
        end


The html tag in my default layout already has this name space in it. Removing it allows the site to compile and the namespace magically re-appears in the tag in the output.

Steve.

arnau siches

unread,
Apr 26, 2012, 9:24:15 AM4/26/12
to na...@googlegroups.com
Hi again,

I made a pull request with three tests that explains a lot better the
situation. I belive they're not edge cases.

To pass those tests I think should be better staying away from
nokogiri in the HTML scenario until nokogiri deals properly with
unexpected doctypes (say HTML5 doctype) or behaves like an HTML5
parser.

Hope it helps.
--
arnau siches
esbudellat.net

Denis Defreyne

unread,
Apr 26, 2012, 1:11:58 PM4/26/12
to na...@googlegroups.com
Hi,

I’m pressed for time so I’ll keep this short (for now). I’ve pushed a fix for the full HTML document issue. Can you verify where these work? I will take a look at the pull requests when I have the time.

Cheers

Denis
signature.asc

arnau siches

unread,
Apr 26, 2012, 3:35:25 PM4/26/12
to na...@googlegroups.com
Sorry but I cannot see any change in your release-3.3.x branch. Where
can I find it?

Thx!
--
arnau siches
esbudellat.net

Denis Defreyne

unread,
Apr 27, 2012, 3:09:54 AM4/27/12
to na...@googlegroups.com
Ack. I really haven’t been very awake the last few days when doing the relativize_paths fixes, right?

It’s pushed now. You can find it at <https://github.com/ddfreyne/nanoc/commit/8d9edf85141fe4f7c25deac351e14c35fff48bcb>.

Cheers

Denis
signature.asc

Denis Defreyne

unread,
Apr 27, 2012, 1:53:46 PM4/27/12
to na...@googlegroups.com
On 26 Apr 2012, at 14:57, Steve K wrote:

> I'm not using a modified version of the filter. I think it might be this that's causing the "frozen string" issue:
>
> when :xhtml
> klass = ::Nokogiri::XML
> # FIXME cleanup because it is ugly
> # this cleans the XHTML namespace to process fragments and full
> # documents in the same way. At least, Nokogiri adds this namespace
> # if detects the `html` element.
> content.sub!(%r{(<html[^>]+)xmlns="http://www.w3.org/1999/xhtml"}, '\1')
> end

Ack, I missed this in the 3.3.6 release. I have a fix in the release branch, so it’ll be in 3.3.7.

Denis
signature.asc

Steve K

unread,
Apr 27, 2012, 3:55:57 PM4/27/12
to na...@googlegroups.com
Thanks Dennis. I've pulled the release branch and it works great for me.

Steve 
Reply all
Reply to author
Forward
0 new messages