@@ -369,26 +369,7 @@ Optional. A hash of resource groups, each of them corresponding to a
369
369
directory in the "resource" directory in the distribution. Each resource
370
370
group has a name and a list of files that are provided. During installation
371
371
the installer will install these into a location, and make the files available
372
- through the %?RESOURCE hash. So, for example:
373
-
374
- "resource" : {
375
- "images" : {
376
- "fido.png"
377
- }
378
- }
379
-
380
- would assume there is a file C<resource/images/fido.png>. After installation,
381
- the path of that file would be available through
382
-
383
- %?RESOURCE<images><fido.png>.path
384
-
385
- and a handle could be obtained with:
386
-
387
- %?RESOURCE<images><fido.png>.IO
388
-
389
- without there being any guarantee that this path has anything to do with the
390
- path as specified in the distribution. Please also note that the installer
391
- may mangle filenames of actually installed files.
372
+ through the L</%?RESOURCE> hash.
392
373
393
374
=head3 support
394
375
@@ -524,7 +505,15 @@ will be assumed. So:
524
505
inst:/installed,/also both use CURL::Installation
525
506
/foo/bar,inst:/installed first CURL::File, second CURL::Installation
526
507
527
- =head2 new
508
+ =head3 parse-spec
509
+
510
+ my @repo-specs = CompUnitRepo.parse-spec( $string );
511
+
512
+ This helper method returns a C<List> of C<Parcel>s, in which the first element
513
+ contains the L</short-id>, the second contains a C<Hash> of the optional
514
+ named parameters, and the third contains the location string.
515
+
516
+ =head3 new
528
517
529
518
my $repo = CompUnitRepo.new( $specification );
530
519
@@ -544,7 +533,7 @@ The following C<short-id>'s are pre-defined:
544
533
file CompUnitRepo::Local::File
545
534
inst CompUnitRepo::Local::Installation
546
535
547
- =head2 install
536
+ =head3 install
548
537
549
538
my $installed = $repo.install( $something );
550
539
@@ -598,9 +587,9 @@ the C<META6.json> file of a distribution.
598
587
599
588
=head3 new
600
589
601
- my $dist = Distribution( 'HTML-Template-1.20.tar.gz' );
590
+ my $dist = Distribution.new ( 'HTML-Template-1.20.tar.gz' );
602
591
603
- my $dist = Distribution( '.unpacked/HTML-Template-1.20' );
592
+ my $dist = Distribution.new ( '.unpacked/HTML-Template-1.20' );
604
593
605
594
Create object from distribution file, or from an already unpacked distribution.
606
595
@@ -620,6 +609,37 @@ if something went wrong.
620
609
621
610
Several dynamic variables are available.
622
611
612
+ =head2 %?RESOURCE
613
+
614
+ This hash provides compile and runtime access to files associated with the
615
+ L</Distribution> of the current compilation unit.
616
+
617
+ So, if the C<META6.json> file contains this C<resource> section:
618
+
619
+ "resource" : {
620
+ "images" : {
621
+ "fido.png"
622
+ }
623
+ }
624
+
625
+ then the C<Distribution> is supposed to contain a file
626
+ C<resource/images/fido.png>. After installation, the path of that file would
627
+ be available through
628
+
629
+ %?RESOURCE<images><fido.png>.path
630
+
631
+ and a handle could be obtained with:
632
+
633
+ %?RESOURCE<images><fido.png>.IO
634
+
635
+ without there being any guarantee that this path has anything to do with the
636
+ path as specified in the distribution. Please also note that the installer
637
+ may mangle filenames of actually installed files.
638
+
639
+ This means you can have files with unicode characters in upper/lower case,
640
+ and still be able to access them when installed on a file system that does
641
+ not support unicode.
642
+
623
643
=head2 %*CUSTOM_LIB
624
644
625
645
This hash provides key/value pairs of C<CompUnitRepo> specifications, to be
0 commit comments