25 |
25 |
26 plugin 'TagHelpers::BootstrapPagination'; |
26 plugin 'TagHelpers::BootstrapPagination'; |
27 |
27 |
28 app->attr(storage => sub { |
28 app->attr(storage => sub { |
29 my $self = shift; |
29 my $self = shift; |
30 eval "require $config->{Storage}->{Type}" or die "Loading module failed $@"; |
30 my $loader = Mojo::Loader->new; |
31 return $config->{Storage}->{Type}->new($config->{Storage}); |
31 |
|
32 my $storage_class = $self->app->config->{Storage}->{Type}; |
|
33 if (my $e = $loader->load($storage_class)) { |
|
34 die ref $e ? "Exception: $e" : 'Not found!'; |
|
35 } |
|
36 |
|
37 return $storage_class->new(config => $self->app->config->{Storage}); |
32 }); |
38 }); |
33 |
39 |
34 app->attr(decode_queue => sub { |
40 app->attr(decode_queue => sub { |
35 my $self = shift; |
41 my $self = shift; |
36 eval "require $config->{DecodeQueue}->{Type}" or die "Loading module failed $@"; |
42 my $loader = Mojo::Loader->new; |
37 return $config->{DecodeQueue}->{Type}->new($config->{DecodeQueue}, $config->{Dumper}, app->storage); |
43 |
|
44 my $decode_class = $self->app->config->{DecodeQueue}->{Type}; |
|
45 if (my $e = $loader->load($decode_class)) { |
|
46 die ref $e ? "Exception: $e" : 'Not found!'; |
|
47 } |
|
48 |
|
49 return $decode_class->new( |
|
50 config => $self->app->config->{DecodeQueue}, |
|
51 dumper_config => $self->app->config->{Dumper}, |
|
52 storage => $self->app->storage |
|
53 ); |
38 }); |
54 }); |
39 |
55 |
40 helper scm_file_link => sub { |
56 helper scm_file_link => sub { |
41 my ($self, $file, $line) = @_; |
57 my ($self, $file, $line) = @_; |
42 |
58 |