---
name: "Jifty::Util"
section: "3pm"
platform: "linux"
package: "libjifty-perl"
version: "1.10518+dfsg-2"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/Jifty::Util"
---

# Jifty::Util(3pm)

Things that don't fit anywhere else

## NAME

Jifty::Util - Things that don't fit anywhere else

## DESCRIPTION

### absolute\_path PATH

`"absolute_path"` converts PATH into an absolute path, relative to the application's root (as determined by "app\_root")  This can be called as an object or class method.

### canonicalize\_path PATH

Takes a "path" style /foo/bar/baz and returns a canonicalized (but not necessarily absolute) version of the path.  Always use `"/"` as the separator, even on platforms which recognizes both `"/"` and `"\"` as valid separators in PATH.

### jifty\_root

Returns the root directory that Jifty has been installed into. Uses `%INC` to figure out where Jifty.pm is.

### share\_root

Returns the 'share' directory of the installed Jifty module.  This is currently only used to store the common Mason components, CSS, and JS of Jifty and it's plugins.

### app\_root

Returns the application's root path.  This is done by returning `$ENV`{'JIFTY\_APP\_ROOT'} if it exists.  If not, Jifty tries searching upward from the current directory, looking for a directory which contains a `"bin/jifty"`.  Failing that, it searches upward from wherever the executable was found.

It `"die"`s if it can only find `"/usr"` or `"/usr/local"` which fit these criteria.

### is\_app\_root PATH

Returns a boolean indicating whether the path passed in is the same path as the app root. Useful if you're recursing up a directory tree and want to stop when you've hit the root. It does not attempt to handle symbolic links.

### default\_app\_name

Returns the default name of the application.  This is the name of the application's root directory, as defined by "app\_root".

### make\_path PATH

When handed a directory, creates that directory, starting as far up the  chain as necessary. (This is what 'mkdir -p' does in your shell).

### require PATH

Uses UNIVERSAL::require to require the provided `"PATH"`. Additionally, logs any failures at the `"error"` log level.

### try\_to\_require Module

This method works just like "require", except that it suppresses the error message in cases where the module isn't found.

### already\_required class

Helper function to test whether a given class has already been loaded.

### generate\_uuid

Generate a new UUID using **Data::UUID**.

### reference\_to\_data Object

Provides a saner output format for models than `"MyApp::Model::Foo=HASH(0x1800568)"`.

### stringify LIST

Takes a list of values and forces them into strings.  Right now all it does is concatenate them to an empty string, but future versions might be more magical.

## AUTHOR

Various folks at Best Practical Solutions, LLC.
