diff options
author | murphy <murphy@rubychan.de> | 2006-04-10 03:06:50 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2006-04-10 03:06:50 +0000 |
commit | 5ee15661dbc2da70927f588e310315233aff6eea (patch) | |
tree | 08c959a52080e4cbcc873b49c8e5f1ed42a75ccf /test/rhtml | |
parent | 132b75e58dba4c93278721d60f177cfbee7d0e46 (diff) | |
download | coderay-5ee15661dbc2da70927f588e310315233aff6eea.tar.gz |
Large update: Scanners for HTML, RHTML and Nitro-XHTML added.
CSS style changes/enhancments (mainly the new background color for inline code, affects all Ruby code.)
Demos and tests adjusted.
Plugin: new PluginHost::default method.
Scanner:
- New setup method
- ability to re-use a scanner
- ability to keep the tokens
- minor changes to token caching and string flattening
Encoder: Error if token content is neither String nor Symbol.
HTML encoder:
- more warnings for unclosed tokens
- output now UTF-8
Ruby Scanner:
- bug: symbols before => now do not include =; {:foo=>bar} is valid Ruby code
- try to close all open tokens
- constants now all with specific namespace (for speed, I hope)
Styles: new :entity/en class.
Test suite now gives hinted HTML output.
Diffstat (limited to 'test/rhtml')
-rw-r--r-- | test/rhtml/day.in.rhtml | 26 | ||||
-rw-r--r-- | test/rhtml/day.out.raydebug | 26 | ||||
-rw-r--r-- | test/rhtml/suite.rb | 9 |
3 files changed, 61 insertions, 0 deletions
diff --git a/test/rhtml/day.in.rhtml b/test/rhtml/day.in.rhtml new file mode 100644 index 0000000..12ebe82 --- /dev/null +++ b/test/rhtml/day.in.rhtml @@ -0,0 +1,26 @@ +<% day, auftritte = *day -%>
+<%
+ for auftritt in auftritte
+-%>
+
+<tr>
+ <td class="pplan_datum">
+ <%= colorize day.to_s(:dots) if day %>
+ <% if day and day.wday == 6 %><br /><em>Samstag</em><% end %>
+ </td>
+ <td class="pplan_zeit">
+ <%= colorize auftritt.time %>
+ </td>
+ <td class="pplan_stueck">
+ <%= colorize auftritt.program %>
+ <%= link_to 'E', :controller => 'admin/auftritte', :action => :edit, :id => auftritt %>
+ </td>
+ <td class="pplan_besetzung">
+ <%= colorize(auftritt.place, 'Ort: ') + '<br />' unless auftritt.place.blank? %>
+ </td>
+</tr>
+
+<%
+ day = nil
+ end
+-%>
diff --git a/test/rhtml/day.out.raydebug b/test/rhtml/day.out.raydebug new file mode 100644 index 0000000..e4fe996 --- /dev/null +++ b/test/rhtml/day.out.raydebug @@ -0,0 +1,26 @@ +inline<delimiter(<%) ident(day)operator(,) ident(auftritte) operator(=) operator(*)ident(day) operator(-)delimiter(%>)>
+inline<delimiter(<%)
+ reserved(for) ident(auftritt) reserved(in) ident(auftritte)
+operator(-)delimiter(%>)>
+
+tag(<tr>)
+ tag(<td) attribute_name(class)operator(=)string<delimiter(")content(pplan_datum)delimiter(")>tag(>)
+ inline<delimiter(<%=) ident(colorize) ident(day)operator(.)ident(to_s)operator(()symbol(:dots)operator(\)) reserved(if) ident(day) delimiter(%>)>
+ inline<delimiter(<%) reserved(if) ident(day) reserved(and) ident(day)operator(.)ident(wday) operator(==) integer(6) delimiter(%>)>tag(<br) tag(/>)tag(<em>)plain(Samstag)tag(</em>)inline<delimiter(<%) reserved(end) delimiter(%>)>
+ tag(</td>)
+ tag(<td) attribute_name(class)operator(=)string<delimiter(")content(pplan_zeit)delimiter(")>tag(>)
+ inline<delimiter(<%=) ident(colorize) ident(auftritt)operator(.)ident(time) delimiter(%>)>
+ tag(</td>)
+ tag(<td) attribute_name(class)operator(=)string<delimiter(")content(pplan_stueck)delimiter(")>tag(>)
+ inline<delimiter(<%=) ident(colorize) ident(auftritt)operator(.)ident(program) delimiter(%>)>
+ inline<delimiter(<%=) ident(link_to) string<delimiter(')content(E)delimiter(')>operator(,) symbol(:controller) operator(=)operator(>) string<delimiter(')content(admin/auftritte)delimiter(')>operator(,) symbol(:action) operator(=)operator(>) symbol(:edit)operator(,) symbol(:id) operator(=)operator(>) ident(auftritt) delimiter(%>)>
+ tag(</td>)
+ tag(<td) attribute_name(class)operator(=)string<delimiter(")content(pplan_besetzung)delimiter(")>tag(>)
+ inline<delimiter(<%=) ident(colorize)operator(()ident(auftritt)operator(.)ident(place)operator(,) string<delimiter(')content(Ort: )delimiter(')>operator(\)) operator(+) string<delimiter(')content(<br />)delimiter(')> reserved(unless) ident(auftritt)operator(.)ident(place)operator(.)ident(blank?) delimiter(%>)>
+ tag(</td>)
+tag(</tr>)
+
+inline<delimiter(<%)
+ ident(day) operator(=) pre_constant(nil)
+ reserved(end)
+operator(-)delimiter(%>)>
diff --git a/test/rhtml/suite.rb b/test/rhtml/suite.rb new file mode 100644 index 0000000..95eb0e6 --- /dev/null +++ b/test/rhtml/suite.rb @@ -0,0 +1,9 @@ +class RHTMLTest < CodeRaySuite
+
+ @file = __FILE__
+ LANG = :rhtml
+ EXTENSION = 'rhtml'
+
+end
+
+$suite << RHTMLTest.suite if $suite
|