[Rt-commit] [svn] r1154 - in mzscheme: .
Language-MzScheme/lib/Language/MzScheme
Language-MzScheme/script RT-ML RT-ML/html RT-ML/html/RTML
autrijus at pallas.eruditorum.org
autrijus at pallas.eruditorum.org
Sun Jun 27 09:12:50 EDT 2004
Author: autrijus
Date: Sun Jun 27 09:12:49 2004
New Revision: 1154
Added:
mzscheme/RT-ML/
mzscheme/RT-ML/README
mzscheme/RT-ML/html/
mzscheme/RT-ML/html/RTML/
mzscheme/RT-ML/html/RTML/dhandler
Modified:
mzscheme/ (props changed)
mzscheme/Language-MzScheme/lib/Language/MzScheme/Object.pm
mzscheme/Language-MzScheme/script/mzperl
Log:
----------------------------------------------------------------------
r5794 at not: autrijus | 2004-06-27T13:06:59.082421Z
* first cut of RT::ML that works as a wiki
----------------------------------------------------------------------
Modified: mzscheme/Language-MzScheme/lib/Language/MzScheme/Object.pm
==============================================================================
--- mzscheme/Language-MzScheme/lib/Language/MzScheme/Object.pm (original)
+++ mzscheme/Language-MzScheme/lib/Language/MzScheme/Object.pm Sun Jun 27 09:12:49 2004
@@ -196,7 +196,7 @@
sub as_write {
my $self = shift;
my $out = S->make_string_output_port;
- S->display($self, $out);
+ S->write($self, $out);
return S->get_string_output($out);
}
Modified: mzscheme/Language-MzScheme/script/mzperl
==============================================================================
--- mzscheme/Language-MzScheme/script/mzperl (original)
+++ mzscheme/Language-MzScheme/script/mzperl Sun Jun 27 09:12:49 2004
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-use Language::MzScheme;
+require Language::MzScheme;
=head1 NAME
Added: mzscheme/RT-ML/README
==============================================================================
--- (empty file)
+++ mzscheme/RT-ML/README Sun Jun 27 09:12:49 2004
@@ -0,0 +1,23 @@
+This is the README file for RT::ML, the "RT/MzScheme Layout" project.
+
+Please type "perldoc RT::ML" after installation to see the module usage
+information.
+
+* Installation
+
+RT::ML uses the standard perl module install process:
+
+cpansign -v # optional; see SIGNATURE for details
+perl Makefile.PL
+make # or 'nmake' on Win32
+make test
+make install
+
+* Copyright
+
+Copyright 2004 by Autrijus Tang <autrijus at autrijus.org>.
+
+All rights reserved. You can redistribute and/or modify
+this bundle under the same terms as Perl itself.
+
+See <http://www.perl.com/perl/misc/Artistic.html>.
Added: mzscheme/RT-ML/html/RTML/dhandler
==============================================================================
--- (empty file)
+++ mzscheme/RT-ML/html/RTML/dhandler Sun Jun 27 09:12:49 2004
@@ -0,0 +1,56 @@
+%# RTML/Mason Bridge
+<% $out |n %>
+<%ONCE>
+require Language::MzScheme;
+my $env = Language::MzScheme->new;
+$env->eval(<<'.');
+(current-library-collection-paths
+ '("/usr/local/drscheme/collects" "/usr/local/mz/collects"))
+(require (lib "xml.ss" "webit")
+ (lib "html.ss" "webit")
+ (lib "css.ss" "webit"))
+.
+</%ONCE>
+<%INIT>
+my $path = $m->dhandler_arg;
+my $show = <<'.';
+(let ((str (open-output-string)))
+ (parameterize ((current-output-port str)) (write-xml [h4:body %s]))
+ (get-output-string str))
+.
+# XXX - switch to a real table instead of using attributes
+my $xml;
+if ( my ($attr) = $RT::SystemUser->Attributes->Named("RTML-$path") ) {
+ $attr->SetContent($text) if defined $text;
+ $xml = $attr->Content;
+}
+elsif (defined $text) {
+ $RT::SystemUser->AddAttribute( Name => "RTML-$path", Content => $text );
+ $xml = $text;
+}
+
+my $escaped_xml = $xml;
+$escaped_xml =~ s{(?=[\\"])}{\\}g; # "
+my $form = sprintf(<<'.', $escaped_xml);
+[h4:hr]
+[h4:form
+ h4:action:""
+ h4:method:"POST"
+ [h4:textarea
+ h4:name:"text"
+ h4:rows:"20"
+ h4:cols:"80"
+ "%s"]
+ [h4:br]
+ [h4:input
+ h4:type:"submit"]
+]
+.
+
+my $out = $env->eval(sprintf($show, $form));
+$out = $env->eval(sprintf($show, $xml)) . $out if defined $xml;
+
+</%INIT>
+<%ARGS>
+$text => undef
+</%ARGS>
More information about the Rt-commit
mailing list