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:
- 1465 Bytes
1 | class SnippetsDataset < Dataset::Base |
2 | |
3 | def load |
4 | create_snippet "first", :content => "test" |
5 | create_snippet "another", :content => "another test" |
6 | create_snippet "markdown", :filter_id => "Markdown", :content => "**markdown**" |
7 | create_snippet "radius", :content => "<r:title />" |
8 | create_snippet "global_page_cascade", :content => "<r:children:each><r:page:title /> </r:children:each>" |
9 | create_snippet "recursive", :content => "<r:children:each><r:snippet name='recursive' /></r:children:each><r:title />" |
10 | create_snippet "yielding", :content => "Before...<r:yield/>...and after" |
11 | create_snippet "div_wrap", :content => "<div><r:yield/></div>" |
12 | create_snippet "nested_yields", :content => '<snippet name="div_wrap">above <r:yield/> below</snippet>' |
13 | create_snippet "yielding_often", :content => '<r:yield/> is <r:yield/>er than <r:yield/>' |
14 | end |
15 | |
16 | helpers do |
17 | def create_snippet(name, attributes={}) |
18 | create_record :snippet, name.symbolize, snippet_params(attributes.reverse_merge(:name => name)) |
19 | end |
20 | |
21 | def snippet_params(attributes={}) |
22 | name = attributes[:name] || unique_snippet_name |
23 | { |
24 | :name => name, |
25 | :content => "<r:content />" |
26 | }.merge(attributes) |
27 | end |
28 | |
29 | private |
30 | |
31 | @@unique_snippet_name_call_count = 0 |
32 | def unique_snippet_name |
33 | @@unique_snippet_name_call_count += 1 |
34 | "snippet-#{@@unique_snippet_name_call_count}" |
35 | end |
36 | end |
37 | |
38 | end |