Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

A bit code reorganization, adding base DuckPAN functionality

  • Loading branch information...
commit e1a5a560fea1e77e80237facb2db69e72686e037 1 parent 5a3751c
@Getty Getty authored
View
6 Changes
@@ -1,5 +1 @@
-Revision history for {{$dist->name}}
-
-{{$NEXT}}
- - initial revision, generated by Catalyst
-
+Not maintained so far....
View
55 dist.ini
@@ -8,64 +8,65 @@ copyright_year = 2011
[Prereqs]
Catalyst::Action::RenderView = 0.14
+Catalyst::Authentication::Store::DBIx::Class = 0.1502
+Catalyst::Component::InstancePerContext = 0.001001
+Catalyst::Devel = 1.36
Catalyst::Model::Adaptor = 0.10
Catalyst::Plugin::Authentication = 0.10018
+Catalyst::Plugin::Authorization::Roles = 0.09
+Catalyst::Plugin::Captcha = 0.04
Catalyst::Plugin::ChainedURI = 0.002
Catalyst::Plugin::CustomErrorMessage = 0.06
Catalyst::Plugin::Session = 0.32
-Catalyst::Plugin::Captcha = 0.04
Catalyst::Plugin::Session::State::Cookie = 0.17
Catalyst::Plugin::Session::Store::File = 0.18
+Catalyst::Plugin::StackTrace = 0.11
Catalyst::Plugin::Static::Simple = 0.29
Catalyst::Plugin::Unicode::Encoding = 1.1
Catalyst::Runtime = 5.90002
-Catalyst::View::TT = 0.37
-Catalyst::View::JSON = 0.31
Catalyst::View::Email::Template = 0.31
-Catalyst::Plugin::Authorization::Roles = 0.09
-Catalyst::Authentication::Store::DBIx::Class = 0.1502
-Catalyst::Devel = 1.36
-Catalyst::Plugin::StackTrace = 0.11
+Catalyst::View::JSON = 0.31
+Catalyst::View::TT = 0.37
Config::INI = 0.018
+CPAN::Repository = 0.004
Crypt::Eksblowfish::Bcrypt = 0.009
+Data::Printer = 0
+DateTime::Format::Pg = 0
DBIx::Class::AlwaysUpdate = 0.001
DBIx::Class::Candy = 0.002000
-DBIx::Class::TimeStamp = 0.14
-DBIx::Class::InflateColumn::Serializer = 0.03
DBIx::Class::EncodedColumn = 0.00011
DBIx::Class::InflateColumn::DateTime = 0
+DBIx::Class::InflateColumn::Serializer = 0.03
DBIx::Class::Schema::Loader = 0.07010
-Catalyst::Component::InstancePerContext = 0.001001
-File::ShareDir::ProjectDistDir = 0
-Plack::Middleware::Debug = 0.13
-MooseX::Getopt = 0.37
+DBIx::Class::TimeStamp = 0.14
Digest::MD5 = 2.51
+Dist::Data = 0.002
+Email::Valid = 0.185
FCGI = 0.71
+FCGI::ProcManager = 0.22
+File::Path = 2.08
+File::ShareDir::ProjectDistDir = 0
+File::Spec = 3.33
+Gravatar::URL = 1.05
+HTML::EasyForm = 0.101
IO::All = 0.41
IO::Socket::SSL = 1.44
JSON = 2.53
Moose = 2.0205
+MooseX::Getopt = 0.37
+MooseX::NonMoose = 0.22
namespace::autoclean = 0.13
+Plack = 0.9982
+Plack::Middleware::Debug = 0.13
+Prosody = 0.007
Template = 2.22
Template::Plugin::Capture = 0.01
Template::Provider::Encoding = 0.10
Template::Stash::XS = 0
-YAML = 0.73
-YAML::XS = 0.35
-HTML::EasyForm = 0.101
-File::Path = 2.08
-FCGI::ProcManager = 0.22
-Prosody = 0.007
-Plack = 0.9982
Test::WWW::Mechanize::Catalyst = 0.54
-MooseX::NonMoose = 0.22
-DateTime::Format::Pg = 0
-Data::Printer = 0
-Email::Valid = 0.185
-File::Spec = 3.33
-Data::Localize = 0.00020
-Gravatar::URL = 1.05
utf8::all = 0
+YAML = 0.73
+YAML::XS = 0.35
[Prereqs / TestRequires]
Test::More = 0.98
View
26 lib/DDGC.pm
@@ -5,6 +5,8 @@ use Moose;
use DDGC::Config;
use DDGC::DB;
use DDGC::User;
+use DDGC::DuckPAN;
+use DDGC::XMPP;
use DDGC::Comments;
use File::Copy;
use IO::All;
@@ -30,14 +32,34 @@ has db => (
is => 'ro',
lazy_build => 1,
);
-sub _build_db { DDGC::DB->connect }
+sub _build_db {
+ my $self = shift;
+ DDGC::DB->connect($self);
+}
has xmpp => (
isa => 'DDGC::XMPP',
is => 'ro',
lazy_build => 1,
);
-sub _build_xmpp { DDGC::XMPP->new }
+sub _build_xmpp {
+ my $self = shift;
+ DDGC::XMPP->new({
+ ddgc => $self,
+ });
+}
+
+has duckpan => (
+ isa => 'DDGC::DuckPAN',
+ is => 'ro',
+ lazy_build => 1,
+);
+sub _build_duckpan {
+ my $self = shift;
+ DDGC::DuckPAN->new({
+ ddgc => $self,
+ });
+}
has config => (
isa => 'DDGC::Config',
View
8 lib/DDGC/Config.pm
@@ -31,6 +31,8 @@ sub prosody_userhost { defined $ENV{'DDGC_PROSODY_USERHOST'} ? $ENV{'DDGC_PROSOD
sub prosody_admin_username { defined $ENV{'DDGC_PROSODY_ADMIN_USERNAME'} ? $ENV{'DDGC_PROSODY_ADMIN_USERNAME'} : 'testone' }
sub prosody_admin_password { defined $ENV{'DDGC_PROSODY_ADMIN_PASSWORD'} ? $ENV{'DDGC_PROSODY_ADMIN_PASSWORD'} : 'testpass' }
+sub duckpan_url { defined $ENV{'DDGC_DUCKPAN_URL'} ? $ENV{'DDGC_DUCKPAN_URL'} : 'http://darkpan.duckduckgo.com/' }
+
# DANGER: DEACTIVATES PASSWORD CHECK FOR ALL USERACCOUNTS!!!!!!!!!!!!!!!!!!!!!!
sub prosody_running { defined $ENV{'DDGC_PROSODY_RUNNING'} ? $ENV{'DDGC_PROSODY_RUNNING'} : 0 }
@@ -76,6 +78,12 @@ sub db_params {
return \%vars;
}
+sub duckpandir {
+ my $dir = defined $ENV{'DDGC_DUCKPANDIR'} ? $ENV{'DDGC_DUCKPANDIR'} : rootdir().'/duckpan/';
+ make_path($dir) if !-d $dir;
+ return File::Spec->rel2abs( $dir );
+}
+
sub filesdir {
my $dir = defined $ENV{'DDGC_FILESDIR'} ? $ENV{'DDGC_FILESDIR'} : rootdir().'/files/';
make_path($dir) if !-d $dir;
View
27 lib/DDGC/DB.pm
@@ -7,21 +7,22 @@ use DDGC::Config;
__PACKAGE__->load_namespaces();
-sub connection {
- my $self = shift;
- return $self->next::method(@{&connect_info});
-}
-
-sub connect_info {[
- DDGC::Config::db_dsn,
- DDGC::Config::db_user,
- DDGC::Config::db_password,
- DDGC::Config::db_params,
-]}
+has _ddgc => (
+ isa => 'DDGC',
+ is => 'rw',
+);
+sub ddgc { shift->_ddgc }
sub connect {
- my $self = shift;
- my $schema = $self->next::method(@_);
+ my ( $self, $ddgc ) = @_;
+ $ddgc = $self->ddgc if ref $self;
+ my $schema = $self->next::method(
+ $ddgc->config->db_dsn,
+ $ddgc->config->db_user,
+ $ddgc->config->db_password,
+ $ddgc->config->db_params,
+ );
+ $schema->_ddgc($ddgc);
return $schema;
}
View
37 lib/DDGC/DuckPAN.pm
@@ -0,0 +1,37 @@
+package DDGC::DuckPAN;
+
+use Moose;
+use CPAN::Repository;
+
+has ddgc => (
+ isa => 'DDGC',
+ is => 'ro',
+ required => 1,
+ weak_ref => 1,
+);
+
+has cpan_repository => (
+ isa => 'CPAN::Repository',
+ is => 'ro',
+ lazy_build => 1,
+);
+
+sub _build_cpan_repository {
+ my ( $self ) = @_;
+ my $repo = CPAN::Repository->new({
+ dir => $self->ddgc->config->duckpandir,
+ url => $self->ddgc->config->duckpan_url,
+ written_by => (ref $self),
+ });
+ $repo->initialize unless $repo->is_initialized;
+ return $repo;
+}
+
+sub modules { shift->cpan_repository->modules }
+
+sub add_user_distribution {
+ my ( $self, $user, $distribution_filename ) = @_;
+ $self->cpan_repository->add_author_distribution(uc($user->username),$distribution_filename);
+}
+
+1;
View
6 lib/DDGC/Localize.pm
@@ -1,6 +0,0 @@
-package DDGC::Localize;
-
-use Moose;
-extends 'Data::Localize';
-
-1;
View
43 lib/DDGC/Web/Controller/Duckpan.pm
@@ -0,0 +1,43 @@
+package DDGC::Web::Controller::Duckpan;
+use Moose;
+use namespace::autoclean;
+
+use DDGC::Config;
+use Dist::Data;
+use Pod::HTMLEmbed;
+
+BEGIN {extends 'Catalyst::Controller'; }
+
+sub base :Chained('/base') :PathPart('duckpan') :CaptureArgs(0) {
+ my ( $self, $c ) = @_;
+ $c->stash->{title} = 'DuckPAN';
+ $c->stash->{duckpan} = $c->d->duckpan;
+}
+
+sub do :Chained('base') :CaptureArgs(0) {
+ my ( $self, $c ) = @_;
+}
+
+sub index :Chained('do') :Args(0) {
+ my ( $self, $c ) = @_;
+}
+
+sub module :Chained('base') :CaptureArgs(1) {
+ my ( $self, $c, $module ) = @_;
+ $c->stash->{duckpan_module} = $module;
+ $c->stash->{duckpan_dist_filename} = $c->stash->{duckpan}->modules->{$module};
+ if ($c->stash->{duckpan_dist_filename}) {
+ $c->stash->{duckpan_dist} = Dist::Data->new($c->stash->{duckpan_dist_filename});
+ my $p = Pod::HTMLEmbed->new;
+ my $filename = $c->stash->{duckpan_dist}->packages->{$module}->{file};
+ $c->stash->{module_pod} = $p->load($c->stash->{duckpan_dist}->file($filename));
+ }
+}
+
+sub module_index :Chained('module') :PathPart('') :Args(0) {
+ my ( $self, $c ) = @_;
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
View
13 lib/DDGC/Web/Model/DB.pm
@@ -1,13 +0,0 @@
-package DDGC::Web::Model::DB;
-
-use Moose;
-extends 'Catalyst::Model::DBIC::Schema';
-
-use DDGC::DB;
-
-__PACKAGE__->config(
- schema_class => 'DDGC::DB',
- connect_info => DDGC::DB::connect_info,
-);
-
-1;
View
15 lib/DDGC/XMPP.pm
@@ -6,26 +6,33 @@ use DDGC::User;
use Prosody::Storage::SQL;
+has ddgc => (
+ isa => 'DDGC',
+ is => 'ro',
+ required => 1,
+ weak_ref => 1,
+);
+
has prosody_driver => (
isa => 'Str',
is => 'ro',
lazy_build => 1,
);
-sub _build_prosody_driver { DDGC::Config::prosody_db_driver }
+sub _build_prosody_driver { shift->ddgc->config->prosody_db_driver }
has prosody_database => (
isa => 'Str',
is => 'ro',
lazy_build => 1,
);
-sub _build_prosody_database { DDGC::Config::prosody_db_database }
+sub _build_prosody_database { shift->ddgc->config->prosody_db_database }
has prosody_userhost => (
isa => 'Str',
is => 'ro',
lazy_build => 1,
);
-sub _build_prosody_userhost { DDGC::Config::prosody_userhost }
+sub _build_prosody_userhost { shift->ddgc->config->prosody_userhost }
has _prosody => (
isa => 'Prosody::Storage::SQL',
@@ -51,4 +58,4 @@ sub user {
return %{$data};
}
-1;
+1;
View
26 lib/DDGCTest/Database.pm
@@ -8,6 +8,7 @@ use Moose;
use DDGC::DB;
use Try::Tiny;
use utf8::all;
+use File::ShareDir::ProjectDistDir;
use Data::Printer;
@@ -52,6 +53,7 @@ sub deploy {
$self->add_languages;
$self->add_users;
$self->add_token_domains;
+ $self->add_distributions;
}
sub isa_ok { ::isa_ok(@_) if shift->test }
@@ -223,6 +225,30 @@ sub add_users {
}
################################################################
+# ____ _ ____ _ _ _
+# | _ \ _ _ ___| | _| _ \ / \ | \ | |
+# | | | | | | |/ __| |/ / |_) / _ \ | \| |
+# | |_| | |_| | (__| <| __/ ___ \| |\ |
+# |____/ \__,_|\___|_|\_\_| /_/ \_\_| \_|
+
+sub distributions {[
+ [ testone => 'DDG-Something-0.001.tar.gz' ],
+ [ testtwo => 'DDG-Plugin-OtherThing-MoreTest-0.001.tar.gz' ],
+ [ testthree => 'DDG-Plugin-FatHead-Test-0.001.tar.gz' ],
+]}
+
+sub add_distributions {
+ my ( $self ) = @_;
+ for (@{$self->distributions}) {
+ my $username = $_->[0];
+ my $filename = $_->[1];
+ my $sharedir = dist_dir('DDGC');
+ my $user = $self->d->find_user($username);
+ $self->d->duckpan->add_user_distribution($user,$sharedir.'/testdists/'.$filename);
+ }
+}
+
+################################################################
# _ _ _ _
# | |_ ___ | | _____ _ __ ___ ___ _ __ | |_ _____ _| |_
# | __/ _ \| |/ / _ \ '_ \ / __/ _ \| '_ \| __/ _ \ \/ / __|
View
664 lib/DDGCTest/DatabaseStart.pm
@@ -1,664 +0,0 @@
-package DDGCTest::DatabaseStart;
-#
-# BE SURE YOU SAVE THIS FILE AS UTF-8 WITHOUT BYTE ORDER MARK (BOM)
-#
-######################################################################
-
-use Moose;
-
-extends 'DDGCTest::Database';
-
-use utf8;
-
-sub isa_ok {}
-sub is {}
-
-sub deploy {
- my ( $self ) = @_;
- $self->d->deploy_fresh;
- $self->add_languages;
- $self->add_token_domains;
-}
-
-#############################
-# _ _ ___ ___ _ __ ___
-# | | | / __|/ _ \ '__/ __|
-# | |_| \__ \ __/ | \__ \
-# \__,_|___/\___|_| |___/
-
-# sub users {{
- # 'yegg' => {
- # public => 1,
- # admin => 1,
- # languages => {
- # us => 5,
- # },
- # },
- # 'getty' => {
- # public => 1,
- # admin => 1,
- # languages => {
- # de => 5,
- # us => 3,
- # },
- # },
-# }}
-
-# sub add_users {
- # my ( $self ) = @_;
- # for (keys %{$self->users}) {
- # my $data = $self->users->{$_};
- # $self->update_user($_,$data);
- # }
- # for (keys %{$self->users}) {
- # my $user = $self->d->find_user($_);
- # $self->is($user->username,$_,'Checking username');
- # $self->isa_ok($user,'DDGC::User');
- # }
-# }
-
-# sub update_user {
- # my ( $self, $username, $data ) = @_;
- # my $languages = delete $data->{languages};
- # my $user = $self->d->find_user($username);
- # $user->$_($data->{$_}) for (keys %{$data});
- # for (keys %{$languages}) {
- # $user->create_related('user_languages',{
- # language_id => $self->c->{languages}->{$_}->id,
- # grade => $languages->{$_},
- # });
- # }
- # $user->update;
- # $self->isa_ok($user,'DDGC::User');
-# }
-
-################################################################
-# _ _ _ _
-# | |_ ___ | | _____ _ __ ___ ___ _ __ | |_ _____ _| |_
-# | __/ _ \| |/ / _ \ '_ \ / __/ _ \| '_ \| __/ _ \ \/ / __|
-# | || (_) | < __/ | | | | (_| (_) | | | | || __/> <| |_
-# \__\___/|_|\_\___|_| |_| \___\___/|_| |_|\__\___/_/\_\\__|
-
-sub token_domains {{
- 'duckduckgo-duckduckgo' => {
- name => 'DuckDuckGo Core',
- base => 'us',
- description => 'Snippets around the core pages of DuckDuckGo, the homepage, the resultpage, the settings and the ZeroClickInfo in there',
- languages => [qw( de es br ru fr se in da )],
- snippets => [
- 'Settings', {
- notes => {
- token => 'In the top menu',
- },
- },
- 'Goodies', {
- notes => {
- token => 'In the top menu',
- },
- },
- 'Team Duck', {
- notes => {
- token => 'In the top menu',
- },
- },
- 'Results', {
- notes => {
- token => 'In the top menu under Settings',
- },
- },
- 'Privacy', {
- notes => {
- token => 'In the top menu under Settings',
- },
- },
- 'Colors', {
- notes => {
- token => 'In the top menu under Settings',
- },
- },
- 'Look', {
- notes => {
- token => 'In the top menu under Settings',
- },
- },
- 'Interface', {
- notes => {
- token => 'In the top menu under Settings',
- },
- },
- 'All Settings', {
- notes => {
- token => 'In the top menu under Settings',
- },
- },
- 'URL Params', {
- notes => {
- token => 'In the top menu under Settings',
- },
- },
- 'Load/Reset', {
- notes => {
- token => 'In the top menu under Settings',
- },
- },
- 'Shortcuts', {
- notes => {
- token => 'In the top menu under Goodies',
- },
- },
- 'Technical', {
- notes => {
- token => 'In the top menu under Goodies',
- },
- },
- 'Add-ons', {
- notes => {
- token => 'In the top menu under Goodies',
- },
- },
- 'About', {
- notes => {
- token => 'In the top menu under Goodies',
- },
- },
- 'Privacy', {
- notes => {
- token => 'In the top menu under Goodies',
- },
- },
- 'Add to %s', {
- notes => {
- token => 'In the top menu under Team Duck -- %s will be browser names, like Firefox.',
- },
- },
- 'Get results for different meanings of %s', {
- notes => {
- token => 'In 0-click box -- for disambiguation.'
- },
- },
- 'See also', {
- notes => {
- token => 'In 0-click box -- for disambiguation.'
- },
- },
- 'Other uses', {
- notes => {
- token => 'In 0-click box -- for disambiguation.'
- },
- },
- 'Meanings', {
- notes => {
- token => 'In 0-click box -- for disambiguation.'
- },
- },
- 'Dictionary', {
- notes => {
- token => 'In 0-click box -- link to definition.'
- },
- },
- 'Category', {
- notes => {
- token => 'In 0-click box -- link to category page.'
- },
- },
- 'More related topics', {
- notes => {
- token => 'In 0-click box -- link to category page.'
- },
- },
- 'More at %s', {
- notes => {
- token => 'In 0-click box -- %s will be a site name, like Wikipedia.'
- },
- },
- 'Entry in %s', {
- notes => {
- token => 'In results when 0-click box cannot be displayed for some reason -- %s will be a site name, like Wikipedia.'
- },
- },
- 'Official site', {
- notes => {
- token => 'Whether a site is official or not.'
- },
- },
- 'Ads via %s', {
- notes => {
- token => 'For advertising -- %s will be an ad provider, like Amazon.'
- },
- },
- 'Search ideas', {
- notes => {
- token => 'A label for the search ideas feature.'
- },
- },
- 'More results', {
- notes => {
- token => 'A link to get more results from a particular domain.'
- },
- },
- 'results by %s', {
- notes => {
- token => 'Used to identify sources -- %s will be a source, like Bing.'
- },
- },
- 'built with %s', {
- notes => {
- token => 'Used to identify underyling technology -- %s will be a name, like Yahoo!.'
- },
- },
- 'What does this mean?', {
- notes => {
- token => 'Used to link to a question on our help center.'
- },
- },
- 'More links', {
- notes => {
- token => 'A link to get more results (when auto-scroll is off or in special cases).'
- },
- },
- 'more', {
- notes => {
- token => 'Used to point to additional social networking profiles (in results).'
- },
- },
- 'Special', {
- notes => {
- token => 'Used in the !bang dropdown.'
- },
- },
- 'Try search on', {
- notes => {
- token => 'Used in the !bang dropdown.'
- },
- },
- 'Show all', {
- notes => {
- token => 'Used in the !bang dropdown.'
- },
- },
- 'By category', {
- notes => {
- token => 'Used in the !bang dropdown.'
- },
- },
- 'Alphabetically', {
- notes => {
- token => 'Used in the !bang dropdown.'
- },
- },
- 'Map', {
- notes => {
- token => 'Used in 0-click box for local results, e.g. <a href="http://duckduckgo.com/?q=black+lab+bistro">http://duckduckgo.com/?q=black+lab+bistro</a>'
- },
- },
- 'Nearby', {
- notes => {
- token => 'Used in 0-click box for local results, e.g. <a href="http://duckduckgo.com/?q=black+lab+bistro">http://duckduckgo.com/?q=black+lab+bistro</a>'
- },
- },
- 'Computed by %s', {
- notes => {
- token => 'Used in 0-click box for attribution -- %s would be a provider, like Wolfram|Alpha'
- },
- },
- '%s is a zip code in %s', {
- notes => {
- token => 'Used in 0-click box for local results, e.g. <a href="https://duckduckgo.com/?q=19460">https://duckduckgo.com/?q=19460</a>'
- },
- },
-
- '%s is a phone number in %s', {
- notes => {
- token => 'Used in 0-click box for local results, e.g. <a href="https://duckduckgo.com/?q=%28323%29+319-6185">https://duckduckgo.com/?q=%28323%29+319-6185</a>'
- },
- },
- 'shipment tracking', {
- notes => {
- token => 'Used in goodie results, e.g. <a href="https://duckduckgo.com/?q=1Z0884XV0399906189">https://duckduckgo.com/?q=1Z0884XV0399906189</a>'
- },
- },
- 'Reverse search', {
- notes => {
- token => 'Used in goodie results, e.g. <a href="https://duckduckgo.com/?q=%28323%29+319-6185">https://duckduckgo.com/?q=%28323%29+319-6185</a>'
- },
- },
- 'pay', {
- notes => {
- token => 'Used in goodie results, e.g. <a href="https://duckduckgo.com/?q=%28323%29+319-6185">https://duckduckgo.com/?q=%28323%29+319-6185</a>'
- },
- },
- 'vehicle info', {
- notes => {
- token => 'Used in goodie results, e.g. <a href="https://duckduckgo.com/?q=1g8gg35m1g7123101">https://duckduckgo.com/?q=1g8gg35m1g7123101</a>'
- },
- },
- 'Reviews', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=9780061353246">https://duckduckgo.com/?q=9780061353246</a>'
- },
- },
- 'random number', {
- notes => {
- token => 'Used in 0-click box for goodies, e.g. <a href="https://duckduckgo.com/?q=random+number">https://duckduckgo.com/?q=random+number</a>'
- },
- },
- 'random password', {
- notes => {
- token => 'Used in 0-click box for goodies, e.g. <a href="https://duckduckgo.com/?q=random+password">https://duckduckgo.com/?q=random+password</a>'
- },
- },
- 'random', {
- notes => {
- token => 'Used in 0-click box for goodies, e.g. <a href="https://duckduckgo.com/?q=yes+or+no">https://duckduckgo.com/?q=yes+or+no</a>'
- },
- },
- '%s is in', {
- notes => {
- token => 'Used in 0-click box for local results, e.g. <a href="https://duckduckgo.com/?q=72.94.249.36">https://duckduckgo.com/?q=72.94.249.36</a>'
- },
- },
- 'try to go there', {
- notes => {
- token => 'Used in goodie results, e.g. <a href="https://duckduckgo.com/?q=72.94.249.36">https://duckduckgo.com/?q=72.94.249.36</a>'
- },
- },
- '%s is a parked domain (last time we checked).', {
- notes => {
- token => 'Message displayed sometimes at top of results.'
- },
- },
- 'Try: %s', {
- notes => {
- token => 'Message displayed sometimes at top of results (for bang syntax), e.g. <a href="https://duckduckgo.com/?q=twitter+test">https://duckduckgo.com/?q=twitter+test</a>'
- },
- },
- 'Searches %s using our %s', {
- notes => {
- token => 'Message displayed sometimes at top of results (for bang syntax), e.g. <a href="https://duckduckgo.com/?q=twitter+test">https://duckduckgo.com/?q=twitter+test</a>'
- },
- },
- 'Offers', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=9780061353246">https://duckduckgo.com/?q=9780061353246</a>'
- },
- },
- 'Similar', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=9780061353246">https://duckduckgo.com/?q=9780061353246</a>'
- },
- },
- 'Library', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=9780061353246">https://duckduckgo.com/?q=9780061353246</a>'
- },
- },
- 'Top', {
- notes => {
- token => 'Used in headings on Category pages, e.g. <a href="https://duckduckgo.com/?q=simpsons+characters">https://duckduckgo.com/?q=simpsons+characters</a>'
- },
- },
- 'Web links', {
- notes => {
- token => 'Used in heading on bottom of Category pages, e.g. <a href="https://duckduckgo.com/?q=simpsons+characters">https://duckduckgo.com/?q=simpsons+characters</a>'
- },
- },
- 'No right topic? Try web links...', {
- notes => {
- token => 'Used at the bottom of Category pages, e.g. <a href="https://duckduckgo.com/?q=simpsons+characters">https://duckduckgo.com/?q=simpsons+characters</a>'
- },
- },
- 'DDG Topics List', {
- notes => {
- token => 'Used at the bottom of Category pages, e.g. <a href="https://duckduckgo.com/?q=simpsons+characters">https://duckduckgo.com/?q=simpsons+characters</a>'
- },
- },
- 'uses results from %s', {
- notes => {
- token => 'Used at the top of results for source attribution -- %s is a source name, like Blekko'
- },
- },
- 'ignore this box please', {
- notes => {
- token => 'Used for some hidden HTML elements'
- },
- },
- 'put search terms here', {
- notes => {
- token => 'Used if you enter nothing in the search box.'
- },
- },
- 'I\'m feeling ducky', {
- notes => {
- token => 'Used in the !bang dropdown.'
- },
- },
- 'sort by date', {
- notes => {
- token => 'Used in the !bang dropdown.'
- },
- },
- 'Images', {
- notes => {
- token => 'Used in the !bang dropdown.'
- },
- },
- 'News', {
- notes => {
- token => 'Used in the !bang dropdown.'
- },
- },
- 'This page requires %s', {
- notes => {
- token => 'Used for browsers not meeting certain requirements.'
- },
- },
- 'Get the non-JS version', {
- notes => {
- token => 'Used for browsers not having JavaScript.'
- },
- },
- 'privacy policy', {
- notes => {
- token => 'Link on the homepage.'
- },
- },
- 'bubble', {
- notes => {
- token => 'Link on the homepage in the context of the Filter Bubble and dontbubble.us'
- },
- },
- \'donttrackus', 'track', {
- notes => {
- token => 'Link on the homepage in the context of the No Tracking and donttrack.us'
- },
- },
- 'We don\'t %s or %s you!', {
- notes => {
- token => 'On the homepage.'
- },
- },
- 'See our %s', {
- notes => {
- token => 'On the homepage.'
- },
- },
- 'Set as Homepage', {
- notes => {
- token => 'On the homepage.'
- },
- },
- '%s is a %s', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=9780061353246">https://duckduckgo.com/?q=9780061353246</a>'
- },
- },
- 'by %s', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=9780061353246">https://duckduckgo.com/?q=9780061353246</a>'
- },
- },
- 'released %s', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=9780061353246">https://duckduckgo.com/?q=9780061353246</a>'
- },
- },
- 'from %s', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=9780061353246">https://duckduckgo.com/?q=9780061353246</a>'
- },
- },
- 'and %s', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=9780061353246">https://duckduckgo.com/?q=9780061353246</a>'
- },
- },
- '%d pg', '%d pgs', {
- notes => {
- token => 'An abbreviation for pages. Used in 0-click box for product results, e.g. https://duckduckgo.com/?q=9780061353246<a href="https://duckduckgo.com/?q=9780061353246">https://duckduckgo.com/?q=9780061353246</a>'
- },
- },
- '%d disc', '%d discs', {
- notes => {
- token => 'Used in ads for products, e.g. <a href="https://duckduckgo.com/?q=the+graduate+dvd">https://duckduckgo.com/?q=the+graduate+dvd</a>'
- },
- },
- 'book', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=superbad+dvd">https://duckduckgo.com/?q=superbad+dvd</a>'
- },
- },
- 'album', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=superbad+dvd">https://duckduckgo.com/?q=superbad+dvd</a>'
- },
- },
- \'zci-product', 'track', {
- notes => {
- token => 'Used in 0-click box for product results, e.g. <a href="https://duckduckgo.com/?q=superbad+dvd">https://duckduckgo.com/?q=superbad+dvd</a>'
- },
- },
- 'Did you mean %s?', {
- notes => {
- token => 'Used in spelling correction, e.g. <a href="https://duckduckgo.com/?q=testingg">https://duckduckgo.com/?q=testingg</a>',
- },
- },
- 'Listen', {
- notes => {
- token => 'Used in 0-click bot for video results, e.g. <a href="https://duckduckgo.com/?q=blink182+song">https://duckduckgo.com/?q=blink182+song</a>',
- },
- },
- 'Safe search filtered your search to %s', {
- notes => {
- token => 'Message displayed sometimes at top of results.'
- },
- },
- 'Safe search filtered 0-click info for %s', {
- notes => {
- token => 'Message displayed sometimes at top of results.'
- },
- },
- 'Use %s command to turn off temporarily.', {
- notes => {
- token => 'Message displayed sometimes at top of results.'
- },
- },
- 'Turn off', {
- notes => {
- token => 'Message displayed sometimes at top of results -- in the context of safe search.'
- },
- },
- 'temporarily', {
- notes => {
- token => 'Message displayed sometimes at top of results -- in the context of safe search.'
- },
- },
- 'permanently', {
- notes => {
- token => 'Message displayed sometimes at top of results -- in the context of safe search.'
- },
- },
- 'Keyboard shortcuts', {
- notes => {
- token => 'Section heading (for right column).'
- },
- },
- 'Search syntax', {
- notes => {
- token => 'Section heading (for right column).'
- },
- },
- ],
- texts => [
- ],
- },
- # 'duckduckgo-community' => {
- # name => 'DuckDuckGo Community',
- # base => 'us',
- # description => 'The translations for _THIS_ platform :-)',
- # languages => [qw( us de es br ru )],
- # snippets => [
- # ],
- # texts => [
- # ],
- # },
- 'test' => {
- name => 'Test area, playfield for you',
- base => 'us',
- description => 'Play around with the translation interface without doing any harm! :)',
- languages => [qw( de es br ru fr se in da )],
- snippets => [
- 'I\'m a little teapot', {},
- 'I will not buy this record; it is scratched.', {},
- 'We like searching with DuckDuckGo', {},
- \'Family Guy','Bird is the word', {},
- \'Earth', 'Hello world!', {},
- \'Mars', 'Hello world!', {},
- 'You should duck %s', {},
- 'From %s to %s', { notes => { token => 'Good example for changing order, you could translate it with "To %2$s from %1$s"' } },
- 'You have %s friend', 'You have %s friends', {},
- \'Email', 'You have %s message', 'You have %s messages', {},
- \'Instant Messaging', 'You have %s message', 'You have %s messages', {},
- '%s is better as %s', {},
- 'Always look on the bright side of life.', {},
- 'We are no longer the knights who say %s! We are now the knights who say %s!', {},
- 'I don\'t think there\'s a punch-line scheduled, is there?', {},
- 'Yes', {},
- 'No', {},
- 'Why are dogs noses always wet?', {},
- 'Why is 6 afraid of 7? Cause 7 8 9!', { notes => { token => 'Haha, try to translate the joke :-P' } },
- 'And I shall go on talking in a low voice while the sea sounds in the distance and overhead the great black flood of wind polishes the bright stars.', {},
- 'Downloading', {},
- 'I stepped on a Cornflake, and now I am a cereal killer.', {},
- 'Loading %s done', { notes => { token => '%s would be a percent number, like 73%' } },
- 'Contribution', {},
- 'What happens if you get scared half to death twice?', {},
- 'Development', {},
- 'Developers', {},
- ],
- texts => [
- '::test::something::1' => {
- notes => {
- token => 'The first paragraph should be about love'
- },
- },
- '::test::something::2' => {
- notes => {
- token => 'The second paragraph should be about war'
- },
- },
- '::test::something::3' => {
- notes => {
- token => 'And the third paragraph should be about DuckDuckGo!'
- },
- },
- ],
- },
-}}
-
-1;
-
-
-
-
-
-
View
15 script/ddgc_deploy_dev.pl
@@ -12,11 +12,12 @@
use DDGC;
use DDGCTest::Database;
-use DDGCTest::DatabaseStart;
use File::Path qw( make_path remove_tree );
use Getopt::Long;
+my $config = DDGC::Config->new;
+
my $kill;
my $start;
@@ -25,16 +26,14 @@
"start" => \$start,
);
-if (-d DDGC::Config::rootdir_path) {
- $kill ? remove_tree(DDGC::Config::rootdir_path) : die "environment exist, use --kill to kill it!"
+if (-d $config->rootdir_path) {
+ $kill ? remove_tree($config->rootdir_path) : die "environment exist, use --kill to kill it!"
}
print "Generating database, this may take a while... ";
-if ($start) {
- DDGCTest::DatabaseStart->new(DDGC->new)->deploy;
-} else {
- DDGCTest::Database->new(DDGC->new)->deploy;
-}
+my $ddgc = DDGC->new({ config => $config });
+
+DDGCTest::Database->new($ddgc)->deploy;
print "done\n";
View
BIN  share/testdists/DDG-Plugin-FatHead-Test-0.001.tar.gz
Binary file not shown
View
BIN  share/testdists/DDG-Plugin-OtherThing-MoreTest-0.001.tar.gz
Binary file not shown
View
BIN  share/testdists/DDG-Something-0.001.tar.gz
Binary file not shown
View
11 templates/duckpan/index.tt
@@ -0,0 +1,11 @@
+<h1>DuckPAN</h1>
+<hr>
+<div>
+ <h2>Modules in DuckPAN</h2>
+ <ul>
+ <@ FOR module IN duckpan.modules.keys.sort @>
+ <li><a href="<@ u('Duckpan','module_index',module) @>"><@ module @></a></li>
+ <@ END @>
+ </ul>
+</div>
+<hr>
View
4 templates/duckpan/module_index.tt
@@ -0,0 +1,4 @@
+<div id="___pod" class="pod">
+ <@ module_pod.toc @>
+ <@ module_pod.body @>
+</div>
Please sign in to comment.
Something went wrong with that request. Please try again.