530b33e58bea8517bd9a172ecde69a9306ff5540
[gitmo/Moose.git] / lib / oose.pm
1 package oose;
2 use strict;
3 our $VERSION = '0.0.1';
4
5 BEGIN {
6     my $package;
7     sub import { $package = $_[1] }
8     use Filter::Simple sub { s/^/package $package;\nuse Moose;\n/; }
9 }
10 1;    # Magic true value required at end of module
11 __END__
12
13 =head1 NAME
14
15 oose - syntactic sugar to make Moose Onliners easier
16
17
18 =head1 VERSION
19
20 This document describes oose version 0.0.1
21
22
23 =head1 SYNOPSIS
24
25     perl -Moose=Foo -e 'has bar => ( is=>q[ro], default => q[baz] ); print Foo->new->bar' # prints baz
26
27 =head1 DESCRIPTION
28
29 oose.pm is a Source filter that simply adds C<package $name; use Moose;> to the beginning of your script
30 and was entirely created because typing perl -e'package Foo; use Moose; ...' was annoying me.
31
32 =head1 INTERFACE 
33
34 oose provides exactly one method and it's automically called by perl:
35 =over 
36
37 =item import(str)
38
39 pass a package name to import to be used by the source filter
40
41 =back
42
43 =head1 CONFIGURATION AND ENVIRONMENT
44
45 =for author to fill in:
46     A full explanation of any configuration system(s) used by the
47     module, including the names and locations of any configuration
48     files, and the meaning of any environment variables or properties
49     that can be set. These descriptions must also include details of any
50     configuration language used.
51   
52 oose requires no configuration files or environment variables.
53
54 =head1 DEPENDENCIES
55
56 =for author to fill in:
57     A list of all the other modules that this module relies upon,
58     including any restrictions on versions, and an indication whether
59     the module is part of the standard Perl distribution, part of the
60     module's distribution, or must be installed separately. ]
61
62 You will need L<Filter::Simple> and eventually L<Moose>
63
64
65 =head1 INCOMPATIBILITIES
66
67 =for author to fill in:
68     A list of any modules that this module cannot be used in conjunction
69     with. This may be due to name conflicts in the interface, or
70     competition for system or program resources, or due to internal
71     limitations of Perl (for example, many modules that use source code
72     filters are mutually incompatible).
73
74 None reported. But it is a source filter and might have issues there.
75
76 =head1 BUGS AND LIMITATIONS
77
78 =for author to fill in:
79     A list of known problems with the module, together with some
80     indication Whether they are likely to be fixed in an upcoming
81     release. Also a list of restrictions on the features the module
82     does provide: data types that cannot be handled, performance issues
83     and the circumstances in which they may arise, practical
84     limitations on the size of data sets, special cases that are not
85     (yet) handled, etc.
86
87 No bugs have been reported.
88
89 Please report any bugs or feature requests to
90 C<bug-oose@rt.cpan.org>, or through the web interface at
91 L<http://rt.cpan.org>.
92
93
94 =head1 AUTHOR
95
96 Chris Prather  C<< <perigrin@cpan.org> >>
97
98
99 =head1 LICENCE AND COPYRIGHT
100
101 Copyright (c) 2007, Chris Prather C<< <perigrin@cpan.org> >>. All rights reserved.
102
103 This module is free software; you can redistribute it and/or
104 modify it under the same terms as Perl itself. See L<perlartistic>.
105
106
107 =head1 DISCLAIMER OF WARRANTY
108
109 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
110 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
111 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
112 PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
113 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
114 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
115 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
116 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
117 NECESSARY SERVICING, REPAIR, OR CORRECTION.
118
119 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
120 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
121 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
122 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
123 OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
124 THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
125 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
126 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
127 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
128 SUCH DAMAGES.