Skip to content

Commit e8805d1

Browse files
committed
changed indentation style
1 parent 1906c42 commit e8805d1

File tree

156 files changed

+19762
-19800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+19762
-19800
lines changed

.perltidyrc

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
--nohanging-side-comments # Troublesome for commented out code
2323

2424
-isbc # Block comments may only be indented if they have some space characters before the #
25+
-i=2 # Indent level is 2 cols
2526
-ci=2 # Continuation indent is 2 cols
2627

2728
# We use version control, so just rewrite the file

Makefile.PL

+62-62
Original file line numberDiff line numberDiff line change
@@ -14,69 +14,69 @@ my ($mm) = $ExtUtils::MakeMaker::VERSION =~ /^([^_]+)/;
1414
# We only use core modules, so you shouldn't have to install anything besides
1515
# Perl 5.8.7!
1616
WriteMakefile(
17-
NAME => 'Mojolicious',
18-
VERSION_FROM => 'lib/Mojolicious.pm',
19-
ABSTRACT => 'The Web In A Box!',
20-
AUTHOR => 'Sebastian Riedel <[email protected]>',
17+
NAME => 'Mojolicious',
18+
VERSION_FROM => 'lib/Mojolicious.pm',
19+
ABSTRACT => 'The Web In A Box!',
20+
AUTHOR => 'Sebastian Riedel <[email protected]>',
2121

22-
($mm < 6.3002 ? () : ('LICENSE' => 'artistic_2')),
22+
($mm < 6.3002 ? () : ('LICENSE' => 'artistic_2')),
2323

24-
( $mm < 6.46
25-
? ()
26-
: ( META_MERGE => {
27-
requires => {perl => '5.008007'},
28-
resources => {
29-
homepage => 'http://mojolicio.us',
30-
license => 'http://dev.perl.org/licenses/',
31-
MailingList =>
32-
'http://groups.google.com/group/mojolicious',
33-
repository => 'http://github.com/kraih/mojo',
34-
bugtracker => 'http://github.com/kraih/mojo/issues'
35-
},
36-
no_index => {directory => [qw/t/]}
37-
},
38-
META_ADD => {
39-
build_requires => {},
40-
configure_requires => {}
41-
},
42-
)
43-
),
24+
( $mm < 6.46
25+
? ()
26+
: (
27+
META_MERGE => {
28+
requires => {perl => '5.008007'},
29+
resources => {
30+
homepage => 'http://mojolicio.us',
31+
license => 'http://dev.perl.org/licenses/',
32+
MailingList => 'http://groups.google.com/group/mojolicious',
33+
repository => 'http://github.com/kraih/mojo',
34+
bugtracker => 'http://github.com/kraih/mojo/issues'
35+
},
36+
no_index => {directory => [qw/t/]}
37+
},
38+
META_ADD => {
39+
build_requires => {},
40+
configure_requires => {}
41+
},
42+
)
43+
),
4444

45-
EXE_FILES => ['script/mojo', 'script/hypnotoad'],
46-
PREREQ_PM => {
47-
'B' => 0,
48-
'Carp' => 0,
49-
'Cwd' => 0,
50-
'Data::Dumper' => 0,
51-
'Digest::MD5' => 0,
52-
'Encode' => 0,
53-
'Errno' => 0,
54-
'Exporter' => 0,
55-
'ExtUtils::MakeMaker' => 0,
56-
'File::Basename' => 0,
57-
'File::Copy' => 0,
58-
'File::Path' => 0,
59-
'File::Spec' => 0,
60-
'File::Spec::Functions' => 0,
61-
'File::Temp' => 0,
62-
'FindBin' => 0,
63-
'Getopt::Long' => 0,
64-
'I18N::LangTags' => 0,
65-
'IO::File' => 0,
66-
'IO::Poll' => 0,
67-
'IO::Socket' => 0,
68-
'List::Util' => 0,
69-
'Locale::Maketext' => 0,
70-
'MIME::Base64' => 0,
71-
'MIME::QuotedPrint' => 0,
72-
'POSIX' => 0,
73-
'Scalar::Util' => 0,
74-
'Storable' => 0,
75-
'Sys::Hostname' => 0,
76-
'Test::Builder' => 0,
77-
'Test::Harness' => 0,
78-
'Test::More' => 0,
79-
'Time::HiRes' => 0
80-
},
81-
test => {TESTS => 't/*.t t/*/*.t'}
45+
EXE_FILES => ['script/mojo', 'script/hypnotoad'],
46+
PREREQ_PM => {
47+
'B' => 0,
48+
'Carp' => 0,
49+
'Cwd' => 0,
50+
'Data::Dumper' => 0,
51+
'Digest::MD5' => 0,
52+
'Encode' => 0,
53+
'Errno' => 0,
54+
'Exporter' => 0,
55+
'ExtUtils::MakeMaker' => 0,
56+
'File::Basename' => 0,
57+
'File::Copy' => 0,
58+
'File::Path' => 0,
59+
'File::Spec' => 0,
60+
'File::Spec::Functions' => 0,
61+
'File::Temp' => 0,
62+
'FindBin' => 0,
63+
'Getopt::Long' => 0,
64+
'I18N::LangTags' => 0,
65+
'IO::File' => 0,
66+
'IO::Poll' => 0,
67+
'IO::Socket' => 0,
68+
'List::Util' => 0,
69+
'Locale::Maketext' => 0,
70+
'MIME::Base64' => 0,
71+
'MIME::QuotedPrint' => 0,
72+
'POSIX' => 0,
73+
'Scalar::Util' => 0,
74+
'Storable' => 0,
75+
'Sys::Hostname' => 0,
76+
'Test::Builder' => 0,
77+
'Test::Harness' => 0,
78+
'Test::More' => 0,
79+
'Time::HiRes' => 0
80+
},
81+
test => {TESTS => 't/*.t t/*/*.t'}
8282
);

README.pod

+96-96
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ art technology.
1212

1313
=head2 Features
1414

15-
=over 4
15+
=over 2
1616

1717
=item *
1818

1919
An amazing MVC web framework supporting a simplified single file mode through
2020
L<Mojolicious::Lite>.
2121

22-
=over 4
22+
=over 2
2323

2424
Powerful out of the box with RESTful routes, plugins, Perl-ish templates,
2525
session management, signed cookies, testing framework, static file server,
@@ -60,136 +60,136 @@ Fresh code based upon years of experience developing L<Catalyst>.
6060

6161
All you need is a oneliner.
6262

63-
sudo -s 'curl -L cpanmin.us | perl - Mojolicious'
63+
sudo -s 'curl -L cpanmin.us | perl - Mojolicious'
6464

6565
=head2 Duct Tape For The HTML5 Web
6666

6767
Web development for humans, making hard things possible and everything fun.
6868

69-
use Mojolicious::Lite;
70-
71-
# Simple route with plain text response
72-
get '/hello' => sub { shift->render(text => 'Hello World!') };
73-
74-
# Route to template in DATA section
75-
get '/time' => 'clock';
76-
77-
# RESTful web service sending JSON responses
78-
get '/:offset' => sub {
79-
my $self = shift;
80-
my $offset = $self->param('offset') || 23;
81-
$self->render(json => {list => [0 .. $offset]});
82-
};
83-
84-
# Scrape information from remote sites
85-
post '/title' => sub {
86-
my $self = shift;
87-
my $url = $self->param('url') || 'http://mojolicio.us';
88-
$self->render(text =>
89-
$self->client->get($url)->res->dom->at('head > title')->text);
90-
};
91-
92-
# WebSocket echo service
93-
websocket '/echo' => sub {
94-
my $self = shift;
95-
$self->on_message(sub {
96-
my ($self, $message) = @_;
97-
$self->send_message("echo: $message");
98-
});
99-
};
100-
101-
app->start;
102-
__DATA__
103-
104-
@@ clock.html.ep
105-
% my ($second, $minute, $hour) = (localtime(time))[0, 1, 2];
106-
<%= link_to clock => begin %>
107-
The time is <%= $hour %>:<%= $minute %>:<%= $second %>.
108-
<% end %>
69+
use Mojolicious::Lite;
70+
71+
# Simple route with plain text response
72+
get '/hello' => sub { shift->render(text => 'Hello World!') };
73+
74+
# Route to template in DATA section
75+
get '/time' => 'clock';
76+
77+
# RESTful web service sending JSON responses
78+
get '/:offset' => sub {
79+
my $self = shift;
80+
my $offset = $self->param('offset') || 23;
81+
$self->render(json => {list => [0 .. $offset]});
82+
};
83+
84+
# Scrape information from remote sites
85+
post '/title' => sub {
86+
my $self = shift;
87+
my $url = $self->param('url') || 'http://mojolicio.us';
88+
$self->render(text =>
89+
$self->client->get($url)->res->dom->at('head > title')->text);
90+
};
91+
92+
# WebSocket echo service
93+
websocket '/echo' => sub {
94+
my $self = shift;
95+
$self->on_message(sub {
96+
my ($self, $message) = @_;
97+
$self->send_message("echo: $message");
98+
});
99+
};
100+
101+
app->start;
102+
__DATA__
103+
104+
@@ clock.html.ep
105+
% my ($second, $minute, $hour) = (localtime(time))[0, 1, 2];
106+
<%= link_to clock => begin %>
107+
The time is <%= $hour %>:<%= $minute %>:<%= $second %>.
108+
<% end %>
109109

110110
=head2 Growing
111111

112112
Single file prototypes like the one above can easily grow into well
113113
structured applications.
114114

115-
package MyApp;
116-
use Mojo::Base 'Mojolicious';
115+
package MyApp;
116+
use Mojo::Base 'Mojolicious';
117117

118-
# Runs once on application startup
119-
sub startup {
120-
my $self = shift;
121-
my $r = $self->routes;
118+
# Runs once on application startup
119+
sub startup {
120+
my $self = shift;
121+
my $r = $self->routes;
122122

123-
# Route prefix for "MyApp::Example" controller
124-
my $example = $r->under('/example')->to('example#');
123+
# Route prefix for "MyApp::Example" controller
124+
my $example = $r->under('/example')->to('example#');
125125

126-
# GET routes connecting the controller prefix with actions
127-
$example->get('/hello')->to('#hello');
128-
$example->get('/time')->to('#clock');
129-
$example->get('/:offset')->to('#restful');
126+
# GET routes connecting the controller prefix with actions
127+
$example->get('/hello')->to('#hello');
128+
$example->get('/time')->to('#clock');
129+
$example->get('/:offset')->to('#restful');
130130

131-
# All common verbs are supported
132-
$example->post('/title')->to('#title');
131+
# All common verbs are supported
132+
$example->post('/title')->to('#title');
133133

134-
# And much more
135-
$r->websocket('/echo')->to('realtime#echo');
136-
}
134+
# And much more
135+
$r->websocket('/echo')->to('realtime#echo');
136+
}
137137

138-
1;
138+
1;
139139

140140
Bigger applications are a lot easier to maintain once routing information has
141141
been separated from action code, especially when working in teams.
142142

143-
package MyApp::Example;
144-
use Mojo::Base 'Mojolicious::Controller';
143+
package MyApp::Example;
144+
use Mojo::Base 'Mojolicious::Controller';
145145

146-
# Plain text response
147-
sub hello { shift->render(text => 'Hello World!') }
146+
# Plain text response
147+
sub hello { shift->render(text => 'Hello World!') }
148148

149-
# Render external template "templates/example/clock.html.ep"
150-
sub clock { shift->render }
149+
# Render external template "templates/example/clock.html.ep"
150+
sub clock { shift->render }
151151

152-
# RESTful web service sending JSON responses
153-
sub restful {
154-
my $self = shift;
155-
my $offset = $self->param('offset') || 23;
156-
$self->render(json => {list => [0 .. $offset]});
157-
}
152+
# RESTful web service sending JSON responses
153+
sub restful {
154+
my $self = shift;
155+
my $offset = $self->param('offset') || 23;
156+
$self->render(json => {list => [0 .. $offset]});
157+
}
158158

159-
# Scrape information from remote sites
160-
sub title {
161-
my $self = shift;
162-
my $url = $self->param('url') || 'http://mojolicio.us';
163-
$self->render(text =>
164-
$self->client->get($url)->res->dom->at('head > title')->text);
165-
}
159+
# Scrape information from remote sites
160+
sub title {
161+
my $self = shift;
162+
my $url = $self->param('url') || 'http://mojolicio.us';
163+
$self->render(text =>
164+
$self->client->get($url)->res->dom->at('head > title')->text);
165+
}
166166

167-
1;
167+
1;
168168

169169
While the application class is unique, you can have as many controllers as
170170
you like.
171171

172-
package MyApp::Realtime;
173-
use Mojo::Base 'Mojolicious::Controller';
172+
package MyApp::Realtime;
173+
use Mojo::Base 'Mojolicious::Controller';
174174

175-
# WebSocket echo service
176-
sub echo {
177-
my $self = shift;
178-
$self->on_message(sub {
179-
my ($self, $message) = @_;
180-
$self->send_message("echo: $message");
181-
});
182-
}
175+
# WebSocket echo service
176+
sub echo {
177+
my $self = shift;
178+
$self->on_message(sub {
179+
my ($self, $message) = @_;
180+
$self->send_message("echo: $message");
181+
});
182+
}
183183

184-
1;
184+
1;
185185

186186
Action code and templates can stay almost exactly the same, everything was
187187
designed from the ground up for this very unique and fun workflow.
188188

189-
% my ($second, $minute, $hour) = (localtime(time))[0, 1, 2];
190-
<%= link_to clock => begin %>
191-
The time is <%= $hour %>:<%= $minute %>:<%= $second %>.
192-
<% end %>
189+
% my ($second, $minute, $hour) = (localtime(time))[0, 1, 2];
190+
<%= link_to clock => begin %>
191+
The time is <%= $hour %>:<%= $minute %>:<%= $second %>.
192+
<% end %>
193193

194194
=head2 Want to know more?
195195

0 commit comments

Comments
 (0)