Commits

Toby Inkster  committed 7cb041d

stuff

  • Participants
  • Parent commits c088685

Comments (0)

Files changed (1)

File lib/Web/Paste/Simple.pm

 use 5.010;
 use MooX 'late';
 use JSON qw( from_json to_json );
-use Path::Class qw( file dir );
 use HTML::HTML5::Entities qw( encode_entities_numeric );
-use Text::Template;
+use constant read_only => 'ro';
+use aliased 'Text::Template';
 use aliased 'Data::UUID';
 use aliased 'Plack::Request';
 use aliased 'Plack::Response';
+use aliased 'Path::Class::Dir';
+use aliased 'Path::Class::File';
 
 BEGIN {
 	$Web::Paste::Simple::AUTHORITY = 'cpan:TOBYINK';
 }
 
 has uuid_gen => (
-	is      => 'ro',
+	is      => read_only,
+	isa     => UUID,
 	default => sub { UUID->new },
 );
 
 has template => (
-	is      => 'ro',
-	isa     => 'Text::Template',
+	is      => read_only,
+	isa     => Template,
 	lazy    => 1,
 	default => sub {
-		return Text::Template->new(
+		return Template->new(
 			TYPE   => 'FILEHANDLE',
 			SOURCE => \*DATA,
 		);
 );
 
 has storage => (
-	is      => 'ro',
-	isa     => 'Path::Class::Dir',
-	default => sub { dir('/tmp/perl-web-paste-simple/') },
+	is      => read_only,
+	isa     => Dir,
+	default => sub { Dir->new('/tmp/perl-web-paste-simple/') },
 );
 
 has codemirror => (
-	is      => 'ro',
+	is      => read_only,
 	isa     => 'Str',
 	default => 'http://buzzword.org.uk/2012/codemirror-2.36',
 );
 
 has app => (
-	is      => 'ro',
+	is      => read_only,
 	isa     => 'CodeRef',
 	lazy_build => 1,
 );
 
 has modes => (
-	is      => 'ro',
+	is      => read_only,
 	isa     => 'ArrayRef[Str]',
 	default => sub {
 		[qw(
 );
 
 has default_mode => (
-	is      => 'ro',
+	is      => read_only,
 	isa     => 'Str',
 	default => 'perl',
 );
 }
 <form action="/" method="post">
 	<div>
-		<textarea name="paste">{$DATA}</textarea>
-		<br>
 		<select name="mode" onchange="change_mode();">
 			{
 				for my $m (@MODES) {
 			}
 		</select>
 		<input type="submit" value=" Paste ">
+		<br>
+		<textarea name="paste">{$DATA}</textarea>
 	</div>
 </form>
 <script>