From 1862980572c4fa54d78a8be080f42634fd26d9d8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 3 Jun 2013 12:29:11 -0500 Subject: make a couple things private for now --- lib/Reply.pm | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/Reply.pm b/lib/Reply.pm index 699e808..d32ff05 100644 --- a/lib/Reply.pm +++ b/lib/Reply.pm @@ -22,7 +22,7 @@ sub new { if (defined $opts{config}) { print "Loading configuration from $opts{config}... "; - $self->load_config($opts{config}); + $self->_load_config($opts{config}); print "done\n"; } @@ -44,7 +44,23 @@ sub load_plugin { push @{ $self->{plugins} }, $plugin; } -sub load_config { +sub run { + my $self = shift; + + while (defined(my $line = $self->_read)) { + try { + my @result = $self->_eval($line); + $self->_print_result(@result); + } + catch { + $self->_print_error($_); + }; + $self->_loop; + } + print "\n"; +} + +sub _load_config { my $self = shift; my ($file) = @_; @@ -75,7 +91,7 @@ sub load_config { } } -sub plugins { +sub _plugins { my $self = shift; return ( @@ -84,22 +100,6 @@ sub plugins { ); } -sub run { - my $self = shift; - - while (defined(my $line = $self->_read)) { - try { - my @result = $self->_eval($line); - $self->_print_result(@result); - } - catch { - $self->_print_error($_); - }; - $self->_loop; - } - print "\n"; -} - sub _read { my $self = shift; @@ -149,7 +149,7 @@ sub _loop { sub _wrapped_plugin { my $self = shift; - my @plugins = ref($_[0]) ? @{ shift() } : $self->plugins; + my @plugins = ref($_[0]) ? @{ shift() } : $self->_plugins; my ($method, @args) = @_; @plugins = grep { $_->can($method) } @plugins; @@ -164,7 +164,7 @@ sub _wrapped_plugin { sub _chained_plugin { my $self = shift; - my @plugins = ref($_[0]) ? @{ shift() } : $self->plugins; + my @plugins = ref($_[0]) ? @{ shift() } : $self->_plugins; my ($method, @args) = @_; @plugins = grep { $_->can($method) } @plugins; -- cgit v1.2.3-54-g00ecf