Skip to content

Commit

Permalink
Merge pull request #86 from tokuhirom/re-workaround-for-rt-30535
Browse files Browse the repository at this point in the history
Apply workaround of rt-30535
  • Loading branch information
tokuhirom committed Jan 17, 2017
2 parents 4c5f9c1 + 6fd2072 commit c9db88a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/Crust/Runner.pm6
Expand Up @@ -76,7 +76,9 @@ method !setup() {
CompUnit::RepositoryRegistry.use-repository(CompUnit::RepositoryRegistry.repository-for-spec($_))
for @!inc;
for @!modules {
require ::($_)
# FIXME: workaround for Bug RT #130535
# ref: https://github.com/tokuhirom/p6-Crust/pull/86
EVAL "use $_";
}
}

Expand Down
7 changes: 6 additions & 1 deletion lib/Crust/Test.pm6
Expand Up @@ -9,9 +9,14 @@ $Impl ||= %*ENV<CRUST_TEST_IMPL> || "MockHTTP";
# This is workaround for the issue. We should remove following line before christmas.
use Crust::Test::MockHTTP;

use MONKEY-SEE-NO-EVAL;

method create(Crust::Test:U: Callable $app, *@args) {
my $subclass = "Crust::Test::$Impl";
require ::($subclass);

# FIXME: workaround for Bug RT #130535
# ref: https://github.com/tokuhirom/p6-Crust/pull/86
EVAL "use $subclass";

::($subclass).new(:$app); # @args
}
Expand Down
6 changes: 5 additions & 1 deletion lib/Crust/Utils.pm6
Expand Up @@ -2,6 +2,8 @@ use v6;

unit module Crust::Utils;

use MONKEY-SEE-NO-EVAL;

# internal use only. we'll change this file without notice.

sub parse-header-line(Str $header) is export {
Expand Down Expand Up @@ -54,7 +56,9 @@ sub content-length($body) is export {
}

multi sub load-class($class) is export {
require ::($class);
# FIXME: workaround for Bug RT #130535
# ref: https://github.com/tokuhirom/p6-Crust/pull/86
EVAL "use $class";
return $class;
}

Expand Down

0 comments on commit c9db88a

Please sign in to comment.