vanilla 1.15.1 → 1.16
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/lib/vanilla.rb +2 -1
- data/lib/vanilla/renderers/base.rb +2 -2
- data/lib/vanilla/routes.rb +5 -18
- data/lib/vanilla/snip_reference_parser.rb +87 -64
- data/pristine_app/Gemfile.lock +2 -2
- data/pristine_app/README +11 -0
- data/pristine_app/soups/dynasnips/current_snip.rb +7 -7
- data/pristine_app/soups/tutorial/vanilla-rb.snip +2 -2
- data/pristine_app/soups/tutorial/vanilla.snip +1 -1
- data/test/dynasnip_test.rb +13 -0
- data/test/dynasnips/link_to_current_snip_test.rb +19 -0
- data/test/dynasnips/link_to_test.rb +27 -0
- data/test/dynasnips/page_title_test.rb +19 -0
- data/test/{base_renderer_test.rb → renderers/base_renderer_test.rb} +0 -0
- data/test/{erb_renderer_test.rb → renderers/erb_renderer_test.rb} +0 -0
- data/test/{haml_renderer_test.rb → renderers/haml_renderer_test.rb} +0 -0
- data/test/{markdown_renderer_test.rb → renderers/markdown_renderer_test.rb} +0 -0
- data/test/{raw_renderer_test.rb → renderers/raw_renderer_test.rb} +0 -0
- data/test/{ruby_renderer_test.rb → renderers/ruby_renderer_test.rb} +0 -0
- data/test/{snip_reference_test.rb → snip_inclusion_test.rb} +1 -1
- data/test/snip_reference_parser_test.rb +110 -42
- data/test/vanilla_presenting_test.rb +1 -5
- metadata +46 -57
- data/lib/vanilla/snip_reference.rb +0 -754
- data/lib/vanilla/snip_reference.treetop +0 -67
- data/pristine_app/tmp/restart.txt +0 -0
- data/test/soup/blah.snip +0 -4
- data/test/soup/blah.snip.erb +0 -4
- data/test/soup/blah.snip.haml +0 -4
- data/test/soup/blah.snip.markdown +0 -4
- data/test/soup/blah.snip.rb +0 -4
- data/test/soup/blah.snip.textile +0 -4
- data/test/soup/current_snip.snip +0 -14
- data/test/soup/layout.snip +0 -4
- data/test/soup/test.snip +0 -3
- data/test/soup/test_dyna.snip +0 -7
@@ -1,67 +0,0 @@
|
|
1
|
-
grammar SnipReference
|
2
|
-
rule snip_call
|
3
|
-
"{" (snip_name) (spaces argument_list)? "}" <SnipCall>
|
4
|
-
end
|
5
|
-
|
6
|
-
rule snip_name
|
7
|
-
word "." word <SnipNameWithAttribute> /
|
8
|
-
word <SnipName>
|
9
|
-
end
|
10
|
-
|
11
|
-
rule argument_list
|
12
|
-
argument (argument_separator argument_list)? <ArgumentList>
|
13
|
-
end
|
14
|
-
|
15
|
-
rule argument
|
16
|
-
hash_argument <HashArgument> /
|
17
|
-
unquoted_words <NormalArgument> /
|
18
|
-
quoted_word <NormalArgument> /
|
19
|
-
empty_argument <EmptyArgument>
|
20
|
-
end
|
21
|
-
|
22
|
-
rule argument_separator
|
23
|
-
"," optional_spaces
|
24
|
-
end
|
25
|
-
|
26
|
-
rule hash_argument
|
27
|
-
word_or_symbol optional_spaces hash_argument_separator optional_spaces word
|
28
|
-
end
|
29
|
-
|
30
|
-
rule hash_argument_separator
|
31
|
-
"=>" /
|
32
|
-
":"
|
33
|
-
end
|
34
|
-
|
35
|
-
rule empty_argument
|
36
|
-
optional_spaces
|
37
|
-
end
|
38
|
-
|
39
|
-
rule word_or_symbol
|
40
|
-
[:]? word
|
41
|
-
end
|
42
|
-
|
43
|
-
rule word
|
44
|
-
unquoted_word / quoted_word
|
45
|
-
end
|
46
|
-
|
47
|
-
rule unquoted_word
|
48
|
-
([a-zA-Z0-9_\-]+)
|
49
|
-
end
|
50
|
-
|
51
|
-
rule quoted_word
|
52
|
-
"\"" (unquoted_words) "\"" <QuotedWord> /
|
53
|
-
"'" (unquoted_words) "'" <QuotedWord>
|
54
|
-
end
|
55
|
-
|
56
|
-
rule unquoted_words
|
57
|
-
[a-zA-Z0-9_\- ]+
|
58
|
-
end
|
59
|
-
|
60
|
-
rule optional_spaces
|
61
|
-
[ ]*
|
62
|
-
end
|
63
|
-
|
64
|
-
rule spaces
|
65
|
-
[ ]+
|
66
|
-
end
|
67
|
-
end
|
File without changes
|
data/test/soup/blah.snip
DELETED
data/test/soup/blah.snip.erb
DELETED
data/test/soup/blah.snip.haml
DELETED
data/test/soup/blah.snip.rb
DELETED
data/test/soup/blah.snip.textile
DELETED
data/test/soup/current_snip.snip
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
CurrentSnip
|
2
|
-
|
3
|
-
:usage: |-
|
4
|
-
The current_snip dyna normally returns the result of rendering the snip named by the
|
5
|
-
'snip' value in the parameters. This way, it can be used in templates to place the currently
|
6
|
-
requested snip, in its rendered form, within the page.
|
7
|
-
|
8
|
-
It can also be used to determine the name of the current snip in a consistent way:
|
9
|
-
|
10
|
-
{current_snip name}
|
11
|
-
|
12
|
-
will output the name of the current snip, or the name of the snip currently being edited.
|
13
|
-
:render_as: Ruby
|
14
|
-
:name: current_snip
|
data/test/soup/layout.snip
DELETED
data/test/soup/test.snip
DELETED