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:
- 1494 Bytes
1 | class NoCachePage < Page |
2 | description 'Turns caching off for testing.' |
3 | |
4 | def cache? |
5 | false |
6 | end |
7 | end |
8 | |
9 | unless defined?(::CustomFileNotFoundPage) |
10 | class ::CustomFileNotFoundPage < FileNotFoundPage |
11 | end |
12 | end |
13 | |
14 | class TestPage < Page |
15 | description 'this is just a test page' |
16 | |
17 | tag 'test1' do |
18 | 'Hello world!' |
19 | end |
20 | |
21 | tag 'test2' do |
22 | 'Another test.' |
23 | end |
24 | |
25 | def headers |
26 | { |
27 | 'cool' => 'beans', |
28 | 'request' => @request.inspect[20..30], |
29 | 'response' => @response.inspect[20..31] |
30 | } |
31 | end |
32 | |
33 | end |
34 | |
35 | class VirtualPage < Page |
36 | def virtual? |
37 | true |
38 | end |
39 | end |
40 | |
41 | module PageTestHelper |
42 | |
43 | VALID_PAGE_PARAMS = { |
44 | :title => 'New Page', |
45 | :slug => 'page', |
46 | :breadcrumb => 'New Page', |
47 | :status_id => '1', |
48 | :parent_id => nil |
49 | } |
50 | |
51 | def page_params(options = {}) |
52 | params = VALID_PAGE_PARAMS.dup |
53 | params.merge!(:title => @page_title) if @page_title |
54 | params.merge!(:status_id => '5') |
55 | params.merge!(options) |
56 | end |
57 | |
58 | def destroy_test_page(title = @page_title) |
59 | while page = get_test_page(title) do |
60 | page.destroy |
61 | end |
62 | end |
63 | |
64 | def get_test_page(title = @page_title) |
65 | Page.find_by_title(title) |
66 | end |
67 | |
68 | def create_test_page(options = {}) |
69 | options[:title] ||= @page_title |
70 | klass = options.delete(:class_name) || Page |
71 | klass = Kernel.eval(klass) if klass.kind_of? String |
72 | page = klass.new page_params(options) |
73 | if page.save |
74 | page |
75 | else |
76 | raise "page <#{page.inspect}> could not be saved" |
77 | end |
78 | end |
79 | end |