Skip to content
This repository
Browse code

better descriptions for path generation methods

  • Loading branch information...
commit e2182b1e7616c939f0a30375e55d4e360d8baf81 1 parent 79042c9
Sebastian Riedel authored April 30, 2012
22  lib/Mojo/Command.pm
@@ -237,7 +237,7 @@ following new ones.
237 237
 
238 238
 =head2 C<chmod_file>
239 239
 
240  
-  $command = $command->chmod_file('/foo/bar.txt', 0644);
  240
+  $command = $command->chmod_file('/home/sri/bar.txt', 0644);
241 241
 
242 242
 Portably change mode of a file.
243 243
 
@@ -245,7 +245,7 @@ Portably change mode of a file.
245 245
 
246 246
   $command = $command->chmod_rel_file('foo/bar.txt', 0644);
247 247
 
248  
-Portably change mode of a relative file.
  248
+Portably change mode of a file relative to the current working directory.
249 249
 
250 250
 =head2 C<class_to_file>
251 251
 
@@ -268,7 +268,7 @@ Convert class name to path.
268 268
 
269 269
 =head2 C<create_dir>
270 270
 
271  
-  $command = $command->create_dir('/foo/bar/baz');
  271
+  $command = $command->create_dir('/home/sri/foo/bar');
272 272
 
273 273
 Portably create a directory.
274 274
 
@@ -276,7 +276,7 @@ Portably create a directory.
276 276
 
277 277
   $command = $command->create_rel_dir('foo/bar/baz');
278 278
 
279  
-Portably create a relative directory.
  279
+Portably create a directory relative to the current working directory.
280 280
 
281 281
 =head2 C<get_all_data>
282 282
 
@@ -302,13 +302,15 @@ Print usage information for command.
302 302
 
303 303
   my $path = $command->rel_dir('foo/bar');
304 304
 
305  
-Portably generate an absolute path from a relative UNIX style path.
  305
+Portably generate an absolute path for a directory relative to the current
  306
+working directory.
306 307
 
307 308
 =head2 C<rel_file>
308 309
 
309 310
   my $path = $command->rel_file('foo/bar.txt');
310 311
 
311  
-Portably generate an absolute path from a relative UNIX style path.
  312
+Portably generate an absolute path for a file relative to the current working
  313
+directory.
312 314
 
313 315
 =head2 C<render_data>
314 316
 
@@ -318,7 +320,7 @@ Render a template from the C<DATA> section of the command class.
318 320
 
319 321
 =head2 C<render_to_file>
320 322
 
321  
-  $command = $command->render_to_file('foo_bar', '/foo/bar.txt');
  323
+  $command = $command->render_to_file('foo_bar', '/home/sri/bar.txt');
322 324
 
323 325
 Render a template from the C<DATA> section of the command class to a file.
324 326
 
@@ -327,7 +329,7 @@ Render a template from the C<DATA> section of the command class to a file.
327 329
   $command = $command->render_to_rel_file('foo_bar', 'foo/bar.txt');
328 330
 
329 331
 Portably render a template from the C<DATA> section of the command class to a
330  
-relative file.
  332
+file relative to the current working directory.
331 333
 
332 334
 =head2 C<run>
333 335
 
@@ -338,7 +340,7 @@ Run command. Meant to be overloaded in a subclass.
338 340
 
339 341
 =head2 C<write_file>
340 342
 
341  
-  $command = $command->write_file('/foo/bar.txt', 'Hello World!');
  343
+  $command = $command->write_file('/home/sri/bar.txt', 'Hello World!');
342 344
 
343 345
 Portably write text to a file.
344 346
 
@@ -346,7 +348,7 @@ Portably write text to a file.
346 348
 
347 349
   $command = $command->write_rel_file('foo/bar.txt', 'Hello World!');
348 350
 
349  
-Portably write text to a relative file.
  351
+Portably write text to a file relative to the current working directory.
350 352
 
351 353
 =head1 SEE ALSO
352 354
 
10  lib/Mojo/Home.pm
@@ -174,7 +174,8 @@ Path to C<lib> directory of application.
174 174
   my $files = $home->list_files;
175 175
   my $files = $home->list_files('foo/bar');
176 176
 
177  
-Portably list all files in directory and subdirectories recursively.
  177
+Portably list all files recursively in directory relative to the home
  178
+diectory.
178 179
 
179 180
   $home->rel_file($home->list_files('templates/layouts')->[1]);
180 181
 
@@ -194,19 +195,20 @@ Parse home directory.
194 195
 
195 196
   my $path = $home->rel_dir('foo/bar');
196 197
 
197  
-Portably generate an absolute path from a relative UNIX style path.
  198
+Portably generate an absolute path for a directory relative to the home
  199
+directory.
198 200
 
199 201
 =head2 C<rel_file>
200 202
 
201 203
   my $path = $home->rel_file('foo/bar.html');
202 204
 
203  
-Portably generate an absolute path from a relative UNIX style path.
  205
+Portably generate an absolute path for a file relative to the home directory.
204 206
 
205 207
 =head2 C<slurp_rel_file>
206 208
 
207 209
   my $string = $home->slurp_rel_file('foo/bar.html');
208 210
 
209  
-Portably read all file data at once.
  211
+Portably read all data at once from file relative to the home directory.
210 212
 
211 213
   my $content = $home->slurp_rel_file($home->list_files('public')->[1]);
212 214
 
3  t/mojolicious/lib/MojoliciousTest/Command/test_command.pm
@@ -3,9 +3,6 @@ use Mojo::Base 'Mojo::Command';
3 3
 
4 4
 # "Who would have thought Hell would really exist?
5 5
 #  And that it would be in New Jersey?"
6  
-has description => "Test command.\n";
7  
-has usage       => "usage: $0 test_command";
8  
-
9 6
 sub run { return 'works!' }
10 7
 
11 8
 1;

0 notes on commit e2182b1

Please sign in to comment.
Something went wrong with that request. Please try again.