Skip to content

Commit

Permalink
Item10549: scratched a long overdue itch by cleaning up the create_ne…
Browse files Browse the repository at this point in the history
…w_extension script to be abe to create a new extension using an existing one as a template. Cleaned up the empty (default template) extensions which I was at it.

git-svn-id: http://svn.foswiki.org/trunk/EmptyContrib@11239 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Mar 27, 2011
1 parent 4db0442 commit 2bfd47b
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 113 deletions.
26 changes: 26 additions & 0 deletions data/System/EmptyContrib.txt
@@ -0,0 +1,26 @@
<!--
One line description, required for extensions repository catalog.
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->
---+!! EmptyContrib

%SHORTDESCRIPTION%

%TOC%

---++ Installation
%$INSTALL_INSTRUCTIONS%

---++ Info

| Author: | %$AUTHOR% |
| Copyright &copy;: | <!-- e.g. "2011, SlobSoft Gmbh, All Rights Reserved" --> |
| License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
| Dependencies: | %$DEPENDENCIES% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 1.0.0 (XX Mmm 20XX): | Initial version |
| Home: | http://foswiki.org/Extensions/%TOPIC% |
| Support: | http://foswiki.org/Support/%TOPIC% |


50 changes: 0 additions & 50 deletions data/TWiki/EmptyContrib.txt

This file was deleted.

59 changes: 59 additions & 0 deletions lib/Foswiki/Contrib/EmptyContrib.pm
@@ -0,0 +1,59 @@
# See bottom of file for default license and copyright information
=begin TML
---+ package Foswiki::Contrib::EmptyContrib
This is a stub module for a new contrib. Customise this module as
required.
=cut

# change the package name!!!
package Foswiki::Contrib::EmptyContrib;

# Always use strict to enforce variable scoping
use strict;
use warnings;

# $VERSION is referred to by Foswiki, and is the only global variable that
# *must* exist in this package. This should always be in the format
# $Rev$ so that Foswiki can determine the checked-in status of the
# extension.
our $VERSION = '$Rev$';

# $RELEASE is used in the "Find More Extensions" automation in configure.
# It is a manually maintained string used to identify functionality steps.
# You can use any of the following formats:
# tuple - a sequence of integers separated by . e.g. 1.2.3. The numbers
# usually refer to major.minor.patch release or similar. You can
# use as many numbers as you like e.g. '1' or '1.2.3.4.5'.
# isodate - a date in ISO8601 format e.g. 2009-08-07
# date - a date in 1 Jun 2009 format. Three letter English month names only.
# Note: it's important that this string is exactly the same in the extension
# topic - if you use %$RELEASE% with BuildContrib this is done automatically.
our $RELEASE = '1.0.0';

our $SHORTDESCRIPTION = 'One line description of the extension';

1;

__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Author: %$AUTHOR%
Copyright (C) 2008-2011 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
NOTE: Please extend that file, not this notice.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. For
more details read LICENSE in the root of this distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
As per the GPL, removal of this notice is prohibited.
2 changes: 2 additions & 0 deletions lib/Foswiki/Contrib/EmptyContrib/Config.spec
@@ -0,0 +1,2 @@
# ---+ Extensions
# ---++ EmptyContribPlugin
File renamed without changes.
4 changes: 4 additions & 0 deletions lib/Foswiki/Contrib/EmptyContrib/MANIFEST
@@ -0,0 +1,4 @@
!noci
data/System/EmptyContrib.txt 0644 Documentation page
lib/Foswiki/Contrib/EmptyContrib.pm Perl module
lib/Foswiki/Contrib/EmptyContrib/Config.spec 0444 Configuration
75 changes: 75 additions & 0 deletions lib/Foswiki/Contrib/EmptyContrib/build.pl
@@ -0,0 +1,75 @@
#!/usr/bin/perl -w
#
# Example build class. Copy this file to the equivalent place in your
# plugin or contrib and edit.
#
# Read the comments at the top of lib/Foswiki/Contrib/Build.pm for
# details of how the build process works, and what files you
# have to provide and where.
#
# Requires the environment variable FOSWIKI_LIBS (a colon-separated path
# list) to be set to point at the build system and any required dependencies.
# Usage: ./build.pl [-n] [-v] [target]
# where [target] is the optional build target (build, test,
# install, release, uninstall), test is the default.
# Two command-line options are supported:
# -n Don't actually do anything, just print commands
# -v Be verbose
#

# Standard preamble
use strict;
use warnings;

BEGIN { unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ); }

use Foswiki::Contrib::Build;

# Create the build object
my $build = new Foswiki::Contrib::Build('EmptyContrib');

# Build the target on the command line, or the default target
$build->build($build->{target});

=begin TML
You can do a lot more with the build system if you want; for example, to add
a new target, you could do this:
<verbatim>
{
package MyModuleBuild;
our @ISA = qw( Foswiki::Contrib::Build );
sub new {
my $class = shift;
return bless( $class->SUPER::new( "MyModule" ), $class );
}
sub target_mytarget {
my $this = shift;
# Do other build stuff here
}
}
# Create the build object
my $build = new MyModuleBuild();
</verbatim>
You can also specify a different default target server for uploads.
This can be any web on any accessible Foswiki installation.
These defaults will be used when expanding tokens in .txt
files, but be warned, they can be overridden at upload time!
<verbatim>
# name of web to upload to
$build->{UPLOADTARGETWEB} = 'Extensions';
# Full URL of pub directory
$build->{UPLOADTARGETPUB} = 'http://foswiki.org/pub';
# Full URL of bin directory
$build->{UPLOADTARGETSCRIPT} = 'http://foswiki.org/bin';
# Script extension
$build->{UPLOADTARGETSUFFIX} = '';
</verbatim>
=cut
4 changes: 0 additions & 4 deletions lib/TWiki/Contrib/EmptyContrib.pm

This file was deleted.

3 changes: 0 additions & 3 deletions lib/TWiki/Contrib/EmptyContrib/MANIFEST

This file was deleted.

50 changes: 0 additions & 50 deletions lib/TWiki/Contrib/EmptyContrib/build.pl

This file was deleted.

7 changes: 1 addition & 6 deletions test/unit/EmptyContrib/EmptyContribTests.pm
Expand Up @@ -6,10 +6,7 @@ use FoswikiTestCase;
our @ISA = qw( FoswikiTestCase );

use strict;
use TWiki;
use CGI;

my $twiki;
use Foswiki;

sub new {
my $self = shift()->SUPER::new(@_);
Expand All @@ -21,8 +18,6 @@ sub set_up {
my $this = shift;

$this->SUPER::set_up();

$TWiki::Plugins::SESSION = $twiki;
}

sub tear_down {
Expand Down

0 comments on commit 2bfd47b

Please sign in to comment.