Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 1073 Bytes
1 | class PageContext < Radius::Context |
2 | |
3 | attr_reader :page |
4 | |
5 | def initialize(page) |
6 | super() |
7 | @page = page |
8 | globals.page = @page |
9 | page.tags.each do |name| |
10 | define_tag(name) { |tag_binding| page.render_tag(name, tag_binding) } |
11 | end |
12 | end |
13 | |
14 | def render_tag(name, attributes = {}, &block) |
15 | binding = @tag_binding_stack.last |
16 | locals = binding ? binding.locals : globals |
17 | set_process_variables(locals.page) |
18 | super |
19 | rescue Exception => e |
20 | raise e if raise_errors? |
21 | @tag_binding_stack.pop unless @tag_binding_stack.last == binding |
22 | render_error_message(e.message) |
23 | end |
24 | |
25 | def tag_missing(name, attributes = {}, &block) |
26 | super |
27 | rescue Radius::UndefinedTagError => e |
28 | raise StandardTags::TagError.new(e.message) |
29 | end |
30 | |
31 | private |
32 | |
33 | def render_error_message(message) |
34 | "<div><strong>#{message}</strong></div>" |
35 | end |
36 | |
37 | def set_process_variables(page) |
38 | page.request ||= @page.request |
39 | page.response ||= @page.response |
40 | end |
41 | |
42 | def raise_errors? |
43 | RAILS_ENV != 'production' |
44 | end |
45 | |
46 | end |