From 9d5a199f6a3f1181ec48847acec677a8a70a7db3 Mon Sep 17 00:00:00 2001 From: Krasimir Berov Date: Fri, 6 Feb 2015 00:35:34 +0100 Subject: [PATCH] #80 removed $app->home attribute Also $ENV{MOJO_HOME} is not set explicitly any more. --- Changes | 5 +++-- lib/Ado.pm | 18 ------------------ lib/Ado/Command/generate/adoplugin.pm | 2 +- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/Changes b/Changes index 7c337ca..7362864 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,8 @@ Revision history for Ado -0.79 2015-02-05 - - Implemented $app->home to better detect and set MOJO_HOME. +0.79 2015-02-06 + - $ENV{MOJO_HOME} is not set explicitly any more. + Just using app->home from Mojo. 0.78 2015-02-01 - Improved documentation. diff --git a/lib/Ado.pm b/lib/Ado.pm index 1726d71..20202ca 100644 --- a/lib/Ado.pm +++ b/lib/Ado.pm @@ -13,15 +13,6 @@ use Ado::Sessions; sub CODENAME { return $CODENAME } has sessions => sub { Ado::Sessions::get_instance(shift->config) }; -#allow many ado scripts sharing the same lib -has home => sub { - return Mojo::Home->new->detect(ref shift) if $ENV{MOJO_HOME}; - my @home = splitdir File::Basename::dirname(__FILE__); - while (pop @home) { - $ENV{MOJO_HOME} = catdir(@home) if -s catfile(@home, 'bin', 'ado'); - } - return Mojo::Home->new->detect(ref shift); -}; # This method will run once at server start sub startup { @@ -137,15 +128,6 @@ Ado inherits all attributes from Mojolicious and implements the following ones. Returns the current C. -=head2 home - - #/where/is/ado/root dir - $app->home; - -Returns the root directory into which Ado is installed. -B: This is the directory that contains C. - - =head2 sessions Access the L instance. Instantiates one of diff --git a/lib/Ado/Command/generate/adoplugin.pm b/lib/Ado/Command/generate/adoplugin.pm index 1ffec13..644efd6 100644 --- a/lib/Ado/Command/generate/adoplugin.pm +++ b/lib/Ado/Command/generate/adoplugin.pm @@ -234,7 +234,7 @@ sub register { <% %>=head1 SYNOPSIS - # <%= $ENV{MOJO_HOME}%>/etc/ado.config + # $ENV{MOJO_HOME}/etc/ado.config plugins => { # other plugins here... '<%= $name %>',