Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mojo::home(3pm) [debian man page]

Mojo::Home(3pm) 					User Contributed Perl Documentation					   Mojo::Home(3pm)

NAME
Mojo::Home - Detect and access the project root directory in Mojo SYNOPSIS
use Mojo::Home; my $home = Mojo::Home->new; $home->detect; DESCRIPTION
Mojo::Home is a container for home directories. ATTRIBUTES
Mojo::Home implements the following attributes. "app_class" my $class = $home->app_class; $home = $home->app_class('Foo::Bar'); Application class. METHODS
Mojo::Home inherits all methods from Mojo::Base and implements the following new ones. "new" my $home = Mojo::Home->new; my $home = Mojo::Home->new('/home/sri/myapp'); Construct a new Mojo::Home object. "detect" $home = $home->detect; $home = $home->detect('My::App'); Detect home directory from the value of the "MOJO_HOME" environment variable or application class. "lib_dir" my $path = $home->lib_dir; Path to "lib" directory of application. "list_files" my $files = $home->list_files; my $files = $home->list_files('foo/bar'); Portably list all files recursively in directory relative to the home diectory. $home->rel_file($home->list_files('templates/layouts')->[1]); "mojo_lib_dir" my $path = $home->mojo_lib_dir; Path to "lib" directory in which Mojolicious is installed. "parse" $home = $home->parse('/home/sri/myapp'); Parse home directory. "rel_dir" my $path = $home->rel_dir('foo/bar'); Portably generate an absolute path for a directory relative to the home directory. "rel_file" my $path = $home->rel_file('foo/bar.html'); Portably generate an absolute path for a file relative to the home directory. "slurp_rel_file" my $string = $home->slurp_rel_file('foo/bar.html'); Portably read all data at once from file relative to the home directory. my $content = $home->slurp_rel_file($home->list_files('public')->[1]); "to_string" my $string = $home->to_string; my $string = "$home"; Home directory. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Home(3pm)

Check Out this Related Man Page

Mojo::Asset::Memory(3pm)				User Contributed Perl Documentation				  Mojo::Asset::Memory(3pm)

NAME
Mojo::Asset::Memory - In-memory storage for HTTP 1.1 content SYNOPSIS
use Mojo::Asset::Memory; my $mem = Mojo::Asset::Memory->new; $mem->add_chunk('foo bar baz'); say $mem->slurp; DESCRIPTION
Mojo::Asset::Memory is an in-memory storage backend for HTTP 1.1 content. EVENTS
Mojo::Asset::Memory can emit the following events. "upgrade" $mem->on(upgrade => sub { my ($mem, $file) = @_; ... }); Emitted when asset gets upgraded to a Mojo::Asset::File object. $mem->on(upgrade => sub { my ($mem, $file) = @_; $file->tmpdir('/tmp'); }); ATTRIBUTES
Mojo::Asset::Memory inherits all attributes from Mojo::Asset and implements the following new ones. "auto_upgrade" my $upgrade = $mem->auto_upgrade; $mem = $mem->auto_upgrade(1); Try to detect if content size exceeds "max_memory_size" limit and automatically upgrade to a Mojo::Asset::File object. "max_memory_size" my $size = $mem->max_memory_size; $mem = $mem->max_memory_size(1024); Maximum size in bytes of data to keep in memory before automatically upgrading to a Mojo::Asset::File object, defaults to the value of the "MOJO_MAX_MEMORY_SIZE" environment variable or 262144. METHODS
Mojo::Asset::Memory inherits all methods from Mojo::Asset and implements the following new ones. "new" my $mem = Mojo::Asset::Memory->new; Construct a new Mojo::Asset::Memory object. "add_chunk" $mem = $mem->add_chunk('foo bar baz'); my $file = $mem->add_chunk('abc' x 262144); Add chunk of data and upgrade to Mojo::Asset::File object if necessary. "contains" my $position = $mem->contains('bar'); Check if asset contains a specific string. "get_chunk" my $chunk = $mem->get_chunk($offset); Get chunk of data starting from a specific position. "move_to" $mem = $mem->move_to('/home/sri/foo.txt'); Move asset data into a specific file. "size" my $size = $mem->size; Size of asset data in bytes. "slurp" my $string = mem->slurp; Read all asset data at once. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Asset::Memory(3pm)
Man Page