Skip to content

Commit

Permalink
improved routes command to show which routes are WebSockets and/or ha…
Browse files Browse the repository at this point in the history
…ve conditions
  • Loading branch information
kraih committed Feb 14, 2014
1 parent dc4e1f5 commit d50aa8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,6 +1,8 @@

4.81 2014-02-14
- Added direct array access for child nodes to Mojo::DOM.
- Improved routes command to show which routes are WebSockets and/or have
conditions.

4.80 2014-02-13
- Merged Mojo::DOM::Node into Mojo::DOM.
Expand Down
2 changes: 2 additions & 0 deletions lib/Mojolicious/Command/routes.pm
Expand Up @@ -25,10 +25,12 @@ sub _walk {
my $prefix = '';
if (my $i = $depth * 2) { $prefix .= ' ' x $i . '+' }
push @$rows, my $row = [$prefix . ($route->pattern->pattern || '/')];
$row->[-1] .= ' (~)' if $verbose && @{$route->over || []};

# Methods
my $via = $route->via;
push @$row, !$via ? '*' : uc join ',', @$via;
$row->[-1] .= ' (WS)' if $verbose && $route->is_websocket;

# Name
my $name = $route->name;
Expand Down

0 comments on commit d50aa8f

Please sign in to comment.