| 1 | package API::Docker::Volume; | ||
| 2 | # ABSTRACT: Removed in 0.004 -- replaced by API::Docker::Type::Volume | ||
| 3 | our $VERSION = '0.006'; | ||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Carp qw( croak ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | # A removed class, kept as a stub on purpose (karr k92). A module that | ||
| 9 | # disappears from a distribution does not disappear from the disks it was | ||
| 10 | # installed on: the old file stays behind and keeps loading, so deleting it | ||
| 11 | # here would leave a working API::Docker::Volume shadowing this release for | ||
| 12 | # everyone who ever installed the last one. Shipping a file overwrites it; | ||
| 13 | # shipping nothing does not. | ||
| 14 | # | ||
| 15 | # It refuses instead of working, and it refuses at load rather than at the | ||
| 16 | # first method call, because that is the earliest point at which the caller | ||
| 17 | # can be told -- and because @Author::GETTY generates no compile-all author | ||
| 18 | # test that a dying module would fail. Measured on 2026-08-28: the bundle | ||
| 19 | # generates exactly xt/author/pod-syntax.t, which parses POD without loading | ||
| 20 | # anything, and xt/release/changes_has_content.t, which only reads Changes. | ||
| 21 | my $REFUSED = | ||
| 22 | __PACKAGE__ . ' was removed in API::Docker 0.004 and this file is a stub' | ||
| 23 | . ' with nothing in it: it ships only so that installing this' | ||
| 24 | . ' release overwrites the working copy an earlier one left on' | ||
| 25 | . ' disk. You have not hit a fault in the distribution. The' | ||
| 26 | . ' volumes the daemon answers with are' | ||
| 27 | . ' API::Docker::Type::Volume (volumes->list, volumes->inspect' | ||
| 28 | . ' and volumes->create), with the field names the swagger\'s own' | ||
| 29 | . ' in snake_case, and inspect and remove are unchanged on them,' | ||
| 30 | . ' composed in from API::Docker::Role::Entity::Volume. This' | ||
| 31 | . ' stub refuses'; | ||
| 32 | |||
| 33 | # The croak below is what a caller normally hits. AUTOLOAD is for the one who | ||
| 34 | # swallowed it -- eval { require API::Docker::Volume } and then called a | ||
| 35 | # method anyway; the answer has to be the same one, not a bare "Can't locate | ||
| 36 | # object method". DESTROY is defined so it does not reach AUTOLOAD. | ||
| 37 | 3 | ▶ | sub AUTOLOAD { croak $REFUSED } |
|
Subroutine
AUTOLOAD: called CC=1 SCAR=0.0
| |||
| 38 | 0 | ▶ | sub DESTROY { } |
|
Subroutine
DESTROY: not called CC=1 SCAR=0.0
| |||
| 39 | |||
| 40 | croak $REFUSED; | ||
| 41 | |||
| 42 | |||
| 43 | 1; | ||
| 44 | |||
| 45 | __END__ | ||