Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Accept HASHREF or list in constructor.

Addresses GH-1
  • Loading branch information...
commit bffa6b473ec91446492ce2ccf35ae07410036ed4 1 parent 62fcbf6
William Wolf authored

Showing 2 changed files with 21 additions and 3 deletions. Show diff stats Hide diff stats

  1. +4 3 lib/Ubic/Service/Starman.pm
  2. +17 0 t/01-basic.t
7 lib/Ubic/Service/Starman.pm
@@ -10,10 +10,11 @@ use base qw(Ubic::Service::Plack);
10 10 # ABSTRACT: Helper for running psgi applications with Starman
11 11
12 12 sub new {
13   - my ($class, %args ) = @_;
  13 + my $class = shift;
  14 + my $args = @_ > 1 ? { @_ } : $_[0];
14 15
15   - $args{server} = 'Starman';
16   - my $obj = $class->SUPER::new( %args );
  16 + $args->{server} = 'Starman';
  17 + my $obj = $class->SUPER::new( $args );
17 18 # Default pid file for starman
18 19 unless( $obj->{server_args}->{pid} ){
19 20 # Set a pid for the starman server if one is not already set,
17 t/01-basic.t
... ... @@ -0,0 +1,17 @@
  1 +use Test::More;
  2 +
  3 +use Ubic::Service::Starman;
  4 +
  5 +# Test Hashref
  6 +ok my $s = Ubic::Service::Starman->new({
  7 + app => "t/app.psgi",
  8 + app_name => 'test_app',
  9 +});
  10 +
  11 +# Test List
  12 +ok my $s = Ubic::Service::Starman->new(
  13 + app => "t/app.psgi",
  14 + app_name => 'test_app',
  15 +);
  16 +
  17 +done_testing;

0 comments on commit bffa6b4

Please sign in to comment.
Something went wrong with that request. Please try again.