Skip to content

Commit

Permalink
better descriptions for path generation methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 29, 2012
1 parent 79042c9 commit e2182b1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
22 changes: 12 additions & 10 deletions lib/Mojo/Command.pm
Expand Up @@ -237,15 +237,15 @@ following new ones.
=head2 C<chmod_file>
$command = $command->chmod_file('/foo/bar.txt', 0644);
$command = $command->chmod_file('/home/sri/bar.txt', 0644);
Portably change mode of a file.
=head2 C<chmod_rel_file>
$command = $command->chmod_rel_file('foo/bar.txt', 0644);
Portably change mode of a relative file.
Portably change mode of a file relative to the current working directory.
=head2 C<class_to_file>
Expand All @@ -268,15 +268,15 @@ Convert class name to path.
=head2 C<create_dir>
$command = $command->create_dir('/foo/bar/baz');
$command = $command->create_dir('/home/sri/foo/bar');
Portably create a directory.
=head2 C<create_rel_dir>
$command = $command->create_rel_dir('foo/bar/baz');
Portably create a relative directory.
Portably create a directory relative to the current working directory.
=head2 C<get_all_data>
Expand All @@ -302,13 +302,15 @@ Print usage information for command.
my $path = $command->rel_dir('foo/bar');
Portably generate an absolute path from a relative UNIX style path.
Portably generate an absolute path for a directory relative to the current
working directory.
=head2 C<rel_file>
my $path = $command->rel_file('foo/bar.txt');
Portably generate an absolute path from a relative UNIX style path.
Portably generate an absolute path for a file relative to the current working
directory.
=head2 C<render_data>
Expand All @@ -318,7 +320,7 @@ Render a template from the C<DATA> section of the command class.
=head2 C<render_to_file>
$command = $command->render_to_file('foo_bar', '/foo/bar.txt');
$command = $command->render_to_file('foo_bar', '/home/sri/bar.txt');
Render a template from the C<DATA> section of the command class to a file.
Expand All @@ -327,7 +329,7 @@ Render a template from the C<DATA> section of the command class to a file.
$command = $command->render_to_rel_file('foo_bar', 'foo/bar.txt');
Portably render a template from the C<DATA> section of the command class to a
relative file.
file relative to the current working directory.
=head2 C<run>
Expand All @@ -338,15 +340,15 @@ Run command. Meant to be overloaded in a subclass.
=head2 C<write_file>
$command = $command->write_file('/foo/bar.txt', 'Hello World!');
$command = $command->write_file('/home/sri/bar.txt', 'Hello World!');
Portably write text to a file.
=head2 C<write_rel_file>
$command = $command->write_rel_file('foo/bar.txt', 'Hello World!');
Portably write text to a relative file.
Portably write text to a file relative to the current working directory.
=head1 SEE ALSO
Expand Down
10 changes: 6 additions & 4 deletions lib/Mojo/Home.pm
Expand Up @@ -174,7 +174,8 @@ Path to C<lib> directory of application.
my $files = $home->list_files;
my $files = $home->list_files('foo/bar');
Portably list all files in directory and subdirectories recursively.
Portably list all files recursively in directory relative to the home
diectory.
$home->rel_file($home->list_files('templates/layouts')->[1]);
Expand All @@ -194,19 +195,20 @@ Parse home directory.
my $path = $home->rel_dir('foo/bar');
Portably generate an absolute path from a relative UNIX style path.
Portably generate an absolute path for a directory relative to the home
directory.
=head2 C<rel_file>
my $path = $home->rel_file('foo/bar.html');
Portably generate an absolute path from a relative UNIX style path.
Portably generate an absolute path for a file relative to the home directory.
=head2 C<slurp_rel_file>
my $string = $home->slurp_rel_file('foo/bar.html');
Portably read all file data at once.
Portably read all data at once from file relative to the home directory.
my $content = $home->slurp_rel_file($home->list_files('public')->[1]);
Expand Down
3 changes: 0 additions & 3 deletions t/mojolicious/lib/MojoliciousTest/Command/test_command.pm
Expand Up @@ -3,9 +3,6 @@ use Mojo::Base 'Mojo::Command';

# "Who would have thought Hell would really exist?
# And that it would be in New Jersey?"
has description => "Test command.\n";
has usage => "usage: $0 test_command";

sub run { return 'works!' }

1;

0 comments on commit e2182b1

Please sign in to comment.