Toby Inkster avatar Toby Inkster committed c5ffd8a Draft

improve documentation; build_exporter is no longer a class method

Comments (0)

Files changed (1)

lib/Exporter/Everything.pm

 	my $import = "$caller\::import";
 	my $exporter;
 	*$import = subname $import, sub {
-		$exporter ||= Exporter::Everything::->build_exporter($caller);
+		$exporter ||= Exporter::Everything::build_exporter($caller);
 		goto $exporter;
 	}
 }
 
 sub build_exporter
 {
-	my $class = shift;
 	my %subs  = exportable_subs( @_ ? $_[0] : caller );
 	
 	return Sub::Exporter::build_exporter({
 
 =item * C<-const>
 
-All functions with names matching C<< /^[A-Z]([A-Z0-9_]*[A-Z0-9])?$/ >>
+All functions with names matching C<< /^[A-Z]([A-Z0-9_]*[A-Z0-9])?$/ >>.
+The assumption is that these are "constants".
 
 =back
 
 You can safely define both C<foo> and C<_build_foo>. When people import your
 sub, they'll get the generated version.
 
-If you need any other fancy Sub::Exporter features, then you're out of luck.
+Exporter::Everything uses Sub::Exporter behind the scenes, so the caller-side
+features of Sub::Exporter (such as the ability to rename imported subs)
+should just work.
+
+If you need any other fancy Sub::Exporter features (e.g. collectors, custom
+installers, etc), then you're out of luck.
 
 =head2 I need to do some other fancy stuff in my C<import> method.
 
 
    sub import
    {
+      my ($class, @args) = @_;  # copy @_, don't alter it!
+      
       ...;
       
       require Exporter::Everything;
-      state $exporter = Exporter::Everything->build_exporter;
+      state $exporter = $class->Exporter::Everything::build_exporter;
       goto $exporter;
    }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.