diff --git a/Literature/.gitignore b/Literature.cat/.gitignore similarity index 100% rename from Literature/.gitignore rename to Literature.cat/.gitignore diff --git a/Literature/Changes b/Literature.cat/Changes similarity index 100% rename from Literature/Changes rename to Literature.cat/Changes diff --git a/Literature.cat/Makefile.PL b/Literature.cat/Makefile.PL new file mode 100644 index 0000000..390c1c9 --- /dev/null +++ b/Literature.cat/Makefile.PL @@ -0,0 +1,21 @@ +#!/usr/bin/env perl +# IMPORTANT: if you delete this file your app will not work as +# expected. You have been warned. +use inc::Module::Install; + +name 'Literature'; +all_from 'lib/Literature.pm'; + +requires 'Catalyst::Runtime' => '5.80013'; +requires 'Catalyst::Plugin::ConfigLoader'; +requires 'Catalyst::Plugin::Static::Simple'; +requires 'Catalyst::Action::RenderView'; +requires 'Catalyst::Plugin::StackTrace'; +requires 'parent'; +requires 'Config::General'; # This should reflect the config file format you've chosen + # See Catalyst::Plugin::ConfigLoader for supported formats +catalyst; + +install_script glob('script/*.pl'); +auto_install; +WriteAll; diff --git a/Literature/README b/Literature.cat/README similarity index 100% rename from Literature/README rename to Literature.cat/README diff --git a/Literature.cat/lib/Literature.pm b/Literature.cat/lib/Literature.pm new file mode 100644 index 0000000..3efdf4e --- /dev/null +++ b/Literature.cat/lib/Literature.pm @@ -0,0 +1,68 @@ +package Literature; + +use strict; +use warnings; + +use Catalyst::Runtime 5.80; + +# Set flags and add plugins for the application +# +# -Debug: activates the debug mode for very useful log messages +# ConfigLoader: will load the configuration from a Config::General file in the +# application's home directory +# Static::Simple: will serve static files from the application's root +# directory + +use parent qw/Catalyst/; +use Catalyst qw/ + -Debug + ConfigLoader + Static::Simple + StackTrace + AutoCRUD + /; +our $VERSION = '0.01'; + +# Configure the application. +# +# Note that settings in literature.conf (or other external +# configuration file that you set up manually) take precedence +# over this when using ConfigLoader. Thus configuration +# details given here can function as a default configuration, +# with an external configuration file acting as an override for +# local deployment. + +__PACKAGE__->config( name => 'Literature' ); + +# Start the application +__PACKAGE__->setup(); + + +=head1 NAME + +Literature - Catalyst based application + +=head1 SYNOPSIS + + script/literature_server.pl + +=head1 DESCRIPTION + +[enter your description here] + +=head1 SEE ALSO + +L, L + +=head1 AUTHOR + +Dave Cross + +=head1 LICENSE + +This library is free software. You can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +1; diff --git a/Literature/lib/Literature/Controller/Actors.pm b/Literature.cat/lib/Literature/Controller/Actors.pm similarity index 100% rename from Literature/lib/Literature/Controller/Actors.pm rename to Literature.cat/lib/Literature/Controller/Actors.pm diff --git a/Literature/lib/Literature/Controller/Authors.pm b/Literature.cat/lib/Literature/Controller/Authors.pm similarity index 100% rename from Literature/lib/Literature/Controller/Authors.pm rename to Literature.cat/lib/Literature/Controller/Authors.pm diff --git a/Literature/lib/Literature/Controller/Characters.pm b/Literature.cat/lib/Literature/Controller/Characters.pm similarity index 100% rename from Literature/lib/Literature/Controller/Characters.pm rename to Literature.cat/lib/Literature/Controller/Characters.pm diff --git a/Literature/lib/Literature/Controller/Productions.pm b/Literature.cat/lib/Literature/Controller/Productions.pm similarity index 100% rename from Literature/lib/Literature/Controller/Productions.pm rename to Literature.cat/lib/Literature/Controller/Productions.pm diff --git a/Literature/lib/Literature/Controller/Root.pm b/Literature.cat/lib/Literature/Controller/Root.pm similarity index 100% rename from Literature/lib/Literature/Controller/Root.pm rename to Literature.cat/lib/Literature/Controller/Root.pm diff --git a/Literature/lib/Literature/Controller/Site.pm b/Literature.cat/lib/Literature/Controller/Site.pm similarity index 100% rename from Literature/lib/Literature/Controller/Site.pm rename to Literature.cat/lib/Literature/Controller/Site.pm diff --git a/Literature/lib/Literature/Controller/Works.pm b/Literature.cat/lib/Literature/Controller/Works.pm similarity index 100% rename from Literature/lib/Literature/Controller/Works.pm rename to Literature.cat/lib/Literature/Controller/Works.pm diff --git a/Literature/lib/Literature/Model/DB.pm b/Literature.cat/lib/Literature/Model/DB.pm similarity index 100% rename from Literature/lib/Literature/Model/DB.pm rename to Literature.cat/lib/Literature/Model/DB.pm diff --git a/Literature.cat/lib/Literature/Schema.pm b/Literature.cat/lib/Literature/Schema.pm new file mode 100644 index 0000000..c198fc8 --- /dev/null +++ b/Literature.cat/lib/Literature/Schema.pm @@ -0,0 +1,19 @@ +package Literature::Schema; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Schema'; + +__PACKAGE__->load_namespaces; + + +# Created by DBIx::Class::Schema::Loader v0.07001 @ 2010-09-12 14:05:58 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TuzB0spCqLGoM61gRH1APQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/Literature/lib/Literature/Schema/.ActorRole.pm.swp b/Literature.cat/lib/Literature/Schema/.ActorRole.pm.swp similarity index 100% rename from Literature/lib/Literature/Schema/.ActorRole.pm.swp rename to Literature.cat/lib/Literature/Schema/.ActorRole.pm.swp diff --git a/Literature.cat/lib/Literature/Schema/Result/Actor.pm b/Literature.cat/lib/Literature/Schema/Result/Actor.pm new file mode 100644 index 0000000..4075611 --- /dev/null +++ b/Literature.cat/lib/Literature/Schema/Result/Actor.pm @@ -0,0 +1,112 @@ +package Literature::Schema::Result::Actor; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 NAME + +Literature::Schema::Result::Actor + +=cut + +__PACKAGE__->table("actor"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 born + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 died + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 imdb + + data_type: 'char' + is_nullable: 1 + size: 15 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "born", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "died", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "imdb", + { data_type => "char", is_nullable => 1, size => 15 }, +); +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 actor_roles + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "actor_roles", + "Literature::Schema::Result::ActorRole", + { "foreign.actor" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:16:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Em+SljLhA9AucfhfRCwjkw + + + +# You can replace this text with custom content, and it will be preserved on regeneration + +sub display_name { + my $self = shift; + return $self->name || ''; +} + +1; + + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/Literature.cat/lib/Literature/Schema/Result/ActorRole.pm b/Literature.cat/lib/Literature/Schema/Result/ActorRole.pm new file mode 100644 index 0000000..cec7c89 --- /dev/null +++ b/Literature.cat/lib/Literature/Schema/Result/ActorRole.pm @@ -0,0 +1,123 @@ +package Literature::Schema::Result::ActorRole; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 NAME + +Literature::Schema::Result::ActorRole + +=cut + +__PACKAGE__->table("actor_role"); + +=head1 ACCESSORS + +=head2 actor + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 production + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 fictional_character + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "actor", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "production", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "fictional_character", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("actor", "production", "fictional_character"); + +=head1 RELATIONS + +=head2 actor + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "actor", + "Literature::Schema::Result::Actor", + { id => "actor" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 production + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "production", + "Literature::Schema::Result::Production", + { id => "production" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 fictional_character + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "fictional_character", + "Literature::Schema::Result::FictionalCharacter", + { id => "fictional_character" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ax7FCmo8QD+zTFfZ6v7mUA + + + +# You can replace this text with custom content, and it will be preserved on regeneration + +sub display_name { + my $self = shift; + + return $self->actor->name . ' played ' . + $self->fictional_character->name . ' in ' . + $self->production->title . ' (' . + $self->production->made_by . ', ' . + $self->production->year . ')'; +} + +1; + + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/Literature.cat/lib/Literature/Schema/Result/Author.pm b/Literature.cat/lib/Literature/Schema/Result/Author.pm new file mode 100644 index 0000000..95cb3b8 --- /dev/null +++ b/Literature.cat/lib/Literature/Schema/Result/Author.pm @@ -0,0 +1,115 @@ +package Literature::Schema::Result::Author; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 NAME + +Literature::Schema::Result::Author + +=cut + +__PACKAGE__->table("author"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 born + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 died + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 imdb + + data_type: 'char' + is_nullable: 0 + size: 15 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "born", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "died", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "imdb", + { data_type => "char", is_nullable => 0, size => 15 }, +); +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 author_works + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "author_works", + "Literature::Schema::Result::AuthorWork", + { "foreign.author" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:16:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BXICXVHmishvaieMbrqssA + + + +# You can replace this text with custom content, and it will be preserved on regeneration + +sub display_name { + my $self = shift; + return $self->name || ''; +} + +1; + + + +# You can replace this text with custom content, and it will be preserved on regeneration + +__PACKAGE__->many_to_many(works => 'author_works', 'work'); + +1; diff --git a/Literature.cat/lib/Literature/Schema/Result/AuthorWork.pm b/Literature.cat/lib/Literature/Schema/Result/AuthorWork.pm new file mode 100644 index 0000000..dd61a9f --- /dev/null +++ b/Literature.cat/lib/Literature/Schema/Result/AuthorWork.pm @@ -0,0 +1,83 @@ +package Literature::Schema::Result::AuthorWork; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 NAME + +Literature::Schema::Result::AuthorWork + +=cut + +__PACKAGE__->table("author_work"); + +=head1 ACCESSORS + +=head2 author + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 work + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "author", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "work", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("author", "work"); + +=head1 RELATIONS + +=head2 author + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "author", + "Literature::Schema::Result::Author", + { id => "author" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 work + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "work", + "Literature::Schema::Result::Work", + { id => "work" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qkN4LHk0wSGWcjNoa7TMwQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/Literature.cat/lib/Literature/Schema/Result/FictionalCharacter.pm b/Literature.cat/lib/Literature/Schema/Result/FictionalCharacter.pm new file mode 100644 index 0000000..adfb01e --- /dev/null +++ b/Literature.cat/lib/Literature/Schema/Result/FictionalCharacter.pm @@ -0,0 +1,95 @@ +package Literature::Schema::Result::FictionalCharacter; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 NAME + +Literature::Schema::Result::FictionalCharacter + +=cut + +__PACKAGE__->table("fictional_character"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 actor_roles + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "actor_roles", + "Literature::Schema::Result::ActorRole", + { "foreign.fictional_character" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 fictional_character_appearances + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "fictional_character_appearances", + "Literature::Schema::Result::FictionalCharacterAppearance", + { "foreign.fictional_character" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tuJMH1jzzURlsLcJ66G+ug + + + +# You can replace this text with custom content, and it will be preserved on regeneration + +sub display_name { + my $self = shift; + return $self->name || ''; +} + +1; + + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/Literature.cat/lib/Literature/Schema/Result/FictionalCharacterAppearance.pm b/Literature.cat/lib/Literature/Schema/Result/FictionalCharacterAppearance.pm new file mode 100644 index 0000000..86a15f0 --- /dev/null +++ b/Literature.cat/lib/Literature/Schema/Result/FictionalCharacterAppearance.pm @@ -0,0 +1,96 @@ +package Literature::Schema::Result::FictionalCharacterAppearance; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 NAME + +Literature::Schema::Result::FictionalCharacterAppearance + +=cut + +__PACKAGE__->table("fictional_character_appearance"); + +=head1 ACCESSORS + +=head2 fictional_character + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 work + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "fictional_character", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "work", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("fictional_character", "work"); + +=head1 RELATIONS + +=head2 fictional_character + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "fictional_character", + "Literature::Schema::Result::FictionalCharacter", + { id => "fictional_character" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 work + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "work", + "Literature::Schema::Result::Work", + { id => "work" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:v1TNbaUiirbmoND9zSSK3Q + + + +# You can replace this text with custom content, and it will be preserved on regeneration + +sub display_name { + my $self = shift; + + return $self->name . ' appears in ' . $self->work->title; +} + +1; + + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/Literature.cat/lib/Literature/Schema/Result/Production.pm b/Literature.cat/lib/Literature/Schema/Result/Production.pm new file mode 100644 index 0000000..3c72d6d --- /dev/null +++ b/Literature.cat/lib/Literature/Schema/Result/Production.pm @@ -0,0 +1,118 @@ +package Literature::Schema::Result::Production; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 NAME + +Literature::Schema::Result::Production + +=cut + +__PACKAGE__->table("production"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 title + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 work + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 year + + data_type: 'year' + is_nullable: 1 + +=head2 made_by + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "title", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "work", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "year", + { data_type => "year", is_nullable => 1 }, + "made_by", + { data_type => "varchar", is_nullable => 1, size => 255 }, +); +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 actor_roles + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "actor_roles", + "Literature::Schema::Result::ActorRole", + { "foreign.production" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 work + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "work", + "Literature::Schema::Result::Work", + { id => "work" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z/Zz14R2tojBky7RHNQ8hw + + + +# You can replace this text with custom content, and it will be preserved on regeneration + +sub display_name { + my $self = shift; + return $self->title || ''; +} + +1; + + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/Literature/lib/Literature/Schema/Result/ProductionProduct.pm b/Literature.cat/lib/Literature/Schema/Result/ProductionProduct.pm similarity index 100% rename from Literature/lib/Literature/Schema/Result/ProductionProduct.pm rename to Literature.cat/lib/Literature/Schema/Result/ProductionProduct.pm diff --git a/Literature.cat/lib/Literature/Schema/Result/Work.pm b/Literature.cat/lib/Literature/Schema/Result/Work.pm new file mode 100644 index 0000000..87b0dc9 --- /dev/null +++ b/Literature.cat/lib/Literature/Schema/Result/Work.pm @@ -0,0 +1,140 @@ +package Literature::Schema::Result::Work; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 NAME + +Literature::Schema::Result::Work + +=cut + +__PACKAGE__->table("work"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 title + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 published + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "title", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "published", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, +); +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 author_works + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "author_works", + "Literature::Schema::Result::AuthorWork", + { "foreign.work" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 character_appearances + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "character_appearances", + "Literature::Schema::Result::CharacterAppearance", + { "foreign.work" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 fictional_character_appearances + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "fictional_character_appearances", + "Literature::Schema::Result::FictionalCharacterAppearance", + { "foreign.work" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 productions + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "productions", + "Literature::Schema::Result::Production", + { "foreign.work" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:16:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+CFOaGhALLRSgNqCQapqZA + + + +# You can replace this text with custom content, and it will be preserved on regeneration + +sub display_name { + my $self = shift; + return $self->title || ''; +} + +1; + + + +# You can replace this text with custom content, and it will be preserved on regeneration + +__PACKAGE__->many_to_many(authors => 'author_works', 'author'); + +1; diff --git a/Literature/lib/Literature/Schema/Result/WorkProduct.pm b/Literature.cat/lib/Literature/Schema/Result/WorkProduct.pm similarity index 100% rename from Literature/lib/Literature/Schema/Result/WorkProduct.pm rename to Literature.cat/lib/Literature/Schema/Result/WorkProduct.pm diff --git a/Literature/lib/Literature/View/TT.pm b/Literature.cat/lib/Literature/View/TT.pm similarity index 100% rename from Literature/lib/Literature/View/TT.pm rename to Literature.cat/lib/Literature/View/TT.pm diff --git a/Literature/literature.conf b/Literature.cat/literature.conf similarity index 100% rename from Literature/literature.conf rename to Literature.cat/literature.conf diff --git a/Literature/root/favicon.ico b/Literature.cat/root/favicon.ico similarity index 100% rename from Literature/root/favicon.ico rename to Literature.cat/root/favicon.ico diff --git a/Literature/root/hello.tt b/Literature.cat/root/hello.tt similarity index 100% rename from Literature/root/hello.tt rename to Literature.cat/root/hello.tt diff --git a/Literature/root/site/test.tt b/Literature.cat/root/site/test.tt similarity index 100% rename from Literature/root/site/test.tt rename to Literature.cat/root/site/test.tt diff --git a/Literature/root/src/actors/index.tt b/Literature.cat/root/src/actors/index.tt similarity index 100% rename from Literature/root/src/actors/index.tt rename to Literature.cat/root/src/actors/index.tt diff --git a/Literature/root/src/actors/show.tt b/Literature.cat/root/src/actors/show.tt similarity index 100% rename from Literature/root/src/actors/show.tt rename to Literature.cat/root/src/actors/show.tt diff --git a/Literature/root/src/authors/index.tt b/Literature.cat/root/src/authors/index.tt similarity index 100% rename from Literature/root/src/authors/index.tt rename to Literature.cat/root/src/authors/index.tt diff --git a/Literature/root/src/authors/list.tt b/Literature.cat/root/src/authors/list.tt similarity index 100% rename from Literature/root/src/authors/list.tt rename to Literature.cat/root/src/authors/list.tt diff --git a/Literature/root/src/authors/show.tt b/Literature.cat/root/src/authors/show.tt similarity index 100% rename from Literature/root/src/authors/show.tt rename to Literature.cat/root/src/authors/show.tt diff --git a/Literature/root/src/characters/index.tt b/Literature.cat/root/src/characters/index.tt similarity index 100% rename from Literature/root/src/characters/index.tt rename to Literature.cat/root/src/characters/index.tt diff --git a/Literature/root/src/characters/show.tt b/Literature.cat/root/src/characters/show.tt similarity index 100% rename from Literature/root/src/characters/show.tt rename to Literature.cat/root/src/characters/show.tt diff --git a/Literature/root/src/index.tt b/Literature.cat/root/src/index.tt similarity index 100% rename from Literature/root/src/index.tt rename to Literature.cat/root/src/index.tt diff --git a/Literature/root/src/productions/index.tt b/Literature.cat/root/src/productions/index.tt similarity index 100% rename from Literature/root/src/productions/index.tt rename to Literature.cat/root/src/productions/index.tt diff --git a/Literature/root/src/productions/show.tt b/Literature.cat/root/src/productions/show.tt similarity index 100% rename from Literature/root/src/productions/show.tt rename to Literature.cat/root/src/productions/show.tt diff --git a/Literature/root/src/works/index.tt b/Literature.cat/root/src/works/index.tt similarity index 100% rename from Literature/root/src/works/index.tt rename to Literature.cat/root/src/works/index.tt diff --git a/Literature/root/src/works/list.tt b/Literature.cat/root/src/works/list.tt similarity index 100% rename from Literature/root/src/works/list.tt rename to Literature.cat/root/src/works/list.tt diff --git a/Literature/root/src/works/show.tt b/Literature.cat/root/src/works/show.tt similarity index 100% rename from Literature/root/src/works/show.tt rename to Literature.cat/root/src/works/show.tt diff --git a/Literature/root/src/wrapper.tt b/Literature.cat/root/src/wrapper.tt similarity index 100% rename from Literature/root/src/wrapper.tt rename to Literature.cat/root/src/wrapper.tt diff --git a/Literature/root/static/css/main.css b/Literature.cat/root/static/css/main.css similarity index 100% rename from Literature/root/static/css/main.css rename to Literature.cat/root/static/css/main.css diff --git a/Literature/root/static/images/btn_120x50_built.png b/Literature.cat/root/static/images/btn_120x50_built.png similarity index 100% rename from Literature/root/static/images/btn_120x50_built.png rename to Literature.cat/root/static/images/btn_120x50_built.png diff --git a/Literature/root/static/images/btn_120x50_built_shadow.png b/Literature.cat/root/static/images/btn_120x50_built_shadow.png similarity index 100% rename from Literature/root/static/images/btn_120x50_built_shadow.png rename to Literature.cat/root/static/images/btn_120x50_built_shadow.png diff --git a/Literature/root/static/images/btn_120x50_powered.png b/Literature.cat/root/static/images/btn_120x50_powered.png similarity index 100% rename from Literature/root/static/images/btn_120x50_powered.png rename to Literature.cat/root/static/images/btn_120x50_powered.png diff --git a/Literature/root/static/images/btn_120x50_powered_shadow.png b/Literature.cat/root/static/images/btn_120x50_powered_shadow.png similarity index 100% rename from Literature/root/static/images/btn_120x50_powered_shadow.png rename to Literature.cat/root/static/images/btn_120x50_powered_shadow.png diff --git a/Literature/root/static/images/btn_88x31_built.png b/Literature.cat/root/static/images/btn_88x31_built.png similarity index 100% rename from Literature/root/static/images/btn_88x31_built.png rename to Literature.cat/root/static/images/btn_88x31_built.png diff --git a/Literature/root/static/images/btn_88x31_built_shadow.png b/Literature.cat/root/static/images/btn_88x31_built_shadow.png similarity index 100% rename from Literature/root/static/images/btn_88x31_built_shadow.png rename to Literature.cat/root/static/images/btn_88x31_built_shadow.png diff --git a/Literature/root/static/images/btn_88x31_powered.png b/Literature.cat/root/static/images/btn_88x31_powered.png similarity index 100% rename from Literature/root/static/images/btn_88x31_powered.png rename to Literature.cat/root/static/images/btn_88x31_powered.png diff --git a/Literature/root/static/images/btn_88x31_powered_shadow.png b/Literature.cat/root/static/images/btn_88x31_powered_shadow.png similarity index 100% rename from Literature/root/static/images/btn_88x31_powered_shadow.png rename to Literature.cat/root/static/images/btn_88x31_powered_shadow.png diff --git a/Literature/root/static/images/catalyst_logo.png b/Literature.cat/root/static/images/catalyst_logo.png similarity index 100% rename from Literature/root/static/images/catalyst_logo.png rename to Literature.cat/root/static/images/catalyst_logo.png diff --git a/Literature/script/literature.psgi b/Literature.cat/script/literature.psgi similarity index 100% rename from Literature/script/literature.psgi rename to Literature.cat/script/literature.psgi diff --git a/Literature/script/literature_cgi.pl b/Literature.cat/script/literature_cgi.pl similarity index 100% rename from Literature/script/literature_cgi.pl rename to Literature.cat/script/literature_cgi.pl diff --git a/Literature/script/literature_create.pl b/Literature.cat/script/literature_create.pl similarity index 100% rename from Literature/script/literature_create.pl rename to Literature.cat/script/literature_create.pl diff --git a/Literature/script/literature_fastcgi.pl b/Literature.cat/script/literature_fastcgi.pl similarity index 100% rename from Literature/script/literature_fastcgi.pl rename to Literature.cat/script/literature_fastcgi.pl diff --git a/Literature/script/literature_server.pl b/Literature.cat/script/literature_server.pl similarity index 100% rename from Literature/script/literature_server.pl rename to Literature.cat/script/literature_server.pl diff --git a/Literature/script/literature_test.pl b/Literature.cat/script/literature_test.pl similarity index 100% rename from Literature/script/literature_test.pl rename to Literature.cat/script/literature_test.pl diff --git a/Literature/t/01app.t b/Literature.cat/t/01app.t similarity index 100% rename from Literature/t/01app.t rename to Literature.cat/t/01app.t diff --git a/Literature/t/02pod.t b/Literature.cat/t/02pod.t similarity index 100% rename from Literature/t/02pod.t rename to Literature.cat/t/02pod.t diff --git a/Literature/t/03podcoverage.t b/Literature.cat/t/03podcoverage.t similarity index 100% rename from Literature/t/03podcoverage.t rename to Literature.cat/t/03podcoverage.t diff --git a/Literature/t/controller_Actors.t b/Literature.cat/t/controller_Actors.t similarity index 100% rename from Literature/t/controller_Actors.t rename to Literature.cat/t/controller_Actors.t diff --git a/Literature/t/controller_Author.t b/Literature.cat/t/controller_Author.t similarity index 100% rename from Literature/t/controller_Author.t rename to Literature.cat/t/controller_Author.t diff --git a/Literature/t/controller_Characters.t b/Literature.cat/t/controller_Characters.t similarity index 100% rename from Literature/t/controller_Characters.t rename to Literature.cat/t/controller_Characters.t diff --git a/Literature/t/controller_Productions.t b/Literature.cat/t/controller_Productions.t similarity index 100% rename from Literature/t/controller_Productions.t rename to Literature.cat/t/controller_Productions.t diff --git a/Literature/t/controller_Site.t b/Literature.cat/t/controller_Site.t similarity index 100% rename from Literature/t/controller_Site.t rename to Literature.cat/t/controller_Site.t diff --git a/Literature/t/controller_Works.t b/Literature.cat/t/controller_Works.t similarity index 100% rename from Literature/t/controller_Works.t rename to Literature.cat/t/controller_Works.t diff --git a/Literature/t/model_DB.t b/Literature.cat/t/model_DB.t similarity index 100% rename from Literature/t/model_DB.t rename to Literature.cat/t/model_DB.t diff --git a/Literature/t/view_TT.t b/Literature.cat/t/view_TT.t similarity index 100% rename from Literature/t/view_TT.t rename to Literature.cat/t/view_TT.t diff --git a/Literature/MANIFEST b/Literature/MANIFEST new file mode 100644 index 0000000..ba97036 --- /dev/null +++ b/Literature/MANIFEST @@ -0,0 +1,23 @@ +MANIFEST +cpanfile +config.yml +MANIFEST.SKIP +Makefile.PL +environments/development.yml +environments/production.yml +views/index.tt +views/layouts/main.tt +public/favicon.ico +public/404.html +public/dispatch.fcgi +public/dispatch.cgi +public/500.html +public/css/error.css +public/css/style.css +public/images/perldancer.jpg +public/images/perldancer-bg.jpg +public/javascripts/jquery.js +bin/app.psgi +t/001_base.t +t/002_index_route.t +lib/Literature.pm diff --git a/Literature/MANIFEST.SKIP b/Literature/MANIFEST.SKIP new file mode 100644 index 0000000..88edc0a --- /dev/null +++ b/Literature/MANIFEST.SKIP @@ -0,0 +1,17 @@ +^\.git\/ +maint +^tags$ +.last_cover_stats +Makefile$ +^blib +^pm_to_blib +^.*.bak +^.*.old +^t.*sessions +^cover_db +^.*\.log +^.*\.swp$ +MYMETA.* +^.gitignore +^.svn\/ +^Literature- diff --git a/Literature/META.yml b/Literature/META.yml deleted file mode 100644 index c2eb700..0000000 --- a/Literature/META.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -abstract: 'Catalyst based application' -author: - - 'Dave Cross' -build_requires: - ExtUtils::MakeMaker: 6.42 -configure_requires: - ExtUtils::MakeMaker: 6.42 -distribution_type: module -generated_by: 'Module::Install version 0.91' -license: perl -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 -name: Literature -no_index: - directory: - - inc - - t -requires: - Catalyst::Action::RenderView: 0 - Catalyst::Plugin::ConfigLoader: 0 - Catalyst::Plugin::Static::Simple: 0 - Catalyst::Runtime: 5.80013 - Config::General: 0 - parent: 0 -resources: - license: http://dev.perl.org/licenses/ -version: 0.01 diff --git a/Literature/Makefile.PL b/Literature/Makefile.PL index 390c1c9..c9bd610 100644 --- a/Literature/Makefile.PL +++ b/Literature/Makefile.PL @@ -1,21 +1,26 @@ -#!/usr/bin/env perl -# IMPORTANT: if you delete this file your app will not work as -# expected. You have been warned. -use inc::Module::Install; +use strict; +use warnings; +use ExtUtils::MakeMaker; -name 'Literature'; -all_from 'lib/Literature.pm'; +# Normalize version strings like 6.30_02 to 6.3002, +# so that we can do numerical comparisons on it. +my $eumm_version = $ExtUtils::MakeMaker::VERSION; +$eumm_version =~ s/_//; -requires 'Catalyst::Runtime' => '5.80013'; -requires 'Catalyst::Plugin::ConfigLoader'; -requires 'Catalyst::Plugin::Static::Simple'; -requires 'Catalyst::Action::RenderView'; -requires 'Catalyst::Plugin::StackTrace'; -requires 'parent'; -requires 'Config::General'; # This should reflect the config file format you've chosen - # See Catalyst::Plugin::ConfigLoader for supported formats -catalyst; - -install_script glob('script/*.pl'); -auto_install; -WriteAll; +WriteMakefile( + NAME => 'Literature', + AUTHOR => q{YOUR NAME }, + VERSION_FROM => 'lib/Literature.pm', + ABSTRACT => 'YOUR APPLICATION ABSTRACT', + ($eumm_version >= 6.3001 + ? ('LICENSE'=> 'perl') + : ()), + PL_FILES => {}, + PREREQ_PM => { + 'Test::More' => 0, + 'YAML' => 0, + 'Dancer2' => 0.160000, + }, + dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, + clean => { FILES => 'Literature-*' }, +); diff --git a/Literature/bin/app.psgi b/Literature/bin/app.psgi new file mode 100755 index 0000000..317485b --- /dev/null +++ b/Literature/bin/app.psgi @@ -0,0 +1,9 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use FindBin; +use lib "$FindBin::Bin/../lib"; + +use Literature; +Literature->to_app; diff --git a/Literature/config.yml b/Literature/config.yml new file mode 100644 index 0000000..4d9f0b9 --- /dev/null +++ b/Literature/config.yml @@ -0,0 +1,34 @@ +# This is the main configuration file of your Dancer2 app +# env-related settings should go to environments/$env.yml +# all the settings in this file will be loaded at Dancer's startup. + +# Your application's name +appname: "Literature" + +# The default layout to use for your application (located in +# views/layouts/main.tt) +layout: "main" + +# when the charset is set to UTF-8 Dancer2 will handle for you +# all the magic of encoding and decoding. You should not care +# about unicode within your app when this setting is set (recommended). +charset: "UTF-8" + +# template engine +# simple: default and very basic template engine +# template_toolkit: TT + +# template: "simple" + +template: "template_toolkit" +engines: + template: + template_toolkit: + start_tag: '[%' + end_tag: '%]' + +plugins: + DBIC: + default: + schema_class: Literature::Schema + dsn: dbi:mysql:database=literature diff --git a/Literature/cpanfile b/Literature/cpanfile new file mode 100644 index 0000000..5a618da --- /dev/null +++ b/Literature/cpanfile @@ -0,0 +1,11 @@ +requires "Dancer2" => "0.160000"; + +recommends "YAML" => "0"; +recommends "URL::Encode::XS" => "0"; +recommends "CGI::Deurl::XS" => "0"; +recommends "HTTP::Parser::XS" => "0"; + +on "test" => sub { + requires "Test::More" => "0"; + requires "HTTP::Request::Common" => "0"; +}; diff --git a/Literature/environments/development.yml b/Literature/environments/development.yml new file mode 100644 index 0000000..b63fe64 --- /dev/null +++ b/Literature/environments/development.yml @@ -0,0 +1,23 @@ +# configuration file for development environment + +# the logger engine to use +# console: log messages to STDOUT (your console where you started the +# application server) +# file: log message to a file in log/ +logger: "console" + +# the log level for this environment +# core is the lowest, it shows Dancer2's core log messages as well as yours +# (debug, info, warning and error) +log: "core" + +# should Dancer2 consider warnings as critical errors? +warnings: 1 + +# should Dancer2 show a stacktrace when an error is caught? +# if set to yes, public/500.html will be ignored and either +# views/500.tt, 'error_template' template, or a default error template will be used. +show_errors: 1 + +# print the banner +startup_info: 1 diff --git a/Literature/environments/production.yml b/Literature/environments/production.yml new file mode 100644 index 0000000..41b436f --- /dev/null +++ b/Literature/environments/production.yml @@ -0,0 +1,16 @@ +# configuration file for production environment + +# only log warning and error messsages +log: "warning" + +# log message to a file in logs/ +logger: "file" + +# don't consider warnings critical +warnings: 0 + +# hide errors +show_errors: 0 + +# disable server tokens in production environments +no_server_tokens: 1 diff --git a/Literature/inc/Module/AutoInstall.pm b/Literature/inc/Module/AutoInstall.pm deleted file mode 100644 index dfb8ef7..0000000 --- a/Literature/inc/Module/AutoInstall.pm +++ /dev/null @@ -1,805 +0,0 @@ -#line 1 -package Module::AutoInstall; - -use strict; -use Cwd (); -use ExtUtils::MakeMaker (); - -use vars qw{$VERSION}; -BEGIN { - $VERSION = '1.03'; -} - -# special map on pre-defined feature sets -my %FeatureMap = ( - '' => 'Core Features', # XXX: deprecated - '-core' => 'Core Features', -); - -# various lexical flags -my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $HasCPANPLUS ); -my ( - $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps -); -my ( $PostambleActions, $PostambleUsed ); - -# See if it's a testing or non-interactive session -_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN ); -_init(); - -sub _accept_default { - $AcceptDefault = shift; -} - -sub missing_modules { - return @Missing; -} - -sub do_install { - __PACKAGE__->install( - [ - $Config - ? ( UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) - : () - ], - @Missing, - ); -} - -# initialize various flags, and/or perform install -sub _init { - foreach my $arg ( - @ARGV, - split( - /[\s\t]+/, - $ENV{PERL_AUTOINSTALL} || $ENV{PERL_EXTUTILS_AUTOINSTALL} || '' - ) - ) - { - if ( $arg =~ /^--config=(.*)$/ ) { - $Config = [ split( ',', $1 ) ]; - } - elsif ( $arg =~ /^--installdeps=(.*)$/ ) { - __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) ); - exit 0; - } - elsif ( $arg =~ /^--default(?:deps)?$/ ) { - $AcceptDefault = 1; - } - elsif ( $arg =~ /^--check(?:deps)?$/ ) { - $CheckOnly = 1; - } - elsif ( $arg =~ /^--skip(?:deps)?$/ ) { - $SkipInstall = 1; - } - elsif ( $arg =~ /^--test(?:only)?$/ ) { - $TestOnly = 1; - } - elsif ( $arg =~ /^--all(?:deps)?$/ ) { - $AllDeps = 1; - } - } -} - -# overrides MakeMaker's prompt() to automatically accept the default choice -sub _prompt { - goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault; - - my ( $prompt, $default ) = @_; - my $y = ( $default =~ /^[Yy]/ ); - - print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] '; - print "$default\n"; - return $default; -} - -# the workhorse -sub import { - my $class = shift; - my @args = @_ or return; - my $core_all; - - print "*** $class version " . $class->VERSION . "\n"; - print "*** Checking for Perl dependencies...\n"; - - my $cwd = Cwd::cwd(); - - $Config = []; - - my $maxlen = length( - ( - sort { length($b) <=> length($a) } - grep { /^[^\-]/ } - map { - ref($_) - ? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} ) - : '' - } - map { +{@args}->{$_} } - grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} } - )[0] - ); - - # We want to know if we're under CPAN early to avoid prompting, but - # if we aren't going to try and install anything anyway then skip the - # check entirely since we don't want to have to load (and configure) - # an old CPAN just for a cosmetic message - - $UnderCPAN = _check_lock(1) unless $SkipInstall; - - while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) { - my ( @required, @tests, @skiptests ); - my $default = 1; - my $conflict = 0; - - if ( $feature =~ m/^-(\w+)$/ ) { - my $option = lc($1); - - # check for a newer version of myself - _update_to( $modules, @_ ) and return if $option eq 'version'; - - # sets CPAN configuration options - $Config = $modules if $option eq 'config'; - - # promote every features to core status - $core_all = ( $modules =~ /^all$/i ) and next - if $option eq 'core'; - - next unless $option eq 'core'; - } - - print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n"; - - $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' ); - - unshift @$modules, -default => &{ shift(@$modules) } - if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward combatability - - while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) { - if ( $mod =~ m/^-(\w+)$/ ) { - my $option = lc($1); - - $default = $arg if ( $option eq 'default' ); - $conflict = $arg if ( $option eq 'conflict' ); - @tests = @{$arg} if ( $option eq 'tests' ); - @skiptests = @{$arg} if ( $option eq 'skiptests' ); - - next; - } - - printf( "- %-${maxlen}s ...", $mod ); - - if ( $arg and $arg =~ /^\D/ ) { - unshift @$modules, $arg; - $arg = 0; - } - - # XXX: check for conflicts and uninstalls(!) them. - my $cur = _load($mod); - if (_version_cmp ($cur, $arg) >= 0) - { - print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n"; - push @Existing, $mod => $arg; - $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; - } - else { - if (not defined $cur) # indeed missing - { - print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n"; - } - else - { - # no need to check $arg as _version_cmp ($cur, undef) would satisfy >= above - print "too old. ($cur < $arg)\n"; - } - - push @required, $mod => $arg; - } - } - - next unless @required; - - my $mandatory = ( $feature eq '-core' or $core_all ); - - if ( - !$SkipInstall - and ( - $CheckOnly - or ($mandatory and $UnderCPAN) - or $AllDeps - or _prompt( - qq{==> Auto-install the } - . ( @required / 2 ) - . ( $mandatory ? ' mandatory' : ' optional' ) - . qq{ module(s) from CPAN?}, - $default ? 'y' : 'n', - ) =~ /^[Yy]/ - ) - ) - { - push( @Missing, @required ); - $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; - } - - elsif ( !$SkipInstall - and $default - and $mandatory - and - _prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', ) - =~ /^[Nn]/ ) - { - push( @Missing, @required ); - $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; - } - - else { - $DisabledTests{$_} = 1 for map { glob($_) } @tests; - } - } - - if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) { - require Config; - print -"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n"; - - # make an educated guess of whether we'll need root permission. - print " (You may need to do that as the 'root' user.)\n" - if eval '$>'; - } - print "*** $class configuration finished.\n"; - - chdir $cwd; - - # import to main:: - no strict 'refs'; - *{'main::WriteMakefile'} = \&Write if caller(0) eq 'main'; -} - -sub _running_under { - my $thing = shift; - print <<"END_MESSAGE"; -*** Since we're running under ${thing}, I'll just let it take care - of the dependency's installation later. -END_MESSAGE - return 1; -} - -# Check to see if we are currently running under CPAN.pm and/or CPANPLUS; -# if we are, then we simply let it taking care of our dependencies -sub _check_lock { - return unless @Missing or @_; - - my $cpan_env = $ENV{PERL5_CPAN_IS_RUNNING}; - - if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) { - return _running_under($cpan_env ? 'CPAN' : 'CPANPLUS'); - } - - require CPAN; - - if ($CPAN::VERSION > '1.89') { - if ($cpan_env) { - return _running_under('CPAN'); - } - return; # CPAN.pm new enough, don't need to check further - } - - # last ditch attempt, this -will- configure CPAN, very sorry - - _load_cpan(1); # force initialize even though it's already loaded - - # Find the CPAN lock-file - my $lock = MM->catfile( $CPAN::Config->{cpan_home}, ".lock" ); - return unless -f $lock; - - # Check the lock - local *LOCK; - return unless open(LOCK, $lock); - - if ( - ( $^O eq 'MSWin32' ? _under_cpan() : == getppid() ) - and ( $CPAN::Config->{prerequisites_policy} || '' ) ne 'ignore' - ) { - print <<'END_MESSAGE'; - -*** Since we're running under CPAN, I'll just let it take care - of the dependency's installation later. -END_MESSAGE - return 1; - } - - close LOCK; - return; -} - -sub install { - my $class = shift; - - my $i; # used below to strip leading '-' from config keys - my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } ); - - my ( @modules, @installed ); - while ( my ( $pkg, $ver ) = splice( @_, 0, 2 ) ) { - - # grep out those already installed - if ( _version_cmp( _load($pkg), $ver ) >= 0 ) { - push @installed, $pkg; - } - else { - push @modules, $pkg, $ver; - } - } - - return @installed unless @modules; # nothing to do - return @installed if _check_lock(); # defer to the CPAN shell - - print "*** Installing dependencies...\n"; - - return unless _connected_to('cpan.org'); - - my %args = @config; - my %failed; - local *FAILED; - if ( $args{do_once} and open( FAILED, '.#autoinstall.failed' ) ) { - while () { chomp; $failed{$_}++ } - close FAILED; - - my @newmod; - while ( my ( $k, $v ) = splice( @modules, 0, 2 ) ) { - push @newmod, ( $k => $v ) unless $failed{$k}; - } - @modules = @newmod; - } - - if ( _has_cpanplus() and not $ENV{PERL_AUTOINSTALL_PREFER_CPAN} ) { - _install_cpanplus( \@modules, \@config ); - } else { - _install_cpan( \@modules, \@config ); - } - - print "*** $class installation finished.\n"; - - # see if we have successfully installed them - while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { - if ( _version_cmp( _load($pkg), $ver ) >= 0 ) { - push @installed, $pkg; - } - elsif ( $args{do_once} and open( FAILED, '>> .#autoinstall.failed' ) ) { - print FAILED "$pkg\n"; - } - } - - close FAILED if $args{do_once}; - - return @installed; -} - -sub _install_cpanplus { - my @modules = @{ +shift }; - my @config = _cpanplus_config( @{ +shift } ); - my $installed = 0; - - require CPANPLUS::Backend; - my $cp = CPANPLUS::Backend->new; - my $conf = $cp->configure_object; - - return unless $conf->can('conf') # 0.05x+ with "sudo" support - or _can_write($conf->_get_build('base')); # 0.04x - - # if we're root, set UNINST=1 to avoid trouble unless user asked for it. - my $makeflags = $conf->get_conf('makeflags') || ''; - if ( UNIVERSAL::isa( $makeflags, 'HASH' ) ) { - # 0.03+ uses a hashref here - $makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST}; - - } else { - # 0.02 and below uses a scalar - $makeflags = join( ' ', split( ' ', $makeflags ), 'UNINST=1' ) - if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } ); - - } - $conf->set_conf( makeflags => $makeflags ); - $conf->set_conf( prereqs => 1 ); - - - - while ( my ( $key, $val ) = splice( @config, 0, 2 ) ) { - $conf->set_conf( $key, $val ); - } - - my $modtree = $cp->module_tree; - while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { - print "*** Installing $pkg...\n"; - - MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall; - - my $success; - my $obj = $modtree->{$pkg}; - - if ( $obj and _version_cmp( $obj->{version}, $ver ) >= 0 ) { - my $pathname = $pkg; - $pathname =~ s/::/\\W/; - - foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) { - delete $INC{$inc}; - } - - my $rv = $cp->install( modules => [ $obj->{module} ] ); - - if ( $rv and ( $rv->{ $obj->{module} } or $rv->{ok} ) ) { - print "*** $pkg successfully installed.\n"; - $success = 1; - } else { - print "*** $pkg installation cancelled.\n"; - $success = 0; - } - - $installed += $success; - } else { - print << "."; -*** Could not find a version $ver or above for $pkg; skipping. -. - } - - MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall; - } - - return $installed; -} - -sub _cpanplus_config { - my @config = (); - while ( @_ ) { - my ($key, $value) = (shift(), shift()); - if ( $key eq 'prerequisites_policy' ) { - if ( $value eq 'follow' ) { - $value = CPANPLUS::Internals::Constants::PREREQ_INSTALL(); - } elsif ( $value eq 'ask' ) { - $value = CPANPLUS::Internals::Constants::PREREQ_ASK(); - } elsif ( $value eq 'ignore' ) { - $value = CPANPLUS::Internals::Constants::PREREQ_IGNORE(); - } else { - die "*** Cannot convert option $key = '$value' to CPANPLUS version.\n"; - } - } else { - die "*** Cannot convert option $key to CPANPLUS version.\n"; - } - } - return @config; -} - -sub _install_cpan { - my @modules = @{ +shift }; - my @config = @{ +shift }; - my $installed = 0; - my %args; - - _load_cpan(); - require Config; - - if (CPAN->VERSION < 1.80) { - # no "sudo" support, probe for writableness - return unless _can_write( MM->catfile( $CPAN::Config->{cpan_home}, 'sources' ) ) - and _can_write( $Config::Config{sitelib} ); - } - - # if we're root, set UNINST=1 to avoid trouble unless user asked for it. - my $makeflags = $CPAN::Config->{make_install_arg} || ''; - $CPAN::Config->{make_install_arg} = - join( ' ', split( ' ', $makeflags ), 'UNINST=1' ) - if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } ); - - # don't show start-up info - $CPAN::Config->{inhibit_startup_message} = 1; - - # set additional options - while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) { - ( $args{$opt} = $arg, next ) - if $opt =~ /^force$/; # pseudo-option - $CPAN::Config->{$opt} = $arg; - } - - local $CPAN::Config->{prerequisites_policy} = 'follow'; - - while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { - MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall; - - print "*** Installing $pkg...\n"; - - my $obj = CPAN::Shell->expand( Module => $pkg ); - my $success = 0; - - if ( $obj and _version_cmp( $obj->cpan_version, $ver ) >= 0 ) { - my $pathname = $pkg; - $pathname =~ s/::/\\W/; - - foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) { - delete $INC{$inc}; - } - - my $rv = $args{force} ? CPAN::Shell->force( install => $pkg ) - : CPAN::Shell->install($pkg); - $rv ||= eval { - $CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, ) - ->{install} - if $CPAN::META; - }; - - if ( $rv eq 'YES' ) { - print "*** $pkg successfully installed.\n"; - $success = 1; - } - else { - print "*** $pkg installation failed.\n"; - $success = 0; - } - - $installed += $success; - } - else { - print << "."; -*** Could not find a version $ver or above for $pkg; skipping. -. - } - - MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall; - } - - return $installed; -} - -sub _has_cpanplus { - return ( - $HasCPANPLUS = ( - $INC{'CPANPLUS/Config.pm'} - or _load('CPANPLUS::Shell::Default') - ) - ); -} - -# make guesses on whether we're under the CPAN installation directory -sub _under_cpan { - require Cwd; - require File::Spec; - - my $cwd = File::Spec->canonpath( Cwd::cwd() ); - my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} ); - - return ( index( $cwd, $cpan ) > -1 ); -} - -sub _update_to { - my $class = __PACKAGE__; - my $ver = shift; - - return - if _version_cmp( _load($class), $ver ) >= 0; # no need to upgrade - - if ( - _prompt( "==> A newer version of $class ($ver) is required. Install?", - 'y' ) =~ /^[Nn]/ - ) - { - die "*** Please install $class $ver manually.\n"; - } - - print << "."; -*** Trying to fetch it from CPAN... -. - - # install ourselves - _load($class) and return $class->import(@_) - if $class->install( [], $class, $ver ); - - print << '.'; exit 1; - -*** Cannot bootstrap myself. :-( Installation terminated. -. -} - -# check if we're connected to some host, using inet_aton -sub _connected_to { - my $site = shift; - - return ( - ( _load('Socket') and Socket::inet_aton($site) ) or _prompt( - qq( -*** Your host cannot resolve the domain name '$site', which - probably means the Internet connections are unavailable. -==> Should we try to install the required module(s) anyway?), 'n' - ) =~ /^[Yy]/ - ); -} - -# check if a directory is writable; may create it on demand -sub _can_write { - my $path = shift; - mkdir( $path, 0755 ) unless -e $path; - - return 1 if -w $path; - - print << "."; -*** You are not allowed to write to the directory '$path'; - the installation may fail due to insufficient permissions. -. - - if ( - eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt( - qq( -==> Should we try to re-execute the autoinstall process with 'sudo'?), - ((-t STDIN) ? 'y' : 'n') - ) =~ /^[Yy]/ - ) - { - - # try to bootstrap ourselves from sudo - print << "."; -*** Trying to re-execute the autoinstall process with 'sudo'... -. - my $missing = join( ',', @Missing ); - my $config = join( ',', - UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) - if $Config; - - return - unless system( 'sudo', $^X, $0, "--config=$config", - "--installdeps=$missing" ); - - print << "."; -*** The 'sudo' command exited with error! Resuming... -. - } - - return _prompt( - qq( -==> Should we try to install the required module(s) anyway?), 'n' - ) =~ /^[Yy]/; -} - -# load a module and return the version it reports -sub _load { - my $mod = pop; # class/instance doesn't matter - my $file = $mod; - - $file =~ s|::|/|g; - $file .= '.pm'; - - local $@; - return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 ); -} - -# Load CPAN.pm and it's configuration -sub _load_cpan { - return if $CPAN::VERSION and $CPAN::Config and not @_; - require CPAN; - if ( $CPAN::HandleConfig::VERSION ) { - # Newer versions of CPAN have a HandleConfig module - CPAN::HandleConfig->load; - } else { - # Older versions had the load method in Config directly - CPAN::Config->load; - } -} - -# compare two versions, either use Sort::Versions or plain comparison -# return values same as <=> -sub _version_cmp { - my ( $cur, $min ) = @_; - return -1 unless defined $cur; # if 0 keep comparing - return 1 unless $min; - - $cur =~ s/\s+$//; - - # check for version numbers that are not in decimal format - if ( ref($cur) or ref($min) or $cur =~ /v|\..*\./ or $min =~ /v|\..*\./ ) { - if ( ( $version::VERSION or defined( _load('version') )) and - version->can('new') - ) { - - # use version.pm if it is installed. - return version->new($cur) <=> version->new($min); - } - elsif ( $Sort::Versions::VERSION or defined( _load('Sort::Versions') ) ) - { - - # use Sort::Versions as the sorting algorithm for a.b.c versions - return Sort::Versions::versioncmp( $cur, $min ); - } - - warn "Cannot reliably compare non-decimal formatted versions.\n" - . "Please install version.pm or Sort::Versions.\n"; - } - - # plain comparison - local $^W = 0; # shuts off 'not numeric' bugs - return $cur <=> $min; -} - -# nothing; this usage is deprecated. -sub main::PREREQ_PM { return {}; } - -sub _make_args { - my %args = @_; - - $args{PREREQ_PM} = { %{ $args{PREREQ_PM} || {} }, @Existing, @Missing } - if $UnderCPAN or $TestOnly; - - if ( $args{EXE_FILES} and -e 'MANIFEST' ) { - require ExtUtils::Manifest; - my $manifest = ExtUtils::Manifest::maniread('MANIFEST'); - - $args{EXE_FILES} = - [ grep { exists $manifest->{$_} } @{ $args{EXE_FILES} } ]; - } - - $args{test}{TESTS} ||= 't/*.t'; - $args{test}{TESTS} = join( ' ', - grep { !exists( $DisabledTests{$_} ) } - map { glob($_) } split( /\s+/, $args{test}{TESTS} ) ); - - my $missing = join( ',', @Missing ); - my $config = - join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) - if $Config; - - $PostambleActions = ( - ($missing and not $UnderCPAN) - ? "\$(PERL) $0 --config=$config --installdeps=$missing" - : "\$(NOECHO) \$(NOOP)" - ); - - return %args; -} - -# a wrapper to ExtUtils::MakeMaker::WriteMakefile -sub Write { - require Carp; - Carp::croak "WriteMakefile: Need even number of args" if @_ % 2; - - if ($CheckOnly) { - print << "."; -*** Makefile not written in check-only mode. -. - return; - } - - my %args = _make_args(@_); - - no strict 'refs'; - - $PostambleUsed = 0; - local *MY::postamble = \&postamble unless defined &MY::postamble; - ExtUtils::MakeMaker::WriteMakefile(%args); - - print << "." unless $PostambleUsed; -*** WARNING: Makefile written with customized MY::postamble() without - including contents from Module::AutoInstall::postamble() -- - auto installation features disabled. Please contact the author. -. - - return 1; -} - -sub postamble { - $PostambleUsed = 1; - - return <<"END_MAKE"; - -config :: installdeps -\t\$(NOECHO) \$(NOOP) - -checkdeps :: -\t\$(PERL) $0 --checkdeps - -installdeps :: -\t$PostambleActions - -END_MAKE - -} - -1; - -__END__ - -#line 1056 diff --git a/Literature/inc/Module/Install.pm b/Literature/inc/Module/Install.pm deleted file mode 100644 index 51eda5d..0000000 --- a/Literature/inc/Module/Install.pm +++ /dev/null @@ -1,430 +0,0 @@ -#line 1 -package Module::Install; - -# For any maintainers: -# The load order for Module::Install is a bit magic. -# It goes something like this... -# -# IF ( host has Module::Install installed, creating author mode ) { -# 1. Makefile.PL calls "use inc::Module::Install" -# 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install -# 3. The installed version of inc::Module::Install loads -# 4. inc::Module::Install calls "require Module::Install" -# 5. The ./inc/ version of Module::Install loads -# } ELSE { -# 1. Makefile.PL calls "use inc::Module::Install" -# 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install -# 3. The ./inc/ version of Module::Install loads -# } - -use 5.005; -use strict 'vars'; - -use vars qw{$VERSION $MAIN}; -BEGIN { - # All Module::Install core packages now require synchronised versions. - # This will be used to ensure we don't accidentally load old or - # different versions of modules. - # This is not enforced yet, but will be some time in the next few - # releases once we can make sure it won't clash with custom - # Module::Install extensions. - $VERSION = '0.91'; - - # Storage for the pseudo-singleton - $MAIN = undef; - - *inc::Module::Install::VERSION = *VERSION; - @inc::Module::Install::ISA = __PACKAGE__; - -} - - - - - -# Whether or not inc::Module::Install is actually loaded, the -# $INC{inc/Module/Install.pm} is what will still get set as long as -# the caller loaded module this in the documented manner. -# If not set, the caller may NOT have loaded the bundled version, and thus -# they may not have a MI version that works with the Makefile.PL. This would -# result in false errors or unexpected behaviour. And we don't want that. -my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; -unless ( $INC{$file} ) { die <<"END_DIE" } - -Please invoke ${\__PACKAGE__} with: - - use inc::${\__PACKAGE__}; - -not: - - use ${\__PACKAGE__}; - -END_DIE - - - - - -# If the script that is loading Module::Install is from the future, -# then make will detect this and cause it to re-run over and over -# again. This is bad. Rather than taking action to touch it (which -# is unreliable on some platforms and requires write permissions) -# for now we should catch this and refuse to run. -if ( -f $0 ) { - my $s = (stat($0))[9]; - - # If the modification time is only slightly in the future, - # sleep briefly to remove the problem. - my $a = $s - time; - if ( $a > 0 and $a < 5 ) { sleep 5 } - - # Too far in the future, throw an error. - my $t = time; - if ( $s > $t ) { die <<"END_DIE" } - -Your installer $0 has a modification time in the future ($s > $t). - -This is known to create infinite loops in make. - -Please correct this, then run $0 again. - -END_DIE -} - - - - - -# Build.PL was formerly supported, but no longer is due to excessive -# difficulty in implementing every single feature twice. -if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } - -Module::Install no longer supports Build.PL. - -It was impossible to maintain duel backends, and has been deprecated. - -Please remove all Build.PL files and only use the Makefile.PL installer. - -END_DIE - - - - - -# To save some more typing in Module::Install installers, every... -# use inc::Module::Install -# ...also acts as an implicit use strict. -$^H |= strict::bits(qw(refs subs vars)); - - - - - -use Cwd (); -use File::Find (); -use File::Path (); -use FindBin; - -sub autoload { - my $self = shift; - my $who = $self->_caller; - my $cwd = Cwd::cwd(); - my $sym = "${who}::AUTOLOAD"; - $sym->{$cwd} = sub { - my $pwd = Cwd::cwd(); - if ( my $code = $sym->{$pwd} ) { - # Delegate back to parent dirs - goto &$code unless $cwd eq $pwd; - } - $$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym"; - my $method = $1; - if ( uc($method) eq $method ) { - # Do nothing - return; - } elsif ( $method =~ /^_/ and $self->can($method) ) { - # Dispatch to the root M:I class - return $self->$method(@_); - } - - # Dispatch to the appropriate plugin - unshift @_, ( $self, $1 ); - goto &{$self->can('call')}; - }; -} - -sub import { - my $class = shift; - my $self = $class->new(@_); - my $who = $self->_caller; - - unless ( -f $self->{file} ) { - require "$self->{path}/$self->{dispatch}.pm"; - File::Path::mkpath("$self->{prefix}/$self->{author}"); - $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); - $self->{admin}->init; - @_ = ($class, _self => $self); - goto &{"$self->{name}::import"}; - } - - *{"${who}::AUTOLOAD"} = $self->autoload; - $self->preload; - - # Unregister loader and worker packages so subdirs can use them again - delete $INC{"$self->{file}"}; - delete $INC{"$self->{path}.pm"}; - - # Save to the singleton - $MAIN = $self; - - return 1; -} - -sub preload { - my $self = shift; - unless ( $self->{extensions} ) { - $self->load_extensions( - "$self->{prefix}/$self->{path}", $self - ); - } - - my @exts = @{$self->{extensions}}; - unless ( @exts ) { - @exts = $self->{admin}->load_all_extensions; - } - - my %seen; - foreach my $obj ( @exts ) { - while (my ($method, $glob) = each %{ref($obj) . '::'}) { - next unless $obj->can($method); - next if $method =~ /^_/; - next if $method eq uc($method); - $seen{$method}++; - } - } - - my $who = $self->_caller; - foreach my $name ( sort keys %seen ) { - *{"${who}::$name"} = sub { - ${"${who}::AUTOLOAD"} = "${who}::$name"; - goto &{"${who}::AUTOLOAD"}; - }; - } -} - -sub new { - my ($class, %args) = @_; - - # ignore the prefix on extension modules built from top level. - my $base_path = Cwd::abs_path($FindBin::Bin); - unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) { - delete $args{prefix}; - } - - return $args{_self} if $args{_self}; - - $args{dispatch} ||= 'Admin'; - $args{prefix} ||= 'inc'; - $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); - $args{bundle} ||= 'inc/BUNDLES'; - $args{base} ||= $base_path; - $class =~ s/^\Q$args{prefix}\E:://; - $args{name} ||= $class; - $args{version} ||= $class->VERSION; - unless ( $args{path} ) { - $args{path} = $args{name}; - $args{path} =~ s!::!/!g; - } - $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; - $args{wrote} = 0; - - bless( \%args, $class ); -} - -sub call { - my ($self, $method) = @_; - my $obj = $self->load($method) or return; - splice(@_, 0, 2, $obj); - goto &{$obj->can($method)}; -} - -sub load { - my ($self, $method) = @_; - - $self->load_extensions( - "$self->{prefix}/$self->{path}", $self - ) unless $self->{extensions}; - - foreach my $obj (@{$self->{extensions}}) { - return $obj if $obj->can($method); - } - - my $admin = $self->{admin} or die <<"END_DIE"; -The '$method' method does not exist in the '$self->{prefix}' path! -Please remove the '$self->{prefix}' directory and run $0 again to load it. -END_DIE - - my $obj = $admin->load($method, 1); - push @{$self->{extensions}}, $obj; - - $obj; -} - -sub load_extensions { - my ($self, $path, $top) = @_; - - unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { - unshift @INC, $self->{prefix}; - } - - foreach my $rv ( $self->find_extensions($path) ) { - my ($file, $pkg) = @{$rv}; - next if $self->{pathnames}{$pkg}; - - local $@; - my $new = eval { require $file; $pkg->can('new') }; - unless ( $new ) { - warn $@ if $@; - next; - } - $self->{pathnames}{$pkg} = delete $INC{$file}; - push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); - } - - $self->{extensions} ||= []; -} - -sub find_extensions { - my ($self, $path) = @_; - - my @found; - File::Find::find( sub { - my $file = $File::Find::name; - return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; - my $subpath = $1; - return if lc($subpath) eq lc($self->{dispatch}); - - $file = "$self->{path}/$subpath.pm"; - my $pkg = "$self->{name}::$subpath"; - $pkg =~ s!/!::!g; - - # If we have a mixed-case package name, assume case has been preserved - # correctly. Otherwise, root through the file to locate the case-preserved - # version of the package name. - if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { - my $content = Module::Install::_read($subpath . '.pm'); - my $in_pod = 0; - foreach ( split //, $content ) { - $in_pod = 1 if /^=\w/; - $in_pod = 0 if /^=cut/; - next if ($in_pod || /^=cut/); # skip pod text - next if /^\s*#/; # and comments - if ( m/^\s*package\s+($pkg)\s*;/i ) { - $pkg = $1; - last; - } - } - } - - push @found, [ $file, $pkg ]; - }, $path ) if -d $path; - - @found; -} - - - - - -##################################################################### -# Common Utility Functions - -sub _caller { - my $depth = 0; - my $call = caller($depth); - while ( $call eq __PACKAGE__ ) { - $depth++; - $call = caller($depth); - } - return $call; -} - -sub _read { - local *FH; - if ( $] >= 5.006 ) { - open( FH, '<', $_[0] ) or die "open($_[0]): $!"; - } else { - open( FH, "< $_[0]" ) or die "open($_[0]): $!"; - } - my $string = do { local $/; }; - close FH or die "close($_[0]): $!"; - return $string; -} - -sub _readperl { - my $string = Module::Install::_read($_[0]); - $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; - $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s; - $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg; - return $string; -} - -sub _readpod { - my $string = Module::Install::_read($_[0]); - $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; - return $string if $_[0] =~ /\.pod\z/; - $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg; - $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg; - $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg; - $string =~ s/^\n+//s; - return $string; -} - -sub _write { - local *FH; - if ( $] >= 5.006 ) { - open( FH, '>', $_[0] ) or die "open($_[0]): $!"; - } else { - open( FH, "> $_[0]" ) or die "open($_[0]): $!"; - } - foreach ( 1 .. $#_ ) { - print FH $_[$_] or die "print($_[0]): $!"; - } - close FH or die "close($_[0]): $!"; -} - -# _version is for processing module versions (eg, 1.03_05) not -# Perl versions (eg, 5.8.1). -sub _version ($) { - my $s = shift || 0; - my $d =()= $s =~ /(\.)/g; - if ( $d >= 2 ) { - # Normalise multipart versions - $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg; - } - $s =~ s/^(\d+)\.?//; - my $l = $1 || 0; - my @v = map { - $_ . '0' x (3 - length $_) - } $s =~ /(\d{1,3})\D?/g; - $l = $l . '.' . join '', @v if @v; - return $l + 0; -} - -sub _cmp ($$) { - _version($_[0]) <=> _version($_[1]); -} - -# Cloned from Params::Util::_CLASS -sub _CLASS ($) { - ( - defined $_[0] - and - ! ref $_[0] - and - $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s - ) ? $_[0] : undef; -} - -1; - -# Copyright 2008 - 2009 Adam Kennedy. diff --git a/Literature/inc/Module/Install/AutoInstall.pm b/Literature/inc/Module/Install/AutoInstall.pm deleted file mode 100644 index 58dd026..0000000 --- a/Literature/inc/Module/Install/AutoInstall.pm +++ /dev/null @@ -1,61 +0,0 @@ -#line 1 -package Module::Install::AutoInstall; - -use strict; -use Module::Install::Base (); - -use vars qw{$VERSION @ISA $ISCORE}; -BEGIN { - $VERSION = '0.91'; - @ISA = 'Module::Install::Base'; - $ISCORE = 1; -} - -sub AutoInstall { $_[0] } - -sub run { - my $self = shift; - $self->auto_install_now(@_); -} - -sub write { - my $self = shift; - $self->auto_install(@_); -} - -sub auto_install { - my $self = shift; - return if $self->{done}++; - - # Flatten array of arrays into a single array - my @core = map @$_, map @$_, grep ref, - $self->build_requires, $self->requires; - - my @config = @_; - - # We'll need Module::AutoInstall - $self->include('Module::AutoInstall'); - require Module::AutoInstall; - - Module::AutoInstall->import( - (@config ? (-config => \@config) : ()), - (@core ? (-core => \@core) : ()), - $self->features, - ); - - $self->makemaker_args( Module::AutoInstall::_make_args() ); - - my $class = ref($self); - $self->postamble( - "# --- $class section:\n" . - Module::AutoInstall::postamble() - ); -} - -sub auto_install_now { - my $self = shift; - $self->auto_install(@_); - Module::AutoInstall::do_install(); -} - -1; diff --git a/Literature/inc/Module/Install/Base.pm b/Literature/inc/Module/Install/Base.pm deleted file mode 100644 index 60a74d2..0000000 --- a/Literature/inc/Module/Install/Base.pm +++ /dev/null @@ -1,78 +0,0 @@ -#line 1 -package Module::Install::Base; - -use strict 'vars'; -use vars qw{$VERSION}; -BEGIN { - $VERSION = '0.91'; -} - -# Suspend handler for "redefined" warnings -BEGIN { - my $w = $SIG{__WARN__}; - $SIG{__WARN__} = sub { $w }; -} - -#line 42 - -sub new { - my $class = shift; - unless ( defined &{"${class}::call"} ) { - *{"${class}::call"} = sub { shift->_top->call(@_) }; - } - unless ( defined &{"${class}::load"} ) { - *{"${class}::load"} = sub { shift->_top->load(@_) }; - } - bless { @_ }, $class; -} - -#line 61 - -sub AUTOLOAD { - local $@; - my $func = eval { shift->_top->autoload } or return; - goto &$func; -} - -#line 75 - -sub _top { - $_[0]->{_top}; -} - -#line 90 - -sub admin { - $_[0]->_top->{admin} - or - Module::Install::Base::FakeAdmin->new; -} - -#line 106 - -sub is_admin { - $_[0]->admin->VERSION; -} - -sub DESTROY {} - -package Module::Install::Base::FakeAdmin; - -my $fake; - -sub new { - $fake ||= bless(\@_, $_[0]); -} - -sub AUTOLOAD {} - -sub DESTROY {} - -# Restore warning handler -BEGIN { - $SIG{__WARN__} = $SIG{__WARN__}->(); -} - -1; - -#line 154 diff --git a/Literature/inc/Module/Install/Can.pm b/Literature/inc/Module/Install/Can.pm deleted file mode 100644 index e65e4f6..0000000 --- a/Literature/inc/Module/Install/Can.pm +++ /dev/null @@ -1,81 +0,0 @@ -#line 1 -package Module::Install::Can; - -use strict; -use Config (); -use File::Spec (); -use ExtUtils::MakeMaker (); -use Module::Install::Base (); - -use vars qw{$VERSION @ISA $ISCORE}; -BEGIN { - $VERSION = '0.91'; - @ISA = 'Module::Install::Base'; - $ISCORE = 1; -} - -# check if we can load some module -### Upgrade this to not have to load the module if possible -sub can_use { - my ($self, $mod, $ver) = @_; - $mod =~ s{::|\\}{/}g; - $mod .= '.pm' unless $mod =~ /\.pm$/i; - - my $pkg = $mod; - $pkg =~ s{/}{::}g; - $pkg =~ s{\.pm$}{}i; - - local $@; - eval { require $mod; $pkg->VERSION($ver || 0); 1 }; -} - -# check if we can run some command -sub can_run { - my ($self, $cmd) = @_; - - my $_cmd = $cmd; - return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); - - for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { - next if $dir eq ''; - my $abs = File::Spec->catfile($dir, $_[1]); - return $abs if (-x $abs or $abs = MM->maybe_command($abs)); - } - - return; -} - -# can we locate a (the) C compiler -sub can_cc { - my $self = shift; - my @chunks = split(/ /, $Config::Config{cc}) or return; - - # $Config{cc} may contain args; try to find out the program part - while (@chunks) { - return $self->can_run("@chunks") || (pop(@chunks), next); - } - - return; -} - -# Fix Cygwin bug on maybe_command(); -if ( $^O eq 'cygwin' ) { - require ExtUtils::MM_Cygwin; - require ExtUtils::MM_Win32; - if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { - *ExtUtils::MM_Cygwin::maybe_command = sub { - my ($self, $file) = @_; - if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { - ExtUtils::MM_Win32->maybe_command($file); - } else { - ExtUtils::MM_Unix->maybe_command($file); - } - } - } -} - -1; - -__END__ - -#line 156 diff --git a/Literature/inc/Module/Install/Catalyst.pm b/Literature/inc/Module/Install/Catalyst.pm deleted file mode 100644 index 98e4c74..0000000 --- a/Literature/inc/Module/Install/Catalyst.pm +++ /dev/null @@ -1,290 +0,0 @@ -#line 1 -package Module::Install::Catalyst; - -use strict; - -our @ISA; -require Module::Install::Base; -@ISA = qw/Module::Install::Base/; - -use File::Find; -use FindBin; -use File::Copy::Recursive 'rcopy'; -use File::Spec (); - -my $SAFETY = 0; - -our @IGNORE = - qw/Build Build.PL Changes MANIFEST META.yml Makefile.PL Makefile README - _build blib lib script t inc \.svn \.git _darcs \.bzr \.hg/; -our @CLASSES = (); -our $ENGINE = 'CGI'; -our $CORE = 0; -our $MULTIARCH = 0; -our $SCRIPT = ''; -our $USAGE = ''; - -#line 42 - -sub catalyst { - my $self = shift; - print <catalyst_files; - $self->catalyst_par; - print <name; - for my $orig (@files) { - my $path = File::Spec->catdir( 'blib', 'lib', @path, $orig ); - rcopy( $orig, $path ); - } -} - -#line 84 - -sub catalyst_ignore_all { - my ( $self, $ignore ) = @_; - @IGNORE = @$ignore; -} - -#line 93 - -sub catalyst_ignore { - my ( $self, @ignore ) = @_; - push @IGNORE, @ignore; -} - -#line 102 - -# Workaround for a namespace conflict -sub catalyst_par { - my ( $self, $par ) = @_; - $par ||= ''; - return if $SAFETY; - $SAFETY++; - my $name = $self->name; - my $usage = $USAGE; - $usage =~ s/"/\\"/g; - my $class_string = join "', '", @CLASSES; - $class_string = "'$class_string'" if $class_string; - $self->postamble(< [$class_string], CORE => $CORE, ENGINE => '$ENGINE', MULTIARCH => $MULTIARCH, SCRIPT => '$SCRIPT', USAGE => q#$usage# } )" -EOF - print <{ENGINE}; - my $CLASSES = $opts->{CLASSES} || []; - my $USAGE = $opts->{USAGE}; - my $SCRIPT = $opts->{SCRIPT}; - my $MULTIARCH = $opts->{MULTIARCH}; - my $CORE = $opts->{CORE}; - - my $name = $class_name; - $name =~ s/::/_/g; - $name = lc $name; - $par ||= "$name.par"; - my $engine = $ENGINE || 'CGI'; - - # Check for PAR - eval "use PAR ()"; - die "Please install PAR\n" if $@; - eval "use PAR::Packer ()"; - die "Please install PAR::Packer\n" if $@; - eval "use App::Packer::PAR ()"; - die "Please install App::Packer::PAR\n" if $@; - eval "use Module::ScanDeps ()"; - die "Please install Module::ScanDeps\n" if $@; - - my $root = $FindBin::Bin; - $class_name =~ s/-/::/g; - my $path = File::Spec->catfile( 'blib', 'lib', split( '::', $class_name ) ); - $path .= '.pm'; - unless ( -f $path ) { - print qq/Not writing PAR, "$path" doesn't exist\n/; - return 0; - } - print qq/Writing PAR "$par"\n/; - chdir File::Spec->catdir( $root, 'blib' ); - - my $par_pl = 'par.pl'; - unlink $par_pl; - - my $version = $Catalyst::VERSION; - my $class = $class_name; - - my $classes = ''; - $classes .= " require $_;\n" for @$CLASSES; - - unlink $par_pl; - - my $usage = $USAGE || <<"EOF"; -Usage: - [parl] $name\[.par] [script] [arguments] - - Examples: - parl $name.par $name\_server.pl -r - myapp $name\_cgi.pl -EOF - - my $script = $SCRIPT; - my $tmp_file = IO::File->new("> $par_pl "); - print $tmp_file <<"EOF"; -if ( \$ENV{PAR_PROGNAME} ) { - my \$zip = \$PAR::LibCache{\$ENV{PAR_PROGNAME}} - || Archive::Zip->new(__FILE__); - my \$script = '$script'; - \$ARGV[0] ||= \$script if \$script; - if ( ( \@ARGV == 0 ) || ( \$ARGV[0] eq '-h' ) || ( \$ARGV[0] eq '-help' )) { - my \@members = \$zip->membersMatching('.*script/.*\.pl'); - my \$list = " Available scripts:\\n"; - for my \$member ( \@members ) { - my \$name = \$member->fileName; - \$name =~ /(\\w+\\.pl)\$/; - \$name = \$1; - next if \$name =~ /^main\.pl\$/; - next if \$name =~ /^par\.pl\$/; - \$list .= " \$name\\n"; - } - die <<"END"; -$usage -\$list -END - } - my \$file = shift \@ARGV; - \$file =~ s/^.*[\\/\\\\]//; - \$file =~ s/\\.[^.]*\$//i; - my \$member = eval { \$zip->memberNamed("./script/\$file.pl") }; - die qq/Can't open perl script "\$file"\n/ unless \$member; - PAR::_run_member( \$member, 1 ); -} -else { - require lib; - import lib 'lib'; - \$ENV{CATALYST_ENGINE} = '$engine'; - require $class; - import $class; - require Catalyst::Helper; - require Catalyst::Test; - require Catalyst::Engine::HTTP; - require Catalyst::Engine::CGI; - require Catalyst::Controller; - require Catalyst::Model; - require Catalyst::View; - require Getopt::Long; - require Pod::Usage; - require Pod::Text; - $classes -} -EOF - $tmp_file->close; - - # Create package - local $SIG{__WARN__} = sub { }; - open my $olderr, '>&STDERR'; - open STDERR, '>', File::Spec->devnull; - my %opt = ( - 'x' => 1, - 'n' => 0, - 'o' => $par, - 'a' => [ grep( !/par.pl/, glob '.' ) ], - 'p' => 1, - 'B' => $CORE, - 'm' => $MULTIARCH - ); - App::Packer::PAR->new( - frontend => 'Module::ScanDeps', - backend => 'PAR::Packer', - frontopts => \%opt, - backopts => \%opt, - args => ['par.pl'], - )->go; - - open STDERR, '>&', $olderr; - - unlink $par_pl; - chdir $root; - rmove( File::Spec->catfile( 'blib', $par ), $par ); - return 1; -} - -#line 332 - -1; diff --git a/Literature/inc/Module/Install/Fetch.pm b/Literature/inc/Module/Install/Fetch.pm deleted file mode 100644 index 05f2079..0000000 --- a/Literature/inc/Module/Install/Fetch.pm +++ /dev/null @@ -1,93 +0,0 @@ -#line 1 -package Module::Install::Fetch; - -use strict; -use Module::Install::Base (); - -use vars qw{$VERSION @ISA $ISCORE}; -BEGIN { - $VERSION = '0.91'; - @ISA = 'Module::Install::Base'; - $ISCORE = 1; -} - -sub get_file { - my ($self, %args) = @_; - my ($scheme, $host, $path, $file) = - $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; - - if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) { - $args{url} = $args{ftp_url} - or (warn("LWP support unavailable!\n"), return); - ($scheme, $host, $path, $file) = - $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; - } - - $|++; - print "Fetching '$file' from $host... "; - - unless (eval { require Socket; Socket::inet_aton($host) }) { - warn "'$host' resolve failed!\n"; - return; - } - - return unless $scheme eq 'ftp' or $scheme eq 'http'; - - require Cwd; - my $dir = Cwd::getcwd(); - chdir $args{local_dir} or return if exists $args{local_dir}; - - if (eval { require LWP::Simple; 1 }) { - LWP::Simple::mirror($args{url}, $file); - } - elsif (eval { require Net::FTP; 1 }) { eval { - # use Net::FTP to get past firewall - my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600); - $ftp->login("anonymous", 'anonymous@example.com'); - $ftp->cwd($path); - $ftp->binary; - $ftp->get($file) or (warn("$!\n"), return); - $ftp->quit; - } } - elsif (my $ftp = $self->can_run('ftp')) { eval { - # no Net::FTP, fallback to ftp.exe - require FileHandle; - my $fh = FileHandle->new; - - local $SIG{CHLD} = 'IGNORE'; - unless ($fh->open("|$ftp -n")) { - warn "Couldn't open ftp: $!\n"; - chdir $dir; return; - } - - my @dialog = split(/\n/, <<"END_FTP"); -open $host -user anonymous anonymous\@example.com -cd $path -binary -get $file $file -quit -END_FTP - foreach (@dialog) { $fh->print("$_\n") } - $fh->close; - } } - else { - warn "No working 'ftp' program available!\n"; - chdir $dir; return; - } - - unless (-f $file) { - warn "Fetching failed: $@\n"; - chdir $dir; return; - } - - return if exists $args{size} and -s $file != $args{size}; - system($args{run}) if exists $args{run}; - unlink($file) if $args{remove}; - - print(((!exists $args{check_for} or -e $args{check_for}) - ? "done!" : "failed! ($!)"), "\n"); - chdir $dir; return !$?; -} - -1; diff --git a/Literature/inc/Module/Install/Include.pm b/Literature/inc/Module/Install/Include.pm deleted file mode 100644 index 7e792e0..0000000 --- a/Literature/inc/Module/Install/Include.pm +++ /dev/null @@ -1,34 +0,0 @@ -#line 1 -package Module::Install::Include; - -use strict; -use Module::Install::Base (); - -use vars qw{$VERSION @ISA $ISCORE}; -BEGIN { - $VERSION = '0.91'; - @ISA = 'Module::Install::Base'; - $ISCORE = 1; -} - -sub include { - shift()->admin->include(@_); -} - -sub include_deps { - shift()->admin->include_deps(@_); -} - -sub auto_include { - shift()->admin->auto_include(@_); -} - -sub auto_include_deps { - shift()->admin->auto_include_deps(@_); -} - -sub auto_include_dependent_dists { - shift()->admin->auto_include_dependent_dists(@_); -} - -1; diff --git a/Literature/inc/Module/Install/Makefile.pm b/Literature/inc/Module/Install/Makefile.pm deleted file mode 100644 index 98779db..0000000 --- a/Literature/inc/Module/Install/Makefile.pm +++ /dev/null @@ -1,268 +0,0 @@ -#line 1 -package Module::Install::Makefile; - -use strict 'vars'; -use ExtUtils::MakeMaker (); -use Module::Install::Base (); - -use vars qw{$VERSION @ISA $ISCORE}; -BEGIN { - $VERSION = '0.91'; - @ISA = 'Module::Install::Base'; - $ISCORE = 1; -} - -sub Makefile { $_[0] } - -my %seen = (); - -sub prompt { - shift; - - # Infinite loop protection - my @c = caller(); - if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { - die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; - } - - # In automated testing, always use defaults - if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) { - local $ENV{PERL_MM_USE_DEFAULT} = 1; - goto &ExtUtils::MakeMaker::prompt; - } else { - goto &ExtUtils::MakeMaker::prompt; - } -} - -sub makemaker_args { - my $self = shift; - my $args = ( $self->{makemaker_args} ||= {} ); - %$args = ( %$args, @_ ); - return $args; -} - -# For mm args that take multiple space-seperated args, -# append an argument to the current list. -sub makemaker_append { - my $self = sShift; - my $name = shift; - my $args = $self->makemaker_args; - $args->{name} = defined $args->{$name} - ? join( ' ', $args->{name}, @_ ) - : join( ' ', @_ ); -} - -sub build_subdirs { - my $self = shift; - my $subdirs = $self->makemaker_args->{DIR} ||= []; - for my $subdir (@_) { - push @$subdirs, $subdir; - } -} - -sub clean_files { - my $self = shift; - my $clean = $self->makemaker_args->{clean} ||= {}; - %$clean = ( - %$clean, - FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), - ); -} - -sub realclean_files { - my $self = shift; - my $realclean = $self->makemaker_args->{realclean} ||= {}; - %$realclean = ( - %$realclean, - FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), - ); -} - -sub libs { - my $self = shift; - my $libs = ref $_[0] ? shift : [ shift ]; - $self->makemaker_args( LIBS => $libs ); -} - -sub inc { - my $self = shift; - $self->makemaker_args( INC => shift ); -} - -my %test_dir = (); - -sub _wanted_t { - /\.t$/ and -f $_ and $test_dir{$File::Find::dir} = 1; -} - -sub tests_recursive { - my $self = shift; - if ( $self->tests ) { - die "tests_recursive will not work if tests are already defined"; - } - my $dir = shift || 't'; - unless ( -d $dir ) { - die "tests_recursive dir '$dir' does not exist"; - } - %test_dir = (); - require File::Find; - File::Find::find( \&_wanted_t, $dir ); - $self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir ); -} - -sub write { - my $self = shift; - die "&Makefile->write() takes no arguments\n" if @_; - - # Check the current Perl version - my $perl_version = $self->perl_version; - if ( $perl_version ) { - eval "use $perl_version; 1" - or die "ERROR: perl: Version $] is installed, " - . "but we need version >= $perl_version"; - } - - # Make sure we have a new enough MakeMaker - require ExtUtils::MakeMaker; - - if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { - # MakeMaker can complain about module versions that include - # an underscore, even though its own version may contain one! - # Hence the funny regexp to get rid of it. See RT #35800 - # for details. - $self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ ); - $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ ); - } else { - # Allow legacy-compatibility with 5.005 by depending on the - # most recent EU:MM that supported 5.005. - $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 ); - $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 ); - } - - # Generate the MakeMaker params - my $args = $self->makemaker_args; - $args->{DISTNAME} = $self->name; - $args->{NAME} = $self->module_name || $self->name; - $args->{VERSION} = $self->version; - $args->{NAME} =~ s/-/::/g; - if ( $self->tests ) { - $args->{test} = { TESTS => $self->tests }; - } - if ( $] >= 5.005 ) { - $args->{ABSTRACT} = $self->abstract; - $args->{AUTHOR} = $self->author; - } - if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) { - $args->{NO_META} = 1; - } - if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) { - $args->{SIGN} = 1; - } - unless ( $self->is_admin ) { - delete $args->{SIGN}; - } - - # Merge both kinds of requires into prereq_pm - my $prereq = ($args->{PREREQ_PM} ||= {}); - %$prereq = ( %$prereq, - map { @$_ } - map { @$_ } - grep $_, - ($self->configure_requires, $self->build_requires, $self->requires) - ); - - # Remove any reference to perl, PREREQ_PM doesn't support it - delete $args->{PREREQ_PM}->{perl}; - - # merge both kinds of requires into prereq_pm - my $subdirs = ($args->{DIR} ||= []); - if ($self->bundles) { - foreach my $bundle (@{ $self->bundles }) { - my ($file, $dir) = @$bundle; - push @$subdirs, $dir if -d $dir; - delete $prereq->{$file}; - } - } - - if ( my $perl_version = $self->perl_version ) { - eval "use $perl_version; 1" - or die "ERROR: perl: Version $] is installed, " - . "but we need version >= $perl_version"; - } - - $args->{INSTALLDIRS} = $self->installdirs; - - my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args; - - my $user_preop = delete $args{dist}->{PREOP}; - if (my $preop = $self->admin->preop($user_preop)) { - foreach my $key ( keys %$preop ) { - $args{dist}->{$key} = $preop->{$key}; - } - } - - my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); - $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); -} - -sub fix_up_makefile { - my $self = shift; - my $makefile_name = shift; - my $top_class = ref($self->_top) || ''; - my $top_version = $self->_top->VERSION || ''; - - my $preamble = $self->preamble - ? "# Preamble by $top_class $top_version\n" - . $self->preamble - : ''; - my $postamble = "# Postamble by $top_class $top_version\n" - . ($self->postamble || ''); - - local *MAKEFILE; - open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; - my $makefile = do { local $/; }; - close MAKEFILE or die $!; - - $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; - $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; - $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; - $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; - $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; - - # Module::Install will never be used to build the Core Perl - # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks - # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist - $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; - #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; - - # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. - $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; - - # XXX - This is currently unused; not sure if it breaks other MM-users - # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; - - open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; - print MAKEFILE "$preamble$makefile$postamble" or die $!; - close MAKEFILE or die $!; - - 1; -} - -sub preamble { - my ($self, $text) = @_; - $self->{preamble} = $text . $self->{preamble} if defined $text; - $self->{preamble}; -} - -sub postamble { - my ($self, $text) = @_; - $self->{postamble} ||= $self->admin->postamble; - $self->{postamble} .= $text if defined $text; - $self->{postamble} -} - -1; - -__END__ - -#line 394 diff --git a/Literature/inc/Module/Install/Metadata.pm b/Literature/inc/Module/Install/Metadata.pm deleted file mode 100644 index 653193d..0000000 --- a/Literature/inc/Module/Install/Metadata.pm +++ /dev/null @@ -1,624 +0,0 @@ -#line 1 -package Module::Install::Metadata; - -use strict 'vars'; -use Module::Install::Base (); - -use vars qw{$VERSION @ISA $ISCORE}; -BEGIN { - $VERSION = '0.91'; - @ISA = 'Module::Install::Base'; - $ISCORE = 1; -} - -my @boolean_keys = qw{ - sign -}; - -my @scalar_keys = qw{ - name - module_name - abstract - author - version - distribution_type - tests - installdirs -}; - -my @tuple_keys = qw{ - configure_requires - build_requires - requires - recommends - bundles - resources -}; - -my @resource_keys = qw{ - homepage - bugtracker - repository -}; - -my @array_keys = qw{ - keywords -}; - -sub Meta { shift } -sub Meta_BooleanKeys { @boolean_keys } -sub Meta_ScalarKeys { @scalar_keys } -sub Meta_TupleKeys { @tuple_keys } -sub Meta_ResourceKeys { @resource_keys } -sub Meta_ArrayKeys { @array_keys } - -foreach my $key ( @boolean_keys ) { - *$key = sub { - my $self = shift; - if ( defined wantarray and not @_ ) { - return $self->{values}->{$key}; - } - $self->{values}->{$key} = ( @_ ? $_[0] : 1 ); - return $self; - }; -} - -foreach my $key ( @scalar_keys ) { - *$key = sub { - my $self = shift; - return $self->{values}->{$key} if defined wantarray and !@_; - $self->{values}->{$key} = shift; - return $self; - }; -} - -foreach my $key ( @array_keys ) { - *$key = sub { - my $self = shift; - return $self->{values}->{$key} if defined wantarray and !@_; - $self->{values}->{$key} ||= []; - push @{$self->{values}->{$key}}, @_; - return $self; - }; -} - -foreach my $key ( @resource_keys ) { - *$key = sub { - my $self = shift; - unless ( @_ ) { - return () unless $self->{values}->{resources}; - return map { $_->[1] } - grep { $_->[0] eq $key } - @{ $self->{values}->{resources} }; - } - return $self->{values}->{resources}->{$key} unless @_; - my $uri = shift or die( - "Did not provide a value to $key()" - ); - $self->resources( $key => $uri ); - return 1; - }; -} - -foreach my $key ( grep { $_ ne "resources" } @tuple_keys) { - *$key = sub { - my $self = shift; - return $self->{values}->{$key} unless @_; - my @added; - while ( @_ ) { - my $module = shift or last; - my $version = shift || 0; - push @added, [ $module, $version ]; - } - push @{ $self->{values}->{$key} }, @added; - return map {@$_} @added; - }; -} - -# Resource handling -my %lc_resource = map { $_ => 1 } qw{ - homepage - license - bugtracker - repository -}; - -sub resources { - my $self = shift; - while ( @_ ) { - my $name = shift or last; - my $value = shift or next; - if ( $name eq lc $name and ! $lc_resource{$name} ) { - die("Unsupported reserved lowercase resource '$name'"); - } - $self->{values}->{resources} ||= []; - push @{ $self->{values}->{resources} }, [ $name, $value ]; - } - $self->{values}->{resources}; -} - -# Aliases for build_requires that will have alternative -# meanings in some future version of META.yml. -sub test_requires { shift->build_requires(@_) } -sub install_requires { shift->build_requires(@_) } - -# Aliases for installdirs options -sub install_as_core { $_[0]->installdirs('perl') } -sub install_as_cpan { $_[0]->installdirs('site') } -sub install_as_site { $_[0]->installdirs('site') } -sub install_as_vendor { $_[0]->installdirs('vendor') } - -sub dynamic_config { - my $self = shift; - unless ( @_ ) { - warn "You MUST provide an explicit true/false value to dynamic_config\n"; - return $self; - } - $self->{values}->{dynamic_config} = $_[0] ? 1 : 0; - return 1; -} - -sub perl_version { - my $self = shift; - return $self->{values}->{perl_version} unless @_; - my $version = shift or die( - "Did not provide a value to perl_version()" - ); - - # Normalize the version - $version = $self->_perl_version($version); - - # We don't support the reall old versions - unless ( $version >= 5.005 ) { - die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; - } - - $self->{values}->{perl_version} = $version; -} - -#Stolen from M::B -my %license_urls = ( - perl => 'http://dev.perl.org/licenses/', - apache => 'http://apache.org/licenses/LICENSE-2.0', - artistic => 'http://opensource.org/licenses/artistic-license.php', - artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', - lgpl => 'http://opensource.org/licenses/lgpl-license.php', - lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', - lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', - bsd => 'http://opensource.org/licenses/bsd-license.php', - gpl => 'http://opensource.org/licenses/gpl-license.php', - gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', - gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', - mit => 'http://opensource.org/licenses/mit-license.php', - mozilla => 'http://opensource.org/licenses/mozilla1.1.php', - open_source => undef, - unrestricted => undef, - restrictive => undef, - unknown => undef, -); - -sub license { - my $self = shift; - return $self->{values}->{license} unless @_; - my $license = shift or die( - 'Did not provide a value to license()' - ); - $self->{values}->{license} = $license; - - # Automatically fill in license URLs - if ( $license_urls{$license} ) { - $self->resources( license => $license_urls{$license} ); - } - - return 1; -} - -sub all_from { - my ( $self, $file ) = @_; - - unless ( defined($file) ) { - my $name = $self->name or die( - "all_from called with no args without setting name() first" - ); - $file = join('/', 'lib', split(/-/, $name)) . '.pm'; - $file =~ s{.*/}{} unless -e $file; - unless ( -e $file ) { - die("all_from cannot find $file from $name"); - } - } - unless ( -f $file ) { - die("The path '$file' does not exist, or is not a file"); - } - - # Some methods pull from POD instead of code. - # If there is a matching .pod, use that instead - my $pod = $file; - $pod =~ s/\.pm$/.pod/i; - $pod = $file unless -e $pod; - - # Pull the different values - $self->name_from($file) unless $self->name; - $self->version_from($file) unless $self->version; - $self->perl_version_from($file) unless $self->perl_version; - $self->author_from($pod) unless $self->author; - $self->license_from($pod) unless $self->license; - $self->abstract_from($pod) unless $self->abstract; - - return 1; -} - -sub provides { - my $self = shift; - my $provides = ( $self->{values}->{provides} ||= {} ); - %$provides = (%$provides, @_) if @_; - return $provides; -} - -sub auto_provides { - my $self = shift; - return $self unless $self->is_admin; - unless (-e 'MANIFEST') { - warn "Cannot deduce auto_provides without a MANIFEST, skipping\n"; - return $self; - } - # Avoid spurious warnings as we are not checking manifest here. - local $SIG{__WARN__} = sub {1}; - require ExtUtils::Manifest; - local *ExtUtils::Manifest::manicheck = sub { return }; - - require Module::Build; - my $build = Module::Build->new( - dist_name => $self->name, - dist_version => $self->version, - license => $self->license, - ); - $self->provides( %{ $build->find_dist_packages || {} } ); -} - -sub feature { - my $self = shift; - my $name = shift; - my $features = ( $self->{values}->{features} ||= [] ); - my $mods; - - if ( @_ == 1 and ref( $_[0] ) ) { - # The user used ->feature like ->features by passing in the second - # argument as a reference. Accomodate for that. - $mods = $_[0]; - } else { - $mods = \@_; - } - - my $count = 0; - push @$features, ( - $name => [ - map { - ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_ - } @$mods - ] - ); - - return @$features; -} - -sub features { - my $self = shift; - while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { - $self->feature( $name, @$mods ); - } - return $self->{values}->{features} - ? @{ $self->{values}->{features} } - : (); -} - -sub no_index { - my $self = shift; - my $type = shift; - push @{ $self->{values}->{no_index}->{$type} }, @_ if $type; - return $self->{values}->{no_index}; -} - -sub read { - my $self = shift; - $self->include_deps( 'YAML::Tiny', 0 ); - - require YAML::Tiny; - my $data = YAML::Tiny::LoadFile('META.yml'); - - # Call methods explicitly in case user has already set some values. - while ( my ( $key, $value ) = each %$data ) { - next unless $self->can($key); - if ( ref $value eq 'HASH' ) { - while ( my ( $module, $version ) = each %$value ) { - $self->can($key)->($self, $module => $version ); - } - } else { - $self->can($key)->($self, $value); - } - } - return $self; -} - -sub write { - my $self = shift; - return $self unless $self->is_admin; - $self->admin->write_meta; - return $self; -} - -sub version_from { - require ExtUtils::MM_Unix; - my ( $self, $file ) = @_; - $self->version( ExtUtils::MM_Unix->parse_version($file) ); -} - -sub abstract_from { - require ExtUtils::MM_Unix; - my ( $self, $file ) = @_; - $self->abstract( - bless( - { DISTNAME => $self->name }, - 'ExtUtils::MM_Unix' - )->parse_abstract($file) - ); -} - -# Add both distribution and module name -sub name_from { - my ($self, $file) = @_; - if ( - Module::Install::_read($file) =~ m/ - ^ \s* - package \s* - ([\w:]+) - \s* ; - /ixms - ) { - my ($name, $module_name) = ($1, $1); - $name =~ s{::}{-}g; - $self->name($name); - unless ( $self->module_name ) { - $self->module_name($module_name); - } - } else { - die("Cannot determine name from $file\n"); - } -} - -sub perl_version_from { - my $self = shift; - if ( - Module::Install::_read($_[0]) =~ m/ - ^ - (?:use|require) \s* - v? - ([\d_\.]+) - \s* ; - /ixms - ) { - my $perl_version = $1; - $perl_version =~ s{_}{}g; - $self->perl_version($perl_version); - } else { - warn "Cannot determine perl version info from $_[0]\n"; - return; - } -} - -sub author_from { - my $self = shift; - my $content = Module::Install::_read($_[0]); - if ($content =~ m/ - =head \d \s+ (?:authors?)\b \s* - ([^\n]*) - | - =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s* - .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s* - ([^\n]*) - /ixms) { - my $author = $1 || $2; - $author =~ s{E}{<}g; - $author =~ s{E}{>}g; - $self->author($author); - } else { - warn "Cannot determine author info from $_[0]\n"; - } -} - -sub license_from { - my $self = shift; - if ( - Module::Install::_read($_[0]) =~ m/ - ( - =head \d \s+ - (?:licen[cs]e|licensing|copyright|legal)\b - .*? - ) - (=head\\d.*|=cut.*|) - \z - /ixms ) { - my $license_text = $1; - my @phrases = ( - 'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1, - 'GNU general public license' => 'gpl', 1, - 'GNU public license' => 'gpl', 1, - 'GNU lesser general public license' => 'lgpl', 1, - 'GNU lesser public license' => 'lgpl', 1, - 'GNU library general public license' => 'lgpl', 1, - 'GNU library public license' => 'lgpl', 1, - 'BSD license' => 'bsd', 1, - 'Artistic license' => 'artistic', 1, - 'GPL' => 'gpl', 1, - 'LGPL' => 'lgpl', 1, - 'BSD' => 'bsd', 1, - 'Artistic' => 'artistic', 1, - 'MIT' => 'mit', 1, - 'proprietary' => 'proprietary', 0, - ); - while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) { - $pattern =~ s{\s+}{\\s+}g; - if ( $license_text =~ /\b$pattern\b/i ) { - $self->license($license); - return 1; - } - } - } - - warn "Cannot determine license info from $_[0]\n"; - return 'unknown'; -} - -sub _extract_bugtracker { - my @links = $_[0] =~ m#L<(\Qhttp://rt.cpan.org/\E[^>]+)>#g; - my %links; - @links{@links}=(); - @links=keys %links; - return @links; -} - -sub bugtracker_from { - my $self = shift; - my $content = Module::Install::_read($_[0]); - my @links = _extract_bugtracker($content); - unless ( @links ) { - warn "Cannot determine bugtracker info from $_[0]\n"; - return 0; - } - if ( @links > 1 ) { - warn "Found more than on rt.cpan.org link in $_[0]\n"; - return 0; - } - - # Set the bugtracker - bugtracker( $links[0] ); - return 1; -} - -sub requires_from { - my $self = shift; - my $content = Module::Install::_readperl($_[0]); - my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; - while ( @requires ) { - my $module = shift @requires; - my $version = shift @requires; - $self->requires( $module => $version ); - } -} - -sub test_requires_from { - my $self = shift; - my $content = Module::Install::_readperl($_[0]); - my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; - while ( @requires ) { - my $module = shift @requires; - my $version = shift @requires; - $self->test_requires( $module => $version ); - } -} - -# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to -# numbers (eg, 5.006001 or 5.008009). -# Also, convert double-part versions (eg, 5.8) -sub _perl_version { - my $v = $_[-1]; - $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; - $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e; - $v =~ s/(\.\d\d\d)000$/$1/; - $v =~ s/_.+$//; - if ( ref($v) ) { - # Numify - $v = $v + 0; - } - return $v; -} - - - - - -###################################################################### -# MYMETA Support - -sub WriteMyMeta { - die "WriteMyMeta has been deprecated"; -} - -sub write_mymeta_yaml { - my $self = shift; - - # We need YAML::Tiny to write the MYMETA.yml file - unless ( eval { require YAML::Tiny; 1; } ) { - return 1; - } - - # Generate the data - my $meta = $self->_write_mymeta_data or return 1; - - # Save as the MYMETA.yml file - print "Writing MYMETA.yml\n"; - YAML::Tiny::DumpFile('MYMETA.yml', $meta); -} - -sub write_mymeta_json { - my $self = shift; - - # We need JSON to write the MYMETA.json file - unless ( eval { require JSON; 1; } ) { - return 1; - } - - # Generate the data - my $meta = $self->_write_mymeta_data or return 1; - - # Save as the MYMETA.yml file - print "Writing MYMETA.json\n"; - Module::Install::_write( - 'MYMETA.json', - JSON->new->pretty(1)->canonical->encode($meta), - ); -} - -sub _write_mymeta_data { - my $self = shift; - - # If there's no existing META.yml there is nothing we can do - return undef unless -f 'META.yml'; - - # We need Parse::CPAN::Meta to load the file - unless ( eval { require Parse::CPAN::Meta; 1; } ) { - return undef; - } - - # Merge the perl version into the dependencies - my $val = $self->Meta->{values}; - my $perl = delete $val->{perl_version}; - if ( $perl ) { - $val->{requires} ||= []; - my $requires = $val->{requires}; - - # Canonize to three-dot version after Perl 5.6 - if ( $perl >= 5.006 ) { - $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e - } - unshift @$requires, [ perl => $perl ]; - } - - # Load the advisory META.yml file - my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); - my $meta = $yaml[0]; - - # Overwrite the non-configure dependency hashs - delete $meta->{requires}; - delete $meta->{build_requires}; - delete $meta->{recommends}; - if ( exists $val->{requires} ) { - $meta->{requires} = { map { @$_ } @{ $val->{requires} } }; - } - if ( exists $val->{build_requires} ) { - $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } }; - } - - return $meta; -} - -1; diff --git a/Literature/inc/Module/Install/Scripts.pm b/Literature/inc/Module/Install/Scripts.pm deleted file mode 100644 index a1001f5..0000000 --- a/Literature/inc/Module/Install/Scripts.pm +++ /dev/null @@ -1,29 +0,0 @@ -#line 1 -package Module::Install::Scripts; - -use strict 'vars'; -use Module::Install::Base (); - -use vars qw{$VERSION @ISA $ISCORE}; -BEGIN { - $VERSION = '0.91'; - @ISA = 'Module::Install::Base'; - $ISCORE = 1; -} - -sub install_script { - my $self = shift; - my $args = $self->makemaker_args; - my $exe = $args->{EXE_FILES} ||= []; - foreach ( @_ ) { - if ( -f $_ ) { - push @$exe, $_; - } elsif ( -d 'script' and -f "script/$_" ) { - push @$exe, "script/$_"; - } else { - die("Cannot find script '$_'"); - } - } -} - -1; diff --git a/Literature/inc/Module/Install/Win32.pm b/Literature/inc/Module/Install/Win32.pm deleted file mode 100644 index f2f99df..0000000 --- a/Literature/inc/Module/Install/Win32.pm +++ /dev/null @@ -1,64 +0,0 @@ -#line 1 -package Module::Install::Win32; - -use strict; -use Module::Install::Base (); - -use vars qw{$VERSION @ISA $ISCORE}; -BEGIN { - $VERSION = '0.91'; - @ISA = 'Module::Install::Base'; - $ISCORE = 1; -} - -# determine if the user needs nmake, and download it if needed -sub check_nmake { - my $self = shift; - $self->load('can_run'); - $self->load('get_file'); - - require Config; - return unless ( - $^O eq 'MSWin32' and - $Config::Config{make} and - $Config::Config{make} =~ /^nmake\b/i and - ! $self->can_run('nmake') - ); - - print "The required 'nmake' executable not found, fetching it...\n"; - - require File::Basename; - my $rv = $self->get_file( - url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', - ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', - local_dir => File::Basename::dirname($^X), - size => 51928, - run => 'Nmake15.exe /o > nul', - check_for => 'Nmake.exe', - remove => 1, - ); - - die <<'END_MESSAGE' unless $rv; - -------------------------------------------------------------------------------- - -Since you are using Microsoft Windows, you will need the 'nmake' utility -before installation. It's available at: - - http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe - or - ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe - -Please download the file manually, save it to a directory in %PATH% (e.g. -C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to -that directory, and run "Nmake15.exe" from there; that will create the -'nmake.exe' file needed by this module. - -You may then resume the installation process described in README. - -------------------------------------------------------------------------------- -END_MESSAGE - -} - -1; diff --git a/Literature/inc/Module/Install/WriteAll.pm b/Literature/inc/Module/Install/WriteAll.pm deleted file mode 100644 index 12471e5..0000000 --- a/Literature/inc/Module/Install/WriteAll.pm +++ /dev/null @@ -1,60 +0,0 @@ -#line 1 -package Module::Install::WriteAll; - -use strict; -use Module::Install::Base (); - -use vars qw{$VERSION @ISA $ISCORE}; -BEGIN { - $VERSION = '0.91';; - @ISA = qw{Module::Install::Base}; - $ISCORE = 1; -} - -sub WriteAll { - my $self = shift; - my %args = ( - meta => 1, - sign => 0, - inline => 0, - check_nmake => 1, - @_, - ); - - $self->sign(1) if $args{sign}; - $self->admin->WriteAll(%args) if $self->is_admin; - - $self->check_nmake if $args{check_nmake}; - unless ( $self->makemaker_args->{PL_FILES} ) { - $self->makemaker_args( PL_FILES => {} ); - } - - # Until ExtUtils::MakeMaker support MYMETA.yml, make sure - # we clean it up properly ourself. - $self->realclean_files('MYMETA.yml'); - - if ( $args{inline} ) { - $self->Inline->write; - } else { - $self->Makefile->write; - } - - # The Makefile write process adds a couple of dependencies, - # so write the META.yml files after the Makefile. - if ( $args{meta} ) { - $self->Meta->write; - } - - # Experimental support for MYMETA - if ( $ENV{X_MYMETA} ) { - if ( $ENV{X_MYMETA} eq 'JSON' ) { - $self->Meta->write_mymeta_json; - } else { - $self->Meta->write_mymeta_yaml; - } - } - - return 1; -} - -1; diff --git a/Literature/lib/Literature.pm b/Literature/lib/Literature.pm index 3efdf4e..ef84868 100644 --- a/Literature/lib/Literature.pm +++ b/Literature/lib/Literature.pm @@ -1,68 +1,19 @@ package Literature; +use Dancer2; +use Dancer2::Plugin::DBIC; -use strict; -use warnings; +our $VERSION = '0.1'; -use Catalyst::Runtime 5.80; +my $cfg = dancer_app->config; +$cfg->{plugins}{DBIC}{default}{user} = $ENV{LIT_USER}; +$cfg->{plugins}{DBIC}{default}{pass} = $ENV{LIT_PASS}; -# Set flags and add plugins for the application -# -# -Debug: activates the debug mode for very useful log messages -# ConfigLoader: will load the configuration from a Config::General file in the -# application's home directory -# Static::Simple: will serve static files from the application's root -# directory +get '/' => sub { + template 'index'; +}; -use parent qw/Catalyst/; -use Catalyst qw/ - -Debug - ConfigLoader - Static::Simple - StackTrace - AutoCRUD - /; -our $VERSION = '0.01'; +get '/authors/' => sub { + template 'authors', { authors => resultset('Author') }; +}; -# Configure the application. -# -# Note that settings in literature.conf (or other external -# configuration file that you set up manually) take precedence -# over this when using ConfigLoader. Thus configuration -# details given here can function as a default configuration, -# with an external configuration file acting as an override for -# local deployment. - -__PACKAGE__->config( name => 'Literature' ); - -# Start the application -__PACKAGE__->setup(); - - -=head1 NAME - -Literature - Catalyst based application - -=head1 SYNOPSIS - - script/literature_server.pl - -=head1 DESCRIPTION - -[enter your description here] - -=head1 SEE ALSO - -L, L - -=head1 AUTHOR - -Dave Cross - -=head1 LICENSE - -This library is free software. You can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut - -1; +true; diff --git a/Literature/lib/Literature/Schema.pm b/Literature/lib/Literature/Schema.pm index c198fc8..ed0271b 100644 --- a/Literature/lib/Literature/Schema.pm +++ b/Literature/lib/Literature/Schema.pm @@ -1,3 +1,4 @@ +use utf8; package Literature::Schema; # Created by DBIx::Class::Schema::Loader @@ -11,9 +12,9 @@ use base 'DBIx::Class::Schema'; __PACKAGE__->load_namespaces; -# Created by DBIx::Class::Schema::Loader v0.07001 @ 2010-09-12 14:05:58 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TuzB0spCqLGoM61gRH1APQ +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-01 12:22:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MT39iJoIjN21xSMELGcKRg -# You can replace this text with custom content, and it will be preserved on regeneration +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Literature/lib/Literature/Schema/Result/Actor.pm b/Literature/lib/Literature/Schema/Result/Actor.pm index 4075611..e2a842d 100644 --- a/Literature/lib/Literature/Schema/Result/Actor.pm +++ b/Literature/lib/Literature/Schema/Result/Actor.pm @@ -1,18 +1,33 @@ +use utf8; package Literature::Schema::Result::Actor; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE +=head1 NAME + +Literature::Schema::Result::Actor + +=cut + use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("InflateColumn::DateTime"); +=head1 COMPONENTS LOADED -=head1 NAME +=over 4 -Literature::Schema::Result::Actor +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C =cut @@ -72,6 +87,17 @@ __PACKAGE__->add_columns( "imdb", { data_type => "char", is_nullable => 1, size => 15 }, ); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + __PACKAGE__->set_primary_key("id"); =head1 RELATIONS @@ -92,21 +118,9 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:16:15 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Em+SljLhA9AucfhfRCwjkw - - - -# You can replace this text with custom content, and it will be preserved on regeneration - -sub display_name { - my $self = shift; - return $self->name || ''; -} - -1; - +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-01 12:22:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VP8JtCVpk7IUQp5m4x1yrw -# You can replace this text with custom content, and it will be preserved on regeneration +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Literature/lib/Literature/Schema/Result/ActorRole.pm b/Literature/lib/Literature/Schema/Result/ActorRole.pm index cec7c89..70ac3ad 100644 --- a/Literature/lib/Literature/Schema/Result/ActorRole.pm +++ b/Literature/lib/Literature/Schema/Result/ActorRole.pm @@ -1,18 +1,33 @@ +use utf8; package Literature::Schema::Result::ActorRole; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE +=head1 NAME + +Literature::Schema::Result::ActorRole + +=cut + use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("InflateColumn::DateTime"); +=head1 COMPONENTS LOADED -=head1 NAME +=over 4 -Literature::Schema::Result::ActorRole +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C =cut @@ -48,6 +63,21 @@ __PACKAGE__->add_columns( "fictional_character", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, ); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=item * L + +=item * L + +=back + +=cut + __PACKAGE__->set_primary_key("actor", "production", "fictional_character"); =head1 RELATIONS @@ -67,21 +97,6 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); -=head2 production - -Type: belongs_to - -Related object: L - -=cut - -__PACKAGE__->belongs_to( - "production", - "Literature::Schema::Result::Production", - { id => "production" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, -); - =head2 fictional_character Type: belongs_to @@ -97,27 +112,25 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +=head2 production -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ax7FCmo8QD+zTFfZ6v7mUA - - +Type: belongs_to -# You can replace this text with custom content, and it will be preserved on regeneration +Related object: L -sub display_name { - my $self = shift; +=cut - return $self->actor->name . ' played ' . - $self->fictional_character->name . ' in ' . - $self->production->title . ' (' . - $self->production->made_by . ', ' . - $self->production->year . ')'; -} +__PACKAGE__->belongs_to( + "production", + "Literature::Schema::Result::Production", + { id => "production" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); -1; +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-01 12:22:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4vAWbHTzJhIolMhgWflLAw -# You can replace this text with custom content, and it will be preserved on regeneration +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Literature/lib/Literature/Schema/Result/Author.pm b/Literature/lib/Literature/Schema/Result/Author.pm index 95cb3b8..65f8199 100644 --- a/Literature/lib/Literature/Schema/Result/Author.pm +++ b/Literature/lib/Literature/Schema/Result/Author.pm @@ -1,18 +1,33 @@ +use utf8; package Literature::Schema::Result::Author; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE +=head1 NAME + +Literature::Schema::Result::Author + +=cut + use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("InflateColumn::DateTime"); +=head1 COMPONENTS LOADED -=head1 NAME +=over 4 -Literature::Schema::Result::Author +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C =cut @@ -72,6 +87,17 @@ __PACKAGE__->add_columns( "imdb", { data_type => "char", is_nullable => 0, size => 15 }, ); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + __PACKAGE__->set_primary_key("id"); =head1 RELATIONS @@ -91,25 +117,20 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 works -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:16:15 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BXICXVHmishvaieMbrqssA - - +Type: many_to_many -# You can replace this text with custom content, and it will be preserved on regeneration +Composing rels: L -> work -sub display_name { - my $self = shift; - return $self->name || ''; -} - -1; +=cut +__PACKAGE__->many_to_many("works", "author_works", "work"); -# You can replace this text with custom content, and it will be preserved on regeneration +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-01 12:22:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0R/ciq13VoQWM8yA2Ka7aQ -__PACKAGE__->many_to_many(works => 'author_works', 'work'); +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Literature/lib/Literature/Schema/Result/AuthorWork.pm b/Literature/lib/Literature/Schema/Result/AuthorWork.pm index dd61a9f..0d7efaf 100644 --- a/Literature/lib/Literature/Schema/Result/AuthorWork.pm +++ b/Literature/lib/Literature/Schema/Result/AuthorWork.pm @@ -1,18 +1,33 @@ +use utf8; package Literature::Schema::Result::AuthorWork; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE +=head1 NAME + +Literature::Schema::Result::AuthorWork + +=cut + use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("InflateColumn::DateTime"); +=head1 COMPONENTS LOADED -=head1 NAME +=over 4 -Literature::Schema::Result::AuthorWork +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C =cut @@ -40,6 +55,19 @@ __PACKAGE__->add_columns( "work", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, ); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=item * L + +=back + +=cut + __PACKAGE__->set_primary_key("author", "work"); =head1 RELATIONS @@ -75,9 +103,9 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qkN4LHk0wSGWcjNoa7TMwQ +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-01 12:22:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VIAMkLJCluKtGkiKxQ9T0A -# You can replace this text with custom content, and it will be preserved on regeneration +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Literature/lib/Literature/Schema/Result/Character.pm b/Literature/lib/Literature/Schema/Result/Character.pm new file mode 100644 index 0000000..66bc26b --- /dev/null +++ b/Literature/lib/Literature/Schema/Result/Character.pm @@ -0,0 +1,76 @@ +use utf8; +package Literature::Schema::Result::Character; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Literature::Schema::Result::Character + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("character"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_nullable: 0 + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-01 12:22:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uik0XqoMCthAw/Cb+JzSpg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Literature/lib/Literature/Schema/Result/FictionalCharacter.pm b/Literature/lib/Literature/Schema/Result/FictionalCharacter.pm index adfb01e..0b6c1ea 100644 --- a/Literature/lib/Literature/Schema/Result/FictionalCharacter.pm +++ b/Literature/lib/Literature/Schema/Result/FictionalCharacter.pm @@ -1,18 +1,33 @@ +use utf8; package Literature::Schema::Result::FictionalCharacter; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE +=head1 NAME + +Literature::Schema::Result::FictionalCharacter + +=cut + use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("InflateColumn::DateTime"); +=head1 COMPONENTS LOADED -=head1 NAME +=over 4 -Literature::Schema::Result::FictionalCharacter +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C =cut @@ -40,6 +55,17 @@ __PACKAGE__->add_columns( "name", { data_type => "varchar", is_nullable => 0, size => 255 }, ); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + __PACKAGE__->set_primary_key("id"); =head1 RELATIONS @@ -74,22 +100,20 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 works -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tuJMH1jzzURlsLcJ66G+ug +Type: many_to_many +Composing rels: L -> work +=cut -# You can replace this text with custom content, and it will be preserved on regeneration - -sub display_name { - my $self = shift; - return $self->name || ''; -} +__PACKAGE__->many_to_many("works", "fictional_character_appearances", "work"); -1; +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-01 12:22:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rijiRr927KyuIU1KWltm6w -# You can replace this text with custom content, and it will be preserved on regeneration +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Literature/lib/Literature/Schema/Result/FictionalCharacterAppearance.pm b/Literature/lib/Literature/Schema/Result/FictionalCharacterAppearance.pm index 86a15f0..0d30745 100644 --- a/Literature/lib/Literature/Schema/Result/FictionalCharacterAppearance.pm +++ b/Literature/lib/Literature/Schema/Result/FictionalCharacterAppearance.pm @@ -1,18 +1,33 @@ +use utf8; package Literature::Schema::Result::FictionalCharacterAppearance; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE +=head1 NAME + +Literature::Schema::Result::FictionalCharacterAppearance + +=cut + use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("InflateColumn::DateTime"); +=head1 COMPONENTS LOADED -=head1 NAME +=over 4 -Literature::Schema::Result::FictionalCharacterAppearance +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C =cut @@ -40,6 +55,19 @@ __PACKAGE__->add_columns( "work", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, ); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=item * L + +=back + +=cut + __PACKAGE__->set_primary_key("fictional_character", "work"); =head1 RELATIONS @@ -75,22 +103,9 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:v1TNbaUiirbmoND9zSSK3Q - - - -# You can replace this text with custom content, and it will be preserved on regeneration - -sub display_name { - my $self = shift; - - return $self->name . ' appears in ' . $self->work->title; -} - -1; - +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-01 12:22:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0xZTYJC6j16adjAtEPm7Tw -# You can replace this text with custom content, and it will be preserved on regeneration +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Literature/lib/Literature/Schema/Result/Production.pm b/Literature/lib/Literature/Schema/Result/Production.pm index 3c72d6d..c032ad0 100644 --- a/Literature/lib/Literature/Schema/Result/Production.pm +++ b/Literature/lib/Literature/Schema/Result/Production.pm @@ -1,18 +1,33 @@ +use utf8; package Literature::Schema::Result::Production; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE +=head1 NAME + +Literature::Schema::Result::Production + +=cut + use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("InflateColumn::DateTime"); +=head1 COMPONENTS LOADED -=head1 NAME +=over 4 -Literature::Schema::Result::Production +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C =cut @@ -63,6 +78,17 @@ __PACKAGE__->add_columns( "made_by", { data_type => "varchar", is_nullable => 1, size => 255 }, ); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + __PACKAGE__->set_primary_key("id"); =head1 RELATIONS @@ -94,25 +120,13 @@ __PACKAGE__->belongs_to( "work", "Literature::Schema::Result::Work", { id => "work" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, ); -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z/Zz14R2tojBky7RHNQ8hw - - - -# You can replace this text with custom content, and it will be preserved on regeneration - -sub display_name { - my $self = shift; - return $self->title || ''; -} - -1; - +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-01 12:22:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kJZJ46fsEE4sWCuWaQcn/Q -# You can replace this text with custom content, and it will be preserved on regeneration +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Literature/lib/Literature/Schema/Result/Work.pm b/Literature/lib/Literature/Schema/Result/Work.pm index 87b0dc9..8cdd3b0 100644 --- a/Literature/lib/Literature/Schema/Result/Work.pm +++ b/Literature/lib/Literature/Schema/Result/Work.pm @@ -1,18 +1,33 @@ +use utf8; package Literature::Schema::Result::Work; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE +=head1 NAME + +Literature::Schema::Result::Work + +=cut + use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->load_components("InflateColumn::DateTime"); +=head1 COMPONENTS LOADED -=head1 NAME +=over 4 -Literature::Schema::Result::Work +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C =cut @@ -52,36 +67,32 @@ __PACKAGE__->add_columns( is_nullable => 1, }, ); -__PACKAGE__->set_primary_key("id"); -=head1 RELATIONS +=head1 PRIMARY KEY -=head2 author_works +=over 4 -Type: has_many +=item * L -Related object: L +=back =cut -__PACKAGE__->has_many( - "author_works", - "Literature::Schema::Result::AuthorWork", - { "foreign.work" => "self.id" }, - { cascade_copy => 0, cascade_delete => 0 }, -); +__PACKAGE__->set_primary_key("id"); -=head2 character_appearances +=head1 RELATIONS + +=head2 author_works Type: has_many -Related object: L +Related object: L =cut __PACKAGE__->has_many( - "character_appearances", - "Literature::Schema::Result::CharacterAppearance", + "author_works", + "Literature::Schema::Result::AuthorWork", { "foreign.work" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -116,25 +127,34 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 authors -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:16:15 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+CFOaGhALLRSgNqCQapqZA +Type: many_to_many +Composing rels: L -> author +=cut -# You can replace this text with custom content, and it will be preserved on regeneration +__PACKAGE__->many_to_many("authors", "author_works", "author"); -sub display_name { - my $self = shift; - return $self->title || ''; -} +=head2 fictional_characters -1; +Type: many_to_many +Composing rels: L -> fictional_character + +=cut + +__PACKAGE__->many_to_many( + "fictional_characters", + "fictional_character_appearances", + "fictional_character", +); -# You can replace this text with custom content, and it will be preserved on regeneration +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-01 12:22:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8BGh+Iql5Dt7gMmfnhJzJg -__PACKAGE__->many_to_many(authors => 'author_works', 'author'); +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Literature/public/404.html b/Literature/public/404.html new file mode 100644 index 0000000..c214958 --- /dev/null +++ b/Literature/public/404.html @@ -0,0 +1,18 @@ + + + +Error 404 + + + + +

Error 404

+
+

Page Not Found

Sorry, this is the void.

+
+ + + diff --git a/Literature/public/500.html b/Literature/public/500.html new file mode 100644 index 0000000..2878db6 --- /dev/null +++ b/Literature/public/500.html @@ -0,0 +1,18 @@ + + + +Error 500 + + + + +

Error 500

+
+

Internal Server Error

Wooops, something went wrong

+
+ + + diff --git a/Literature/public/css/error.css b/Literature/public/css/error.css new file mode 100644 index 0000000..003ee2a --- /dev/null +++ b/Literature/public/css/error.css @@ -0,0 +1,70 @@ +body { + font-family: Lucida,sans-serif; +} + +h1 { + color: #AA0000; + border-bottom: 1px solid #444; +} + +h2 { color: #444; } + +pre { + font-family: "lucida console","monaco","andale mono","bitstream vera sans mono","consolas",monospace; + font-size: 12px; + border-left: 2px solid #777; + padding-left: 1em; +} + +footer { + font-size: 10px; +} + +span.key { + color: #449; + font-weight: bold; + width: 120px; + display: inline; +} + +span.value { + color: #494; +} + +/* these are for the message boxes */ + +pre.content { + background-color: #eee; + color: #000; + padding: 1em; + margin: 0; + border: 1px solid #aaa; + border-top: 0; + margin-bottom: 1em; +} + +div.title { + font-family: "lucida console","monaco","andale mono","bitstream vera sans mono","consolas",monospace; + font-size: 12px; + background-color: #aaa; + color: #444; + font-weight: bold; + padding: 3px; + padding-left: 10px; +} + +pre.content span.nu { + color: #889; + margin-right: 10px; +} + +pre.error { + background: #334; + color: #ccd; + padding: 1em; + border-top: 1px solid #000; + border-left: 1px solid #000; + border-right: 1px solid #eee; + border-bottom: 1px solid #eee; +} + diff --git a/Literature/public/css/style.css b/Literature/public/css/style.css new file mode 100644 index 0000000..706c3e5 --- /dev/null +++ b/Literature/public/css/style.css @@ -0,0 +1,189 @@ + +body { +margin: 0; +margin-bottom: 25px; +padding: 0; +background-color: #ddd; +background-image: url("/images/perldancer-bg.jpg"); +background-repeat: no-repeat; +background-position: top left; + +font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana"; +font-size: 13px; +color: #333; +} + +h1 { +font-size: 28px; +color: #000; +} + +a {color: #03c} +a:hover { +background-color: #03c; +color: white; +text-decoration: none; +} + +#page { +background-color: #ddd; +width: 750px; +margin: auto; +margin-left: auto; +padding-left: 0px; +margin-right: auto; +} + +#content { +background-color: white; +border: 3px solid #aaa; +border-top: none; +padding: 25px; +width: 500px; +} + +#sidebar { +float: right; +width: 175px; +} + +#header, #about, #getting-started { +padding-left: 75px; +padding-right: 30px; +} + + +#header { +background-image: url("/images/perldancer.jpg"); +background-repeat: no-repeat; +background-position: top left; +height: 64px; +} +#header h1, #header h2 {margin: 0} +#header h2 { +color: #888; +font-weight: normal; +font-size: 16px; +} + +#about h3 { +margin: 0; +margin-bottom: 10px; +font-size: 14px; +} + +#about-content { +background-color: #ffd; +border: 1px solid #fc0; +margin-left: -11px; +} +#about-content table { +margin-top: 10px; +margin-bottom: 10px; +font-size: 11px; +border-collapse: collapse; +} +#about-content td { +padding: 10px; +padding-top: 3px; +padding-bottom: 3px; +} +#about-content td.name {color: #555} +#about-content td.value {color: #000} + +#about-content.failure { +background-color: #fcc; +border: 1px solid #f00; +} +#about-content.failure p { +margin: 0; +padding: 10px; +} + +#getting-started { +border-top: 1px solid #ccc; +margin-top: 25px; +padding-top: 15px; +} +#getting-started h1 { +margin: 0; +font-size: 20px; +} +#getting-started h2 { +margin: 0; +font-size: 14px; +font-weight: normal; +color: #333; +margin-bottom: 25px; +} +#getting-started ol { +margin-left: 0; +padding-left: 0; +} +#getting-started li { +font-size: 18px; +color: #888; +margin-bottom: 25px; +} +#getting-started li h2 { +margin: 0; +font-weight: normal; +font-size: 18px; +color: #333; +} +#getting-started li p { +color: #555; +font-size: 13px; +} + +#search { +margin: 0; +padding-top: 10px; +padding-bottom: 10px; +font-size: 11px; +} +#search input { +font-size: 11px; +margin: 2px; +} +#search-text {width: 170px} + +#sidebar ul { +margin-left: 0; +padding-left: 0; +} +#sidebar ul h3 { +margin-top: 25px; +font-size: 16px; +padding-bottom: 10px; +border-bottom: 1px solid #ccc; +} +#sidebar li { +list-style-type: none; +} +#sidebar ul.links li { +margin-bottom: 5px; +} + +h1, h2, h3, h4, h5 { +font-family: sans-serif; +margin: 1.2em 0 0.6em 0; +} + +p { +line-height: 1.5em; +margin: 1.6em 0; +} + +code, tt { + font-family: 'Andale Mono', Monaco, 'Liberation Mono', 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', monospace; +} + +#footer { +clear: both; +padding-top: 2em; +text-align: center; +padding-right: 160px; +font-family: sans-serif; +font-size: 10px; +} diff --git a/Literature/public/dispatch.cgi b/Literature/public/dispatch.cgi new file mode 100755 index 0000000..32c5d96 --- /dev/null +++ b/Literature/public/dispatch.cgi @@ -0,0 +1,16 @@ +#!/usr/bin/env perl +BEGIN { $ENV{DANCER_APPHANDLER} = 'PSGI';} +use Dancer2; +use FindBin '$RealBin'; +use Plack::Runner; + +# For some reason Apache SetEnv directives dont propagate +# correctly to the dispatchers, so forcing PSGI and env here +# is safer. +set apphandler => 'PSGI'; +set environment => 'production'; + +my $psgi = path($RealBin, '..', 'bin', 'app.psgi'); +die "Unable to read startup script: $psgi" unless -r $psgi; + +Plack::Runner->run($psgi); diff --git a/Literature/public/dispatch.fcgi b/Literature/public/dispatch.fcgi new file mode 100755 index 0000000..e802223 --- /dev/null +++ b/Literature/public/dispatch.fcgi @@ -0,0 +1,18 @@ +#!/usr/bin/env perl +BEGIN { $ENV{DANCER_APPHANDLER} = 'PSGI';} +use Dancer2; +use FindBin '$RealBin'; +use Plack::Handler::FCGI; + +# For some reason Apache SetEnv directives dont propagate +# correctly to the dispatchers, so forcing PSGI and env here +# is safer. +set apphandler => 'PSGI'; +set environment => 'production'; + +my $psgi = path($RealBin, '..', 'bin', 'app.psgi'); +my $app = do($psgi); +die "Unable to read startup script: $@" if $@; +my $server = Plack::Handler::FCGI->new(nproc => 5, detach => 1); + +$server->run($app); diff --git a/Literature/public/favicon.ico b/Literature/public/favicon.ico new file mode 100644 index 0000000..96c7465 Binary files /dev/null and b/Literature/public/favicon.ico differ diff --git a/Literature/public/images/perldancer-bg.jpg b/Literature/public/images/perldancer-bg.jpg new file mode 100644 index 0000000..6ee6b77 Binary files /dev/null and b/Literature/public/images/perldancer-bg.jpg differ diff --git a/Literature/public/images/perldancer.jpg b/Literature/public/images/perldancer.jpg new file mode 100644 index 0000000..3f9e718 Binary files /dev/null and b/Literature/public/images/perldancer.jpg differ diff --git a/Literature/public/javascripts/jquery.js b/Literature/public/javascripts/jquery.js new file mode 100644 index 0000000..ab28a24 --- /dev/null +++ b/Literature/public/javascripts/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; +if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("