use Devel::REPL::Error;
has 'term' => (
- is => 'rw', required => 1,
+ is => 'rw',
default => sub { Term::ReadLine->new('Perl REPL') }
);
has 'prompt' => (
- is => 'rw', required => 1,
+ is => 'rw',
default => sub { '$ ' }
);
has 'out_fh' => (
- is => 'rw', required => 1, lazy => 1,
+ is => 'rw',
+ lazy => 1,
default => sub { shift->term->OUT || \*STDOUT; }
);
has 'exit_repl' => (
- is => 'rw', required => 1,
+ is => 'rw',
default => sub { 0 }
);
use vars qw($COMMAND_INSTALLER);
has 'command_set' => (
- is => 'ro', required => 1,
+ is => 'ro',
lazy => 1, default => sub { {} }
);
use namespace::autoclean;
has 'history' => (
- isa => 'ArrayRef', is => 'rw', required => 1, lazy => 1,
+ isa => 'ArrayRef', is => 'rw',
+ lazy => 1,
default => sub { [] }
);
# lazy so ReadLineHistory Plugin can set this
has 'have_readline_history' => (
- is => 'rw', required => 1, lazy => 1,
+ is => 'rw',
+ lazy => 1,
default => sub { 0 }
);
has 'lexical_environment' => (
isa => 'Lexical::Persistence',
is => 'rw',
- required => 1,
lazy => 1,
default => sub { Lexical::Persistence->new }
);
use namespace::autoclean;
has 'continuation_prompt' => (
- is => 'rw', required => 1, lazy => 1,
+ is => 'rw',
+ lazy => 1,
default => sub { '> ' }
);
has 'line_depth' => (
- is => 'rw', required => 1, lazy => 1,
+ is => 'rw',
+ lazy => 1,
default => sub { 0 }
);
with 'MooseX::Getopt';
has 'rcfile' => (
- is => 'ro', isa => 'Str', required => 1, default => sub { 'repl.rc' },
+ is => 'ro', isa => 'Str',
+ default => sub { 'repl.rc' },
);
has 'profile' => (
is => 'ro',
isa => 'Str',
- required => 1,
default => sub { $ENV{DEVEL_REPL_PROFILE} || 'Default' },
);
has '_repl' => (
- is => 'ro', isa => 'Devel::REPL', required => 1,
+ is => 'ro', isa => 'Devel::REPL',
default => sub { Devel::REPL->new() }
);