Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Miscellaneous fixes #2

Open
wants to merge 7 commits into from

2 participants

wu-lee Sawyer X
wu-lee

Hi,

Whilst studying the code, I noticed a few missing things, which I've attempted to fix in a handful of feature branches. I hope the intent is self-explanatory.

Thanks,

Nick

wu-lee added some commits
wu-lee Correct some mistakes in the POD example. f903eae
wu-lee Allow a string in error parameter to constructor, as documented 3ad0213
wu-lee Merge branch 'pod-corrections'
* pod-corrections:
  Correct some mistakes in the POD example.
e107ae4
wu-lee Merge branch 'allow-string-in-error-param'
* allow-string-in-error-param:
  Allow a string in error parameter to constructor, as documented
ee5f3a3
wu-lee Remove unused lexical '@optional' 391ef79
wu-lee Add overlooked 'options' parameter to POE::Component::Generic->spawn
This is documented, and an attribute is defined for it, but it was not
actually passed to POE::Component::Generic->spawn.
c2170d4
wu-lee Merge branch 'fix-option-param'
* fix-option-param:
  Add overlooked 'options' parameter to POE::Component::Generic->spawn
  Remove unused lexical '@optional'
f3e18ef
Sawyer X
Owner

Will merge soon, thank you!

Sawyer X
Owner

This is so crazy-long ago. I'm sorry for that delay.

Unfortunately, when I rebase these fixes from master, it shows they are only actually changing the Moose version of the code, which the latest version is not.

Are there any changes here I should cherry-pick onto the latest version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 30, 2011
  1. Correct some mistakes in the POD example.

    wu-lee authored
Commits on Sep 6, 2011
  1. Merge branch 'pod-corrections'

    wu-lee authored
    * pod-corrections:
      Correct some mistakes in the POD example.
  2. Merge branch 'allow-string-in-error-param'

    wu-lee authored
    * allow-string-in-error-param:
      Allow a string in error parameter to constructor, as documented
  3. Remove unused lexical '@optional'

    wu-lee authored
  4. Add overlooked 'options' parameter to POE::Component::Generic->spawn

    wu-lee authored
    This is documented, and an attribute is defined for it, but it was not
    actually passed to POE::Component::Generic->spawn.
  5. Merge branch 'fix-option-param'

    wu-lee authored
    * fix-option-param:
      Add overlooked 'options' parameter to POE::Component::Generic->spawn
      Remove unused lexical '@optional'
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 9 deletions.
  1. +10 −9 lib/POE/Component/OpenSSH.pm
19 lib/POE/Component/OpenSSH.pm
View
@@ -9,12 +9,12 @@ use Moose;
use Net::OpenSSH;
use POE::Component::Generic;
-has 'args' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] } );
-has 'options' => ( is => 'ro', isa => 'HashRef', default => sub { {} } );
-has 'error' => ( is => 'ro', isa => 'HashRef', default => sub { {} } );
-has 'alias' => ( is => 'ro', isa => 'Str', default => q{} );
-has 'debug' => ( is => 'ro', isa => 'Bool', default => 0 );
-has 'verbose' => ( is => 'ro', isa => 'Bool', default => 0 );
+has 'args' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] } );
+has 'options' => ( is => 'ro', isa => 'HashRef', default => sub { {} } );
+has 'error' => ( is => 'ro', isa => 'HashRef|Str', default => sub { {} } );
+has 'alias' => ( is => 'ro', isa => 'Str', default => q{} );
+has 'debug' => ( is => 'ro', isa => 'Bool', default => 0 );
+has 'verbose' => ( is => 'ro', isa => 'Bool', default => 0 );
has 'object' => (
is => 'rw',
@@ -26,7 +26,6 @@ has 'object' => (
sub _build_object {
my $self = shift;
- my @optional = ( qw( alias debug verbose options ) );
my $object = POE::Component::Generic->spawn(
alias => $self->alias,
package => 'Net::OpenSSH',
@@ -34,6 +33,7 @@ sub _build_object {
debug => $self->debug,
verbose => $self->verbose,
error => $self->error,
+ options => $self->options,
);
return $object;
@@ -95,6 +95,7 @@ Here is a more elaborate example using L<MooseX::POE>:
package Runner;
use MooseX::POE;
+ use POE::Component::Generic;
has 'host' => ( is => 'ro', isa => 'Str', default => 'localhost' );
has 'user' => ( is => 'ro', isa => 'Str', default => 'root' );
@@ -111,11 +112,11 @@ Here is a more elaborate example using L<MooseX::POE>:
],
);
- $ssh->capture( { event => 'parse_cmd' }, $cmd );
+ $ssh->capture( { event => 'parse_cmd' }, $self->cmd );
}
event 'parse_cmd' => sub {
- my ( $self, $output ) @_[ OBJECT, ARG1 ];
+ my ( $self, $output ) = @_[ OBJECT, ARG1 ];
my $host = $self->host;
print "[$host]: $output";
};
Something went wrong with that request. Please try again.