1Mojo::Home(3)         User Contributed Perl Documentation        Mojo::Home(3)
2
3
4

NAME

6       Mojo::Home - Detect And Access The Project Root Directory In Mojo
7

SYNOPSIS

9           use Mojo::Home;
10
11           my $home = Mojo::Home->new;
12           $home->detect;
13

DESCRIPTION

15       Mojo::Home is a container for home directories.
16

ATTRIBUTES

18       Mojo::Home implements the following attributes.
19
20   "app_class"
21           my $class = $home->app_class;
22           $home     = $home->app_class('Foo::Bar');
23
24       Application class.
25

METHODS

27       Mojo::Home inherits all methods from Mojo::Base and implements the
28       following new ones.
29
30   "detect"
31           $home = $home->detect;
32           $home = $home->detect('My::App');
33
34       Detect home directory from application class.
35
36   "lib_dir"
37           my $path = $home->lib_dir;
38
39       Path to "lib" directory.
40
41   "list_files"
42           my $files = $home->list_files;
43           my $files = $home->list_files('foo/bar');
44
45       List all files in directory and subdirectories recursively.
46
47   "parse"
48           $home = $home->parse('/foo/bar');
49
50       Parse path.
51
52   "rel_dir"
53           my $path = $home->rel_dir('foo/bar');
54
55       Generate absolute path for relative directory.
56
57   "rel_file"
58           my $path = $home->rel_file('foo/bar.html');
59
60       Generate absolute path for relative file.
61
62   "to_string"
63           my $string = $home->to_string;
64           my $string = "$home";
65
66       Home directory.
67

SEE ALSO

69       Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
70
71
72
73perl v5.12.3                      2010-08-12                     Mojo::Home(3)
Impressum