Thanks... setting the code page to UTF-8 worked!
Is there an overview somewhere of incompatibilities with older nanoc
code?
The following doesn't compile, it complains about "@item[:limit] ||=
10"
def prepare_feed(params)
# Extract parameters
@item[:limit] ||= 10
@item[:articles] = @site.sorted_articles[0, 10]
#@item[:articles] = params[:articles] || latest_articles(10) || []
@item[:content_proc] = params[:content_proc] || lambda { |a|
a.reps[0].content_at_snapshot(:pre)}
@item[:excerpt_proc] = params[:excerpt_proc] || lambda { |a|
a[:excerpt] }
@item[:author_uri] ||= @site.config[:base_url]
@item[:author_name] ||= @site.config[:author_name]
raise RuntimeError.new('Cannot build feed: site configuration has no
base_url') if @site.config[:base_url].nil?
raise RuntimeError.new('Cannot build feed: feed item has no title')
if @item[:title].nil?
raise RuntimeError.new('Cannot build feed: no articles') if
@item[:articles].empty?
raise RuntimeError.new('Cannot build feed: one or more articles doesn
\'t have a date') if @item[:articles].any? { |a| a[:created_at].nil? }
@item[:last] = @item[:articles].first
end
Here's the output:
Loading site data...
Compiling site...
create [0.42s] output/about/index.html
Captain! We’ve been hit!
=== MESSAGE:
RuntimeError: can't modify frozen hash
You attempted to modify immutable data. Some data, such as item/layout
attribute
s and raw item/layout content, can not be modified once compilation
has started.
(This was unintentionally possible in 3.1.x and before, but has been
disabled i
n 3.2.x in order to allow compiler optimisations.)
=== COMPILATION STACK:
(empty)
=== BACKTRACE:
0. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
source_data/
item.rb:201:in `[]='
1. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
source_data/
item.rb:201:in `[]='
2. lib/default.rb:32:in `prepare_feed'
3. lib/default.rb:86:in `atom_feed'
4. item /atom/ (rep default):1:in `get_binding'
5. C:/Ruby192/lib/ruby/1.9.1/erb.rb:753:in `eval'
6. C:/Ruby192/lib/ruby/1.9.1/erb.rb:753:in `result'
7. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/filters/
erb.rb:34
:in `run'
8. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
result_data/
item_rep.rb:344:in `filter'
9. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
compilation/
item_rep_proxy.rb:47:in `filter'
10. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
compilation
/rule_context.rb:54:in `filter'
11. ./Rules:15:in `block in load'
12. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
compilation
/rule.rb:68:in `instance_eval'
13. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
compilation
/rule.rb:68:in `apply_to'
14. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
compilation
/compiler.rb:379:in `compile_rep'
15. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
compilation
/compiler.rb:332:in `block in compile_reps'
16. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
compilation
/compiler.rb:325:in `loop'
17. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
compilation
/compiler.rb:325:in `compile_reps'
18. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
compilation
/compiler.rb:85:in `run'
19. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/base/
source_data
/site.rb:57:in `compile'
20. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/cli/
commands/com
pile.rb:57:in `run'
21. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/cli/
command_runn
er.rb:14:in `block in call'
22. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/cli/
error_handle
r.rb:42:in `handle_while'
23. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/cli/
error_handle
r.rb:23:in `handle_while'
24. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/cli/
command_runn
er.rb:13:in `call'
25. C:/Ruby192/lib/ruby/gems/1.9.1/gems/cri-2.2.0/lib/cri/
command_dsl.rb:175:i
n `block in runner'
26. C:/Ruby192/lib/ruby/gems/1.9.1/gems/cri-2.2.0/lib/cri/command.rb:
291:in `c
all'
27. C:/Ruby192/lib/ruby/gems/1.9.1/gems/cri-2.2.0/lib/cri/command.rb:
291:in `r
un_this'
28. C:/Ruby192/lib/ruby/gems/1.9.1/gems/cri-2.2.0/lib/cri/command.rb:
244:in `r
un'
29. C:/Ruby192/lib/ruby/gems/1.9.1/gems/cri-2.2.0/lib/cri/command.rb:
257:in `r
un'
30. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/cli.rb:
44:in `bl
ock in run'
31. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/cli/
error_handle
r.rb:42:in `handle_while'
32. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/cli/
error_handle
r.rb:23:in `handle_while'
33. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/lib/nanoc/cli.rb:
41:in `ru
n'
34. C:/Ruby192/lib/ruby/gems/1.9.1/gems/nanoc-3.3.1/bin/nanoc:19:in
`<top (req
uired)>'
35. C:/Ruby192/bin/nanoc:19:in `load'
36. C:/Ruby192/bin/nanoc:19:in `<main>'
=== VERSION INFORMATION:
nanoc 3.3.1 (c) 2007-2012 Denis Defreyne.
Running ruby 1.9.2 (2011-02-18) on i386-mingw32 with RubyGems 1.5.2.
If you believe this is a bug in nanoc, please do report it at
<
https://github.com/ddfreyne/nanoc/issues/new>--thanks!
On Feb 22, 4:46 am, Denis Defreyne <
denis.defre...@stoneship.org>
wrote:
> signature.asc
> < 1KViewDownload