Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Accept HASHREF or list in constructor.

Addresses GH-1
  • Loading branch information...
commit a686f223b99bd5fbe591e0d71a5db9d142015b94 1 parent 62fcbf6
@throughnothing authored
Showing with 13 additions and 3 deletions.
  1. +4 −3 lib/Ubic/Service/Starman.pm
  2. +9 −0 t/01-basic.t
View
7 lib/Ubic/Service/Starman.pm
@@ -10,10 +10,11 @@ use base qw(Ubic::Service::Plack);
# ABSTRACT: Helper for running psgi applications with Starman
sub new {
- my ($class, %args ) = @_;
+ my $class = shift;
+ my $args = @_ > 1 ? { @_ } : $_[0];
- $args{server} = 'Starman';
- my $obj = $class->SUPER::new( %args );
+ $args->{server} = 'Starman';
+ my $obj = $class->SUPER::new( $args );
# Default pid file for starman
unless( $obj->{server_args}->{pid} ){
# Set a pid for the starman server if one is not already set,
View
9 t/01-basic.t
@@ -0,0 +1,9 @@
+use Test::More tests => 2;
+
+use Ubic::Service::Starman;
+
+# Test Hashref
+ok my $s = Ubic::Service::Starman->new({ app => "t/app.psgi", app_name => '2' });
+
+# Test List
+ok my $s2 = Ubic::Service::Starman->new( app => "t/app.psgi", app_name=> '2' );
Please sign in to comment.
Something went wrong with that request. Please try again.