v2.0.3
+ * added initial blosxom.spec and supporting files in rpm directory
* added support for multiple plugin directories using $plugin_path
* changed plugin loading to use @INC instead of hardcoded
$plugin_dir
# Define default interpolation subroutine
$interpolate = sub {
-
package blosxom;
my $template = shift;
- $template =~ s/(\$\w+(?:::\w+)*)/"defined $1 ? $1 : ''"/gee;
+ # Interpolate scalars, namespaced scalars, and hash/hashref scalars
+ $template =~ s/(\$\w+(?:::\w+)*(?:(?:->)?{(['"]?)[-\w]+\2})?)/"defined $1 ? $1 : ''"/gee;
return $template;
};
01_templates.t
02_smoketest.t
03_permalinks.t
+03_interpolate.t
04_plugin_dir.t
04_plugin_list.t
--- /dev/null
+$blog_title = 'Interpolation Testing';
+$blog_description = 'Terpolation Turpentine';
+$datadir = "$ENV{BLOSXOM_CONFIG_DIR}/../data";
+use vars qw(%hash $hashref $hash);
+%hash = (
+ abc => 123,
+ def => 456,
+ 'X-Factor' => 789,
+);
+$hashref = {
+ abc => 123,
+ def => 456,
+ 'X-Factor' => 789,
+};
+$Blosxom::Test::string = 'this is a test';
+%Blosxom::Test::hash = (
+ abc => 123,
+ def => 456,
+ 'X-Factor' => 789,
+);
+$Blosxom::Test::hashref = {
+ abc => 123,
+ def => 456,
+ 'X-Factor' => 789,
+};
+# Silence $hash warnings
+$hash = '';
+
+1;
--- /dev/null
+text/xhtml; charset=UTF-8
--- /dev/null
+ <h3>$yr-$mo_num-$da</h3>
--- /dev/null
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+</head>
+<body>
+<pre>
+# Basic scalars
+title: $blog_title
+description: $blosxom::blog_description
+# Namespaced scalars
+Blosxom::Test::string: $Blosxom::Test::string
+# Hash values
+hash{abc}: $hash{abc}
+hash{'X-Factor'}: $hash{'X-Factor'}
+blosxom::hash{def}: $blosxom::hash{def}
+blosxom::hash{"X-Factor"}: $blosxom::hash{"X-Factor"}
+hashref->{abc}: $hashref->{abc}
+blosxom::hashref->{def}: $blosxom::hashref->{def}
+Blosxom::Test::hash{abc}: $Blosxom::Test::hash{abc}
+Blosxom::Test::hash{'X-Factor'}: $Blosxom::Test::hash{'X-Factor'}
+Blosxom::Test::hashref->{def}: $Blosxom::Test::hashref->{def}
+Blosxom::Test::hashref->{"X-Factor"}: $Blosxom::Test::hashref->{"X-Factor"}
+# Bad quoting with hash values
+hash{'X-Factor}: $hash{'X-Factor}
+hash{X-Factor'}: $hash{X-Factor'}
+hash{"X-Factor'}: $hash{"X-Factor'}
+</pre>
--- /dev/null
+ <h4><a name="$fn">$title</a></h4>
+ <div>$body</div>
+ <p>posted at: $ti | path: <a href="$url$path">$path </a> | <a href="$url/$yr/$mo_num/$da#$fn">permanent link to this entry</a></p>
--- /dev/null
+Content-Type: text/xhtml; charset=UTF-8\r
+\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+</head>
+<body>
+<pre>
+# Basic scalars
+title: Interpolation Testing
+description: Terpolation Turpentine
+# Namespaced scalars
+Blosxom::Test::string: this is a test
+# Hash values
+hash{abc}: 123
+hash{'X-Factor'}: 789
+blosxom::hash{def}: 456
+blosxom::hash{"X-Factor"}: 789
+hashref->{abc}: 123
+blosxom::hashref->{def}: 456
+Blosxom::Test::hash{abc}: 123
+Blosxom::Test::hash{'X-Factor'}: 789
+Blosxom::Test::hashref->{def}: 456
+Blosxom::Test::hashref->{"X-Factor"}: 789
+# Bad quoting with hash values
+hash{'X-Factor}: {'X-Factor}
+hash{X-Factor'}: {X-Factor'}
+hash{"X-Factor'}: {"X-Factor'}
+</pre>
+</body>
+</html>
--- /dev/null
+tests:
+ -
+ - ""
+ - expected.html