[Bps-public-commit] Prophet branch, master, updated. 1035b7098f7758691e95b6c726f0b4a2e0ccc90e
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Mon Aug 10 23:34:23 EDT 2009
The branch, master has been updated
via 1035b7098f7758691e95b6c726f0b4a2e0ccc90e (commit)
from 4078e13ebdbedca8fad3321f31346d7482d1de4a (commit)
Summary of changes:
lib/Prophet/App.pm | 3 ++-
lib/Prophet/Replica.pm | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit 1035b7098f7758691e95b6c726f0b4a2e0ccc90e
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Aug 11 11:34:14 2009 +0800
tweak url handle so we can treat file on win nicely
diff --git a/lib/Prophet/App.pm b/lib/Prophet/App.pm
index b572361..4e8b1ef 100644
--- a/lib/Prophet/App.pm
+++ b/lib/Prophet/App.pm
@@ -13,7 +13,8 @@ has handle => (
my $self = shift;
if ( defined $self->local_replica_url
- && $self->local_replica_url !~ /^[\w\+]+\:/ ) {
+ && $self->local_replica_url !~ /^[\w\+]{2,}\:/ ) {
+# the reason why we need {2,} is to not match name on windows, e.g. C:\foo
my $path = $self->local_replica_url;
$path = File::Spec->rel2abs(glob($path)) unless File::Spec->file_name_is_absolute($path);
$self->local_replica_url("file://$path");
diff --git a/lib/Prophet/Replica.pm b/lib/Prophet/Replica.pm
index 7aa4d3c..e1d59a1 100644
--- a/lib/Prophet/Replica.pm
+++ b/lib/Prophet/Replica.pm
@@ -130,7 +130,7 @@ sub _url_to_replica_class {
my $self = shift;
my %args = (@_);
my $url = $args{'url'};
- my ( $scheme, $real_url ) = $url =~ /^([^:]*):(.*)$/;
+ my ( $scheme, $real_url ) = $url =~ /^([^:]*?):(.*)$/;
return undef unless $scheme;
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list