vanilla 1.15.1 → 1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/Rakefile +2 -2
  2. data/lib/vanilla.rb +2 -1
  3. data/lib/vanilla/renderers/base.rb +2 -2
  4. data/lib/vanilla/routes.rb +5 -18
  5. data/lib/vanilla/snip_reference_parser.rb +87 -64
  6. data/pristine_app/Gemfile.lock +2 -2
  7. data/pristine_app/README +11 -0
  8. data/pristine_app/soups/dynasnips/current_snip.rb +7 -7
  9. data/pristine_app/soups/tutorial/vanilla-rb.snip +2 -2
  10. data/pristine_app/soups/tutorial/vanilla.snip +1 -1
  11. data/test/dynasnip_test.rb +13 -0
  12. data/test/dynasnips/link_to_current_snip_test.rb +19 -0
  13. data/test/dynasnips/link_to_test.rb +27 -0
  14. data/test/dynasnips/page_title_test.rb +19 -0
  15. data/test/{base_renderer_test.rb → renderers/base_renderer_test.rb} +0 -0
  16. data/test/{erb_renderer_test.rb → renderers/erb_renderer_test.rb} +0 -0
  17. data/test/{haml_renderer_test.rb → renderers/haml_renderer_test.rb} +0 -0
  18. data/test/{markdown_renderer_test.rb → renderers/markdown_renderer_test.rb} +0 -0
  19. data/test/{raw_renderer_test.rb → renderers/raw_renderer_test.rb} +0 -0
  20. data/test/{ruby_renderer_test.rb → renderers/ruby_renderer_test.rb} +0 -0
  21. data/test/{snip_reference_test.rb → snip_inclusion_test.rb} +1 -1
  22. data/test/snip_reference_parser_test.rb +110 -42
  23. data/test/vanilla_presenting_test.rb +1 -5
  24. metadata +46 -57
  25. data/lib/vanilla/snip_reference.rb +0 -754
  26. data/lib/vanilla/snip_reference.treetop +0 -67
  27. data/pristine_app/tmp/restart.txt +0 -0
  28. data/test/soup/blah.snip +0 -4
  29. data/test/soup/blah.snip.erb +0 -4
  30. data/test/soup/blah.snip.haml +0 -4
  31. data/test/soup/blah.snip.markdown +0 -4
  32. data/test/soup/blah.snip.rb +0 -4
  33. data/test/soup/blah.snip.textile +0 -4
  34. data/test/soup/current_snip.snip +0 -14
  35. data/test/soup/layout.snip +0 -4
  36. data/test/soup/test.snip +0 -3
  37. 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
@@ -1,4 +0,0 @@
1
-
2
-
3
- :name: blah
4
- :render_as: Raw
@@ -1,4 +0,0 @@
1
-
2
-
3
- :extension: erb
4
- :name: blah
@@ -1,4 +0,0 @@
1
-
2
-
3
- :extension: haml
4
- :name: blah
@@ -1,4 +0,0 @@
1
-
2
-
3
- :extension: markdown
4
- :name: blah
@@ -1,4 +0,0 @@
1
-
2
-
3
- :extension: rb
4
- :name: blah
@@ -1,4 +0,0 @@
1
-
2
-
3
- :extension: textile
4
- :name: blah
@@ -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
- &#123;current_snip name&#125;
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
@@ -1,4 +0,0 @@
1
- {current_snip}
2
-
3
- :render_as: Base
4
- :name: layout
data/test/soup/test.snip DELETED
@@ -1,3 +0,0 @@
1
- test
2
-
3
- :name: test
@@ -1,7 +0,0 @@
1
- TestDyna
2
-
3
- :render_as: Ruby
4
- :created_at: 2011-04-16 21:49:54 +01:00
5
- :updated_at: 2011-04-16 21:49:54 +01:00
6
- :test_attribute: altered content
7
- :name: test_dyna