ddfreyne/nanoc — Issue #67: date error in nanoc 3.2.2 under Lion
Author: dtenenbaum
Created: 2011-10-14 23:40:55+00:00
State: open

If I do the following:

nanoc create_site tutorial
cd tutorial
nanoc compile

Then I edit content/index.html and put this line under the title: line in the YAML section:
start_date: 2011-05-20

Then I put this line in layouts/default.html right below the

line:
Start Date: <%=@item[:start_date]%>

Then run:
nanoc compile

I get this:

Loading site data...
Compiling site...

Captain! We’ve been hit!

=== MESSAGE:

TypeError: can't modify frozen object

=== COMPILATION STACK:

(empty)

=== BACKTRACE:

0. (eval):4:in `jd'
1. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1066:in `_\_21985\_\_'
2. (eval):4:in `civil'
3. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1081:in `year'
4. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1380:in `to_s'
5. layout /default/:10:in `get_binding'
6. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/context.rb:43:in `get_binding'
7. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/filters/erb.rb:24:in `run'
8. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/result_data/item_rep.rb:400:in `layout'
9. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/compilation/item_rep_proxy.rb:68:in `layout'
10. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/compilation/rule_context.rb:67:in `layout'
11. ./Rules:25:in `load'
12. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/compilation/rule.rb:68:in `instance_eval'
13. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/compilation/rule.rb:68:in `apply_to'
14. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/compilation/compiler.rb:377:in `compile_rep'
15. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/compilation/compiler.rb:333:in `compile_reps'
16. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/compilation/compiler.rb:326:in `loop'
17. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/compilation/compiler.rb:326:in `compile_reps'
18. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/compilation/compiler.rb:85:in `run'
19. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/base/source_data/site.rb:57:in `compile'
20. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli/commands/compile.rb:61:in `run'
21. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli/command.rb:51:in `call'
22. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli/error_handler.rb:42:in `handle_while'
23. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli/error_handler.rb:23:in `handle_while'
24. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli/command.rb:50:in `call'
25. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli/command.rb:43:in `call'
26. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli/commands/compile.rb:24:in `define'
27. /Library/Ruby/Gems/1.8/gems/cri-2.0.2/lib/cri/command.rb:255:in `call'
28. /Library/Ruby/Gems/1.8/gems/cri-2.0.2/lib/cri/command.rb:255:in `run'
29. /Library/Ruby/Gems/1.8/gems/cri-2.0.2/lib/cri/command.rb:272:in `run'
30. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli.rb:40:in `run'
31. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli/error_handler.rb:42:in `handle_while'
32. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli/error_handler.rb:23:in `handle_while'
33. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/lib/nanoc3/cli.rb:37:in `run'
34. /Library/Ruby/Gems/1.8/gems/nanoc3-3.2.2/bin/nanoc3:12
35. /usr/bin/nanoc3:19:in `load'
36. /usr/bin/nanoc3:19

If you believe this is a bug in nanoc, please do report it at
--thanks!

Is this a bug?

$ nanoc --version
nanoc 3.2.2 (c) 2007-2011 Denis Defreyne.
Running ruby 1.8.7 (2010-01-10) on universal-darwin11.0 with RubyGems 1.3.6
$ ruby --version
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
$ uname -a
Darwin dhcp151118.fhcrc.org 11.1.0 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64 x86_64

Thanks!
Dan