--- trunk/lib/Frey.pm 2008/07/05 15:08:51 52 +++ trunk/lib/Frey.pm 2009/06/30 15:10:55 1133 @@ -1,51 +1,37 @@ package Frey; use Moose; +our $VERSION = "0.26"; + +use Data::Dump qw//; +sub dump { + my $self = shift; + Data::Dump::dump( @_ ); +} + has 'debug' => ( is => 'rw', - isa => 'Bool', - default => 1, + isa => 'Int', + default => sub { $ENV{FREY_DEBUG} || 0 }, ); =head1 NAME -Frey - hi-level web framework in spirit of 4GLs +Frey - hi-level web framework in spirit of 4GLs based on Moose =head1 DESCRIPTION -n. Mythology. + n. Mythology. -The Norse god who dispenses peace, good weather, prosperity, and bountiful -crops; the brother of Freya. + The Norse god who dispenses peace, good weather, prosperity, and bountiful + crops; the brother of Freya. -=cut +Basically you write L classes which become directly callable from +the Firefox using REST API. for gentle intoduction see L. -use Data::Dump qw/dump/; -use File::Find; +=cut -has 'classes' => ( - is => 'ro', -# isa => 'HashRef[Str]', - default => sub { - my $self = shift; - # FIXME there must be better way to do this in Moose style - my $classes; - finddepth({ no_chdir => 1, wanted => sub { - return unless s/\.pm$//; - my @a = split(m!/!,$_); - if ( $#a != 2 ) { - warn "SKIP $_ [$#a]" if $self->debug; - return; - } - warn ">> $_ ",dump( @a ) if $self->debug; - my $package = "$a[1]::$a[2]"; - warn "## $package\n"; - push @$classes, { $package => "$_.pm" }; - } }, 'lib'); - warn "## classes = ",dump( $classes ) if $self->debug; - $classes; - }, - lazy => 1, -); +__PACKAGE__->meta->make_immutable; +no Moose; 1;