| File: | lib/Railsish/PathHelpers.pm |
| Coverage: | 93.3% |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package Railsish::PathHelpers; | ||||||
| 2 | 14 14 14 | 126 48 126 | use strict; | ||||
| 3 | 14 14 14 | 148 61 138 | use warnings; | ||||
| 4 | our @HELPERS = (); | ||||||
| 5 | |||||||
| 6 | sub install_helpers { | ||||||
| 7 | 1 | 0 | 7 | my $to = caller; | |||
| 8 | 1 | 6 | for(@HELPERS) { | ||||
| 9 | 14 14 14 | 149 48 107 | no strict; | ||||
| 10 | 2 2 2 | 4 22 17 | *{$to . "::" . $_} = *{__PACKAGE__ . "::" . $_}; | ||||
| 11 | } | ||||||
| 12 | } | ||||||
| 13 | |||||||
| 14 | sub hash_for_helpers { | ||||||
| 15 | 2 | 0 | 11 | my $ret = {}; | |||
| 16 | 2 | 10 | for (@HELPERS) { | ||||
| 17 | 14 14 14 | 173 115 122 | no strict; | ||||
| 18 | 2 2 | 6 24 | $ret->{$_} = \&{__PACKAGE__ . "::" . $_}; | ||||
| 19 | } | ||||||
| 20 | 2 | 13 | return $ret; | ||||
| 21 | } | ||||||
| 22 | |||||||
| 23 | *as_hash = *hash_for_helpers; | ||||||
| 24 | |||||||
| 25 | 1; | ||||||