Mark Benson > App-Dapper-0.18 > App::Dapper::Utils

Download:
App-Dapper-0.18.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

App::Dapper::Utils - Common utility functions used throughout Dapper.

read_file

Read a file and return a scalar with the file's contents.

get_modified_time

Takes a file and returns the last modified time of the file.

slugify

Takes an input string (e.g. the title of a blog post) and "slugifies" it, meaning that it removes non-ASCII characters, removes all non-word characters (e.g. '_', '-', etc.), removes leading and trailing whitespace, replaces spaces with hyphens, and converts to lowercase.

find_template_statement

Takes a string, returns <template> part of the first "use <template> template" line.

filter_template_statements

Takes a string, removes all "use <template> template" statements and returns what's left.

filter_extension

Takes a string (filename) and returns the extension.

filter_stem

Takes a filename and returns the stem of the file name (without the extension).

create_file

Takes a file name and a string of the content and writes it to disk.

create_dir

Takes a directory name and creates it on disk.

syntax highlighting: