Skip to content

Commit

Permalink
CPAN Release 0.52
Browse files Browse the repository at this point in the history
- Fix file path creation issues on MSWin32
  • Loading branch information
ingydotnet committed Dec 27, 2014
1 parent 80bda24 commit 7bf3fc8
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
@@ -1,6 +1,6 @@
# DO NOT EDIT
#
# This .travis.yml file generated by Zilla-Dist-0.0.175.
# This .travis.yml file generated by Zilla-Dist-0.0.180.
#
# To update it, run:
#
Expand All @@ -25,11 +25,10 @@ install:
Pegex

script:
- test -e test &&
- true && [ ! -e test/ ] ||
PERL5OPT=-MDevel::Cover=-coverage,statement,branch,condition,path,subroutine
prove -lv test/
|| true
- test -e test && cover || true
- true && [ ! -e test/ ] || cover

after_success:
- cover -report coveralls
Expand Down
2 changes: 1 addition & 1 deletion About
Expand Up @@ -93,4 +93,4 @@ for up-to-date instructions.



# This file generated by Zilla-Dist-0.0.175
# This file generated by Zilla-Dist-0.0.180
5 changes: 5 additions & 0 deletions Changes
@@ -1,4 +1,9 @@
---
version: 0.52
date: Sat Dec 27 14:45:50 PST 2014
changes:
- Fix file path creation issues on MSWin32
---
version: 0.51
date: Sun Dec 14 12:53:02 PST 2014
changes:
Expand Down
2 changes: 1 addition & 1 deletion Meta
@@ -1,7 +1,7 @@
=meta: 0.0.2

name: TestML
version: 0.51
version: 0.52
abstract: A Generic Software Testing Meta Language
homepage: http://testml.org
language: perl
Expand Down
2 changes: 1 addition & 1 deletion lib/TestML.pm
@@ -1,7 +1,7 @@
package TestML;

use TestML::Base;
our $VERSION = '0.51';
our $VERSION = '0.52';

has runtime => ();
has compiler => ();
Expand Down
13 changes: 8 additions & 5 deletions lib/TestML/Runtime.pm
Expand Up @@ -13,10 +13,13 @@ has error => ();
has global => ();
has base => ();

use File::Basename();
use File::Spec();

sub BUILD {
my ($self) = @_;
$TestML::Runtime::Singleton = $self;
$self->{base} ||= $0 =~ m!(.*)/! ? $1 : ".";
$self->{base} ||= File::Basename::dirname($0);
}

sub run {
Expand Down Expand Up @@ -224,9 +227,9 @@ sub compile_testml {
die "'testml' document required but not found"
unless $self->testml;
if ($self->testml !~ /\n/) {
$self->testml =~ /(?:(.*)\/)?(.*)/ or die;
$self->{testml} = $2;
$self->{base} .= '/' . $1 if $1;
my ($file, $dir) = File::Basename::fileparse($self->testml);
$self->{testml} = $file;
$self->{base} = File::Spec->catdir($self->{base}, $dir);
$self->{testml} = $self->read_testml_file($self->testml);
}
$self->{function} = $self->compiler->new->compile($self->testml)
Expand Down Expand Up @@ -281,7 +284,7 @@ sub replace_label {

sub read_testml_file {
my ($self, $file) = @_;
my $path = $self->base . '/' . $file;
my $path = File::Spec->catfile($self->base, $file);
open my $fh, $path
or die "Can't open '$path' for input: $!";
local $/;
Expand Down

0 comments on commit 7bf3fc8

Please sign in to comment.