0.33
[gitmo/Moose.git] / lib / oose.pm
1 package oose;
2
3 use strict;
4 use warnings;
5
6 our $VERSION   = '0.01';
7 our $AUTHORITY = 'cpan:STEVAN';
8
9 BEGIN {
10     my $package;
11     sub import { $package = $_[1] }
12     use Filter::Simple sub { s/^/package $package;\nuse Moose;\n/; }
13 }
14
15 1;
16
17 __END__
18
19 =pod
20
21 =head1 NAME
22
23 oose - syntactic sugar to make Moose one-liners easier
24
25 =head1 SYNOPSIS
26
27     perl -Moose=Foo -e 'has bar => ( is=>q[ro], default => q[baz] ); print Foo->new->bar' # prints baz
28
29 =head1 DESCRIPTION
30
31 oose.pm is a simple source filter that adds C<package $name; use Moose;> 
32 to the beginning of your script and was entirely created because typing 
33 perl -e'package Foo; use Moose; ...' was annoying me.
34
35 =head1 INTERFACE 
36
37 oose provides exactly one method and it's automically called by perl:
38
39 =over 4
40
41 =item B<import($package)>
42
43 Pass a package name to import to be used by the source filter.
44
45 =back
46
47 =head1 DEPENDENCIES
48
49 You will need L<Filter::Simple> and eventually L<Moose>
50
51 =head1 INCOMPATIBILITIES
52
53 None reported. But it is a source filter and might have issues there.
54
55 =head1 BUGS
56
57 All complex software has bugs lurking in it, and this module is no
58 exception. If you find a bug please either email me, or add the bug
59 to cpan-RT.
60
61 =head1 AUTHOR
62
63 Chris Prather  C<< <perigrin@cpan.org> >>
64
65 =head1 COPYRIGHT AND LICENSE
66
67 Copyright 2007 by Infinity Interactive, Inc.
68
69 L<http://www.iinteractive.com>
70
71 This library is free software; you can redistribute it and/or modify
72 it under the same terms as Perl itself.
73
74 =cut