Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Accept HASHREF or list in constructor.

Addresses GH-1
  • Loading branch information...
commit bffa6b473ec91446492ce2ccf35ae07410036ed4 1 parent 62fcbf6
@throughnothing authored
Showing with 21 additions and 3 deletions.
  1. +4 −3 lib/Ubic/Service/Starman.pm
  2. +17 −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
17 t/01-basic.t
@@ -0,0 +1,17 @@
+use Test::More;
+
+use Ubic::Service::Starman;
+
+# Test Hashref
+ok my $s = Ubic::Service::Starman->new({
+ app => "t/app.psgi",
+ app_name => 'test_app',
+});
+
+# Test List
+ok my $s = Ubic::Service::Starman->new(
+ app => "t/app.psgi",
+ app_name => 'test_app',
+);
+
+done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.