Codebase list libparams-validate-perl / f07b449
Imported Upstream version 1.21 Lucas Kanashiro 8 years ago
22 changed file(s) with 175 addition(s) and 590 deletion(s). Raw diff Collapse all Expand all
1919 "Ilya Martynov <ilya\@martynov.org>"
2020 ],
2121 "dist_name" => "Params-Validate",
22 "dist_version" => "1.20",
22 "dist_version" => "1.21",
2323 "license" => "artistic_2",
2424 "module_name" => "Params::Validate",
2525 "recommends" => {},
2626 "recursive_test_files" => 1,
2727 "requires" => {
28 "Attribute::Handlers" => "0.79",
2928 "Carp" => 0,
3029 "Exporter" => 0,
3130 "Module::Implementation" => 0,
3231 "Scalar::Util" => "1.10",
3332 "XSLoader" => 0,
34 "attributes" => 0,
3533 "perl" => "5.008001",
3634 "strict" => 0,
3735 "vars" => 0,
0 1.21 2015-07-18
1
2 - Attribute::Params::Validate is now in its own distro, and needs a new
3 maintainer. If you would like to maintain it, please contact me.
4
5
06 1.20 2015-06-28
17
28 - Fixed a bug with stack handling in the XS code. If a callback sub caused
1212 cpanfile
1313 dist.ini
1414 inc/MyModuleBuild.pm
15 lib/Attribute/Params/Validate.pm
1615 lib/Params/Validate.pm
1716 lib/Params/Validate/Constants.pm
1817 lib/Params/Validate/PP.pm
2625 t/00-report-prereqs.t
2726 t/01-validate.t
2827 t/02-noop.t
29 t/03-attribute.t
3028 t/04-defaults.t
3129 t/05-noop_default.t
3230 t/06-options.t
8078 t/release-portability.t
8179 t/release-pp-01-validate.t
8280 t/release-pp-02-noop.t
83 t/release-pp-03-attribute.t
8481 t/release-pp-04-defaults.t
8582 t/release-pp-05-noop_default.t
8683 t/release-pp-06-options.t
4141 "Test::NoTabs" : "0",
4242 "Test::Pod" : "1.41",
4343 "Test::Pod::Coverage" : "1.08",
44 "Test::Pod::LinkCheck" : "0",
45 "Test::Pod::No404s" : "0",
4446 "Test::Spelling" : "0.12",
4547 "Test::Synopsis" : "0",
4648 "Test::Taint" : "0.02"
4850 },
4951 "runtime" : {
5052 "requires" : {
51 "Attribute::Handlers" : "0.79",
5253 "Carp" : "0",
5354 "Exporter" : "0",
5455 "Module::Implementation" : "0",
5556 "Scalar::Util" : "1.10",
5657 "XSLoader" : "0",
57 "attributes" : "0",
5858 "perl" : "5.008001",
5959 "strict" : "0",
6060 "vars" : "0",
8282 }
8383 },
8484 "provides" : {
85 "Attribute::Params::Validate" : {
86 "file" : "lib/Attribute/Params/Validate.pm",
87 "version" : "1.20"
88 },
8985 "Params::Validate" : {
9086 "file" : "lib/Params/Validate.pm",
91 "version" : "1.20"
87 "version" : "1.21"
9288 },
9389 "Params::Validate::Constants" : {
9490 "file" : "lib/Params/Validate/Constants.pm",
95 "version" : "1.20"
91 "version" : "1.21"
9692 },
9793 "Params::Validate::PP" : {
9894 "file" : "lib/Params/Validate/PP.pm",
99 "version" : "1.20"
95 "version" : "1.21"
10096 },
10197 "Params::Validate::XS" : {
10298 "file" : "lib/Params/Validate/XS.pm",
103 "version" : "1.20"
99 "version" : "1.21"
104100 }
105101 },
106102 "release_status" : "stable",
116112 "web" : "https://github.com/autarch/Params-Validate"
117113 }
118114 },
119 "version" : "1.20",
115 "version" : "1.21",
120116 "x_Dist_Zilla" : {
121117 "perl" : {
122 "version" : "5.020001"
118 "version" : "5.022000"
123119 },
124120 "plugins" : [
125121 {
142138 "config" : {
143139 "Dist::Zilla::Plugin::GatherDir" : {
144140 "exclude_filename" : [
141 "Build.PL",
142 "LICENSE",
145143 "README.md",
146144 "cpanfile",
147 "LICENSE",
148 "Makefile.PL",
149 "Build.PL"
145 "Makefile.PL"
150146 ],
151147 "exclude_match" : [],
152148 "follow_symlinks" : "0",
156152 "root" : "."
157153 },
158154 "Dist::Zilla::Plugin::Git::GatherDir" : {
159 "include_untracked" : "0"
155 "include_untracked" : 0
160156 }
161157 },
162158 "name" : "@DROLSKY/Git::GatherDir",
163 "version" : "2.035"
159 "version" : "2.036"
164160 },
165161 {
166162 "class" : "Dist::Zilla::Plugin::GitHub::Meta",
245241 },
246242 {
247243 "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
244 "config" : {
245 "Dist::Zilla::Role::FileWatcher" : {
246 "version" : "0.006"
247 }
248 },
248249 "name" : "@DROLSKY/README.md in build",
249250 "version" : "0.150250"
250251 },
251252 {
252253 "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
254 "config" : {
255 "Dist::Zilla::Role::FileWatcher" : {
256 "version" : "0.006"
257 }
258 },
253259 "name" : "@DROLSKY/README.md in root",
254260 "version" : "0.150250"
255261 },
336342 {
337343 "class" : "Dist::Zilla::Plugin::DROLSKY::Contributors",
338344 "name" : "@DROLSKY/DROLSKY::Contributors",
339 "version" : "0.34"
345 "version" : "0.36"
340346 },
341347 {
342348 "class" : "Dist::Zilla::Plugin::DROLSKY::License",
343349 "name" : "@DROLSKY/DROLSKY::License",
344 "version" : "0.34"
350 "version" : "0.36"
345351 },
346352 {
347353 "class" : "Dist::Zilla::Plugin::DROLSKY::TidyAll",
348354 "name" : "@DROLSKY/DROLSKY::TidyAll",
349 "version" : "0.34"
355 "version" : "0.36"
350356 },
351357 {
352358 "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch",
372378 "class" : "Dist::Zilla::Plugin::Git::Contributors",
373379 "config" : {
374380 "Dist::Zilla::Plugin::Git::Contributors" : {
375 "include_authors" : "0",
376 "include_releaser" : "1",
381 "include_authors" : 0,
382 "include_releaser" : 1,
377383 "order_by" : "name",
378 "paths" : []
384 "paths" : [
385 "."
386 ]
379387 }
380388 },
381389 "name" : "@DROLSKY/Git::Contributors",
382 "version" : "0.011"
390 "version" : "0.012"
383391 },
384392 {
385393 "class" : "Dist::Zilla::Plugin::InstallGuide",
418426 {
419427 "class" : "Pod::Weaver::Plugin::EnsurePod5",
420428 "name" : "@CorePrep/EnsurePod5",
421 "version" : "4.010"
429 "version" : "4.012"
422430 },
423431 {
424432 "class" : "Pod::Weaver::Plugin::H1Nester",
425433 "name" : "@CorePrep/H1Nester",
426 "version" : "4.010"
434 "version" : "4.012"
427435 },
428436 {
429437 "class" : "Pod::Weaver::Section::Name",
430438 "name" : "Name",
431 "version" : "4.010"
439 "version" : "4.012"
432440 },
433441 {
434442 "class" : "Pod::Weaver::Section::Version",
435443 "name" : "Version",
436 "version" : "4.010"
444 "version" : "4.012"
437445 },
438446 {
439447 "class" : "Pod::Weaver::Section::Region",
440448 "name" : "prelude",
441 "version" : "4.010"
449 "version" : "4.012"
442450 },
443451 {
444452 "class" : "Pod::Weaver::Section::Generic",
445453 "name" : "SYNOPSIS",
446 "version" : "4.010"
454 "version" : "4.012"
447455 },
448456 {
449457 "class" : "Pod::Weaver::Section::Generic",
450458 "name" : "DESCRIPTION",
451 "version" : "4.010"
459 "version" : "4.012"
452460 },
453461 {
454462 "class" : "Pod::Weaver::Section::Leftovers",
455463 "name" : "Leftovers",
456 "version" : "4.010"
464 "version" : "4.012"
457465 },
458466 {
459467 "class" : "Pod::Weaver::Section::Region",
460468 "name" : "postlude",
461 "version" : "4.010"
469 "version" : "4.012"
462470 },
463471 {
464472 "class" : "Pod::Weaver::Section::Authors",
465473 "name" : "Authors",
466 "version" : "4.010"
474 "version" : "4.012"
467475 },
468476 {
469477 "class" : "Pod::Weaver::Section::Contributors",
473481 {
474482 "class" : "Pod::Weaver::Section::Legal",
475483 "name" : "Legal",
476 "version" : "4.010"
484 "version" : "4.012"
477485 }
478486 ]
479487 }
523531 "version" : "0.15"
524532 },
525533 {
526 "class" : "Dist::Zilla::Plugin::Test::Pod::LinkCheck",
527 "name" : "@DROLSKY/Test::Pod::LinkCheck",
528 "version" : "1.001"
529 },
530 {
531 "class" : "Dist::Zilla::Plugin::Test::Pod::No404s",
532 "name" : "@DROLSKY/Test::Pod::No404s",
533 "version" : "1.001"
534 },
535 {
536534 "class" : "Dist::Zilla::Plugin::Test::Portability",
537535 "name" : "@DROLSKY/Test::Portability",
538536 "version" : "2.000006"
572570 },
573571 "Dist::Zilla::Role::Git::DirtyFiles" : {
574572 "allow_dirty" : [
575 "README.md",
576 "cpanfile",
573 "Build.PL",
574 "CONTRIBUTING.md",
575 "Changes",
577576 "LICENSE",
578577 "Makefile.PL",
579 "Build.PL",
580 "Changes",
581 "CONTRIBUTING.md"
578 "README.md",
579 "cpanfile"
582580 ],
583581 "allow_dirty_match" : [],
584582 "changelog" : "Changes"
588586 }
589587 },
590588 "name" : "@DROLSKY/Git::Check",
591 "version" : "2.035"
589 "version" : "2.036"
592590 },
593591 {
594592 "class" : "Dist::Zilla::Plugin::Git::Commit",
595593 "config" : {
596594 "Dist::Zilla::Plugin::Git::Commit" : {
597595 "add_files_in" : [],
598 "commit_msg" : "v%v%n%n%c",
599 "time_zone" : "local"
596 "commit_msg" : "v%v%n%n%c"
600597 },
601598 "Dist::Zilla::Role::Git::DirtyFiles" : {
602599 "allow_dirty" : [
603 "README.md",
604 "cpanfile",
600 "Build.PL",
601 "CONTRIBUTING.md",
602 "Changes",
605603 "LICENSE",
606604 "Makefile.PL",
607 "Build.PL",
608 "Changes",
609 "CONTRIBUTING.md"
605 "README.md",
606 "cpanfile"
610607 ],
611608 "allow_dirty_match" : [],
612609 "changelog" : "Changes"
613610 },
614611 "Dist::Zilla::Role::Git::Repo" : {
615612 "repo_root" : "."
613 },
614 "Dist::Zilla::Role::Git::StringFormatter" : {
615 "time_zone" : "local"
616616 }
617617 },
618618 "name" : "@DROLSKY/commit generated files",
619 "version" : "2.035"
619 "version" : "2.036"
620620 },
621621 {
622622 "class" : "Dist::Zilla::Plugin::Git::Tag",
623623 "config" : {
624624 "Dist::Zilla::Plugin::Git::Tag" : {
625625 "branch" : null,
626 "changelog" : "Changes",
626627 "signed" : 0,
627 "tag" : "v1.20",
628 "tag" : "v1.21",
628629 "tag_format" : "v%v",
629 "tag_message" : "v%v",
630 "time_zone" : "local"
630 "tag_message" : "v%v"
631631 },
632632 "Dist::Zilla::Role::Git::Repo" : {
633633 "repo_root" : "."
634 },
635 "Dist::Zilla::Role::Git::StringFormatter" : {
636 "time_zone" : "local"
634637 }
635638 },
636639 "name" : "@DROLSKY/Git::Tag",
637 "version" : "2.035"
640 "version" : "2.036"
638641 },
639642 {
640643 "class" : "Dist::Zilla::Plugin::Git::Push",
650653 }
651654 },
652655 "name" : "@DROLSKY/Git::Push",
653 "version" : "2.035"
656 "version" : "2.036"
654657 },
655658 {
656659 "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease",
662665 "config" : {
663666 "Dist::Zilla::Plugin::Git::Commit" : {
664667 "add_files_in" : [],
665 "commit_msg" : "Bump version after release",
666 "time_zone" : "local"
668 "commit_msg" : "Bump version after release"
667669 },
668670 "Dist::Zilla::Role::Git::DirtyFiles" : {
669671 "allow_dirty" : [
670 "dist.ini",
671 "Changes"
672 "Changes",
673 "dist.ini"
672674 ],
673675 "allow_dirty_match" : [
674676 "(?^:.+)"
677679 },
678680 "Dist::Zilla::Role::Git::Repo" : {
679681 "repo_root" : "."
682 },
683 "Dist::Zilla::Role::Git::StringFormatter" : {
684 "time_zone" : "local"
680685 }
681686 },
682687 "name" : "@DROLSKY/commit version bump",
683 "version" : "2.035"
688 "version" : "2.036"
684689 },
685690 {
686691 "class" : "Dist::Zilla::Plugin::Git::Push",
696701 }
697702 },
698703 "name" : "@DROLSKY/push version bump",
699 "version" : "2.035"
704 "version" : "2.036"
705 },
706 {
707 "class" : "Dist::Zilla::Plugin::Test::Pod::LinkCheck",
708 "name" : "@DROLSKY/Test::Pod::LinkCheck",
709 "version" : "1.002"
710 },
711 {
712 "class" : "Dist::Zilla::Plugin::Test::Pod::No404s",
713 "name" : "@DROLSKY/Test::Pod::No404s",
714 "version" : "1.002"
700715 },
701716 {
702717 "class" : "Dist::Zilla::Plugin::Prereqs",
2626 version: '1.4'
2727 name: Params-Validate
2828 provides:
29 Attribute::Params::Validate:
30 file: lib/Attribute/Params/Validate.pm
31 version: '1.20'
3229 Params::Validate:
3330 file: lib/Params/Validate.pm
34 version: '1.20'
31 version: '1.21'
3532 Params::Validate::Constants:
3633 file: lib/Params/Validate/Constants.pm
37 version: '1.20'
34 version: '1.21'
3835 Params::Validate::PP:
3936 file: lib/Params/Validate/PP.pm
40 version: '1.20'
37 version: '1.21'
4138 Params::Validate::XS:
4239 file: lib/Params/Validate/XS.pm
43 version: '1.20'
40 version: '1.21'
4441 requires:
45 Attribute::Handlers: '0.79'
4642 Carp: '0'
4743 Exporter: '0'
4844 Module::Implementation: '0'
4945 Scalar::Util: '1.10'
5046 XSLoader: '0'
51 attributes: '0'
5247 perl: '5.008001'
5348 strict: '0'
5449 vars: '0'
5752 bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Params-Validate
5853 homepage: http://metacpan.org/release/Params-Validate
5954 repository: git://github.com/autarch/Params-Validate.git
60 version: '1.20'
55 version: '1.21'
6156 x_Dist_Zilla:
6257 perl:
63 version: '5.020001'
58 version: '5.022000'
6459 plugins:
6560 -
6661 class: Dist::Zilla::Plugin::Authority
7974 config:
8075 Dist::Zilla::Plugin::GatherDir:
8176 exclude_filename:
77 - Build.PL
78 - LICENSE
8279 - README.md
8380 - cpanfile
84 - LICENSE
8581 - Makefile.PL
86 - Build.PL
8782 exclude_match: []
8883 follow_symlinks: '0'
8984 include_dotfiles: '0'
9186 prune_directory: []
9287 root: .
9388 Dist::Zilla::Plugin::Git::GatherDir:
94 include_untracked: '0'
89 include_untracked: 0
9590 name: '@DROLSKY/Git::GatherDir'
96 version: '2.035'
91 version: '2.036'
9792 -
9893 class: Dist::Zilla::Plugin::GitHub::Meta
9994 name: '@DROLSKY/GitHub::Meta'
157152 version: '0.045'
158153 -
159154 class: Dist::Zilla::Plugin::ReadmeAnyFromPod
155 config:
156 Dist::Zilla::Role::FileWatcher:
157 version: '0.006'
160158 name: '@DROLSKY/README.md in build'
161159 version: '0.150250'
162160 -
163161 class: Dist::Zilla::Plugin::ReadmeAnyFromPod
162 config:
163 Dist::Zilla::Role::FileWatcher:
164 version: '0.006'
164165 name: '@DROLSKY/README.md in root'
165166 version: '0.150250'
166167 -
230231 -
231232 class: Dist::Zilla::Plugin::DROLSKY::Contributors
232233 name: '@DROLSKY/DROLSKY::Contributors'
233 version: '0.34'
234 version: '0.36'
234235 -
235236 class: Dist::Zilla::Plugin::DROLSKY::License
236237 name: '@DROLSKY/DROLSKY::License'
237 version: '0.34'
238 version: '0.36'
238239 -
239240 class: Dist::Zilla::Plugin::DROLSKY::TidyAll
240241 name: '@DROLSKY/DROLSKY::TidyAll'
241 version: '0.34'
242 version: '0.36'
242243 -
243244 class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch
244245 config:
257258 class: Dist::Zilla::Plugin::Git::Contributors
258259 config:
259260 Dist::Zilla::Plugin::Git::Contributors:
260 include_authors: '0'
261 include_releaser: '1'
261 include_authors: 0
262 include_releaser: 1
262263 order_by: name
263 paths: []
264 paths:
265 - .
264266 name: '@DROLSKY/Git::Contributors'
265 version: '0.011'
267 version: '0.012'
266268 -
267269 class: Dist::Zilla::Plugin::InstallGuide
268270 name: '@DROLSKY/InstallGuide'
294296 -
295297 class: Pod::Weaver::Plugin::EnsurePod5
296298 name: '@CorePrep/EnsurePod5'
297 version: '4.010'
299 version: '4.012'
298300 -
299301 class: Pod::Weaver::Plugin::H1Nester
300302 name: '@CorePrep/H1Nester'
301 version: '4.010'
303 version: '4.012'
302304 -
303305 class: Pod::Weaver::Section::Name
304306 name: Name
305 version: '4.010'
307 version: '4.012'
306308 -
307309 class: Pod::Weaver::Section::Version
308310 name: Version
309 version: '4.010'
311 version: '4.012'
310312 -
311313 class: Pod::Weaver::Section::Region
312314 name: prelude
313 version: '4.010'
315 version: '4.012'
314316 -
315317 class: Pod::Weaver::Section::Generic
316318 name: SYNOPSIS
317 version: '4.010'
319 version: '4.012'
318320 -
319321 class: Pod::Weaver::Section::Generic
320322 name: DESCRIPTION
321 version: '4.010'
323 version: '4.012'
322324 -
323325 class: Pod::Weaver::Section::Leftovers
324326 name: Leftovers
325 version: '4.010'
327 version: '4.012'
326328 -
327329 class: Pod::Weaver::Section::Region
328330 name: postlude
329 version: '4.010'
331 version: '4.012'
330332 -
331333 class: Pod::Weaver::Section::Authors
332334 name: Authors
333 version: '4.010'
335 version: '4.012'
334336 -
335337 class: Pod::Weaver::Section::Contributors
336338 name: Contributors
338340 -
339341 class: Pod::Weaver::Section::Legal
340342 name: Legal
341 version: '4.010'
343 version: '4.012'
342344 name: '@DROLSKY/SurgicalPodWeaver'
343345 version: '0.0023'
344346 -
372374 - ':TestFiles'
373375 name: '@DROLSKY/Test::NoTabs'
374376 version: '0.15'
375 -
376 class: Dist::Zilla::Plugin::Test::Pod::LinkCheck
377 name: '@DROLSKY/Test::Pod::LinkCheck'
378 version: '1.001'
379 -
380 class: Dist::Zilla::Plugin::Test::Pod::No404s
381 name: '@DROLSKY/Test::Pod::No404s'
382 version: '1.001'
383377 -
384378 class: Dist::Zilla::Plugin::Test::Portability
385379 name: '@DROLSKY/Test::Portability'
412406 untracked_files: die
413407 Dist::Zilla::Role::Git::DirtyFiles:
414408 allow_dirty:
409 - Build.PL
410 - CONTRIBUTING.md
411 - Changes
412 - LICENSE
413 - Makefile.PL
415414 - README.md
416415 - cpanfile
417 - LICENSE
418 - Makefile.PL
419 - Build.PL
420 - Changes
421 - CONTRIBUTING.md
422416 allow_dirty_match: []
423417 changelog: Changes
424418 Dist::Zilla::Role::Git::Repo:
425419 repo_root: .
426420 name: '@DROLSKY/Git::Check'
427 version: '2.035'
421 version: '2.036'
428422 -
429423 class: Dist::Zilla::Plugin::Git::Commit
430424 config:
431425 Dist::Zilla::Plugin::Git::Commit:
432426 add_files_in: []
433427 commit_msg: v%v%n%n%c
434 time_zone: local
435428 Dist::Zilla::Role::Git::DirtyFiles:
436429 allow_dirty:
430 - Build.PL
431 - CONTRIBUTING.md
432 - Changes
433 - LICENSE
434 - Makefile.PL
437435 - README.md
438436 - cpanfile
439 - LICENSE
440 - Makefile.PL
441 - Build.PL
442 - Changes
443 - CONTRIBUTING.md
444437 allow_dirty_match: []
445438 changelog: Changes
446439 Dist::Zilla::Role::Git::Repo:
447440 repo_root: .
441 Dist::Zilla::Role::Git::StringFormatter:
442 time_zone: local
448443 name: '@DROLSKY/commit generated files'
449 version: '2.035'
444 version: '2.036'
450445 -
451446 class: Dist::Zilla::Plugin::Git::Tag
452447 config:
453448 Dist::Zilla::Plugin::Git::Tag:
454449 branch: ~
450 changelog: Changes
455451 signed: 0
456 tag: v1.20
452 tag: v1.21
457453 tag_format: v%v
458454 tag_message: v%v
455 Dist::Zilla::Role::Git::Repo:
456 repo_root: .
457 Dist::Zilla::Role::Git::StringFormatter:
459458 time_zone: local
460 Dist::Zilla::Role::Git::Repo:
461 repo_root: .
462459 name: '@DROLSKY/Git::Tag'
463 version: '2.035'
460 version: '2.036'
464461 -
465462 class: Dist::Zilla::Plugin::Git::Push
466463 config:
471468 Dist::Zilla::Role::Git::Repo:
472469 repo_root: .
473470 name: '@DROLSKY/Git::Push'
474 version: '2.035'
471 version: '2.036'
475472 -
476473 class: Dist::Zilla::Plugin::BumpVersionAfterRelease
477474 name: '@DROLSKY/BumpVersionAfterRelease'
482479 Dist::Zilla::Plugin::Git::Commit:
483480 add_files_in: []
484481 commit_msg: 'Bump version after release'
485 time_zone: local
486482 Dist::Zilla::Role::Git::DirtyFiles:
487483 allow_dirty:
484 - Changes
488485 - dist.ini
489 - Changes
490486 allow_dirty_match:
491487 - (?^:.+)
492488 changelog: Changes
493489 Dist::Zilla::Role::Git::Repo:
494490 repo_root: .
491 Dist::Zilla::Role::Git::StringFormatter:
492 time_zone: local
495493 name: '@DROLSKY/commit version bump'
496 version: '2.035'
494 version: '2.036'
497495 -
498496 class: Dist::Zilla::Plugin::Git::Push
499497 config:
504502 Dist::Zilla::Role::Git::Repo:
505503 repo_root: .
506504 name: '@DROLSKY/push version bump'
507 version: '2.035'
505 version: '2.036'
506 -
507 class: Dist::Zilla::Plugin::Test::Pod::LinkCheck
508 name: '@DROLSKY/Test::Pod::LinkCheck'
509 version: '1.002'
510 -
511 class: Dist::Zilla::Plugin::Test::Pod::No404s
512 name: '@DROLSKY/Test::Pod::No404s'
513 version: '1.002'
508514 -
509515 class: Dist::Zilla::Plugin::Prereqs
510516 config:
33
44 VERSION
55
6 version 1.20
6 version 1.21
77
88 SYNOPSIS
99
0 requires "Attribute::Handlers" => "0.79";
10 requires "Carp" => "0";
21 requires "Exporter" => "0";
32 requires "Module::Implementation" => "0";
43 requires "Scalar::Util" => "1.10";
54 requires "XSLoader" => "0";
6 requires "attributes" => "0";
75 requires "perl" => "5.008001";
86 requires "strict" => "0";
97 requires "vars" => "0";
5250 requires "Test::NoTabs" => "0";
5351 requires "Test::Pod" => "1.41";
5452 requires "Test::Pod::Coverage" => "1.08";
53 requires "Test::Pod::LinkCheck" => "0";
54 requires "Test::Pod::No404s" => "0";
5555 requires "Test::Spelling" => "0.12";
5656 requires "Test::Synopsis" => "0";
5757 requires "Test::Taint" => "0.02";
+0
-208
lib/Attribute/Params/Validate.pm less more
0 package Attribute::Params::Validate;
1
2 use strict;
3 use warnings;
4
5 our $VERSION = '1.20';
6
7 use attributes;
8
9 use Attribute::Handlers 0.79;
10
11 # this will all be re-exported
12 use Params::Validate qw(:all);
13
14 require Exporter;
15
16 our @ISA = qw(Exporter);
17
18 my %tags = (
19 types => [
20 qw( SCALAR ARRAYREF HASHREF CODEREF GLOB GLOBREF SCALARREF HANDLE UNDEF OBJECT )
21 ],
22 );
23
24 our %EXPORT_TAGS = (
25 'all' => [ qw( validation_options ), map { @{ $tags{$_} } } keys %tags ],
26 %tags,
27 );
28 our @EXPORT_OK = ( @{ $EXPORT_TAGS{all} }, 'validation_options' );
29
30
31 sub UNIVERSAL::Validate : ATTR(CODE, INIT) {
32 _wrap_sub( 'named', @_ );
33 }
34
35 sub UNIVERSAL::ValidatePos : ATTR(CODE, INIT) {
36 _wrap_sub( 'positional', @_ );
37 }
38
39 sub _wrap_sub {
40 my ( $type, $package, $symbol, $referent, $attr, $params ) = @_;
41
42 my @p = ref $params ? @{$params} : $params;
43
44 my $subname = $package . '::' . *{$symbol}{NAME};
45
46 my %attributes = map { $_ => 1 } attributes::get($referent);
47 my $is_method = $attributes{method};
48
49 {
50 no warnings 'redefine';
51 no strict 'refs';
52
53 # An unholy mixture of closure and eval. This is done so that
54 # the code to automatically create the relevant scalars from
55 # the hash of params can create the scalars in the proper
56 # place lexically.
57
58 my $code = <<"EOF";
59 sub
60 {
61 package $package;
62 EOF
63
64 $code .= " my \$object = shift;\n" if $is_method;
65
66 if ( $type eq 'named' ) {
67 $params = {@p};
68 $code .= " Params::Validate::validate(\@_, \$params);\n";
69 }
70 else {
71 $code .= " Params::Validate::validate_pos(\@_, \@p);\n";
72 }
73
74 $code .= " unshift \@_, \$object if \$object;\n" if $is_method;
75
76 $code .= <<"EOF";
77 \$referent->(\@_);
78 }
79 EOF
80
81 my $sub = eval $code;
82 die $@ if $@;
83
84 *{$subname} = $sub;
85 }
86 }
87
88 1;
89
90 # ABSTRACT: Define validation through subroutine attributes
91
92 __END__
93
94 =pod
95
96 =head1 NAME
97
98 Attribute::Params::Validate - Define validation through subroutine attributes
99
100 =head1 VERSION
101
102 version 1.20
103
104 =head1 SYNOPSIS
105
106 use Attribute::Params::Validate qw(:all);
107
108 # takes named params (hash or hashref)
109 # foo is mandatory, bar is optional
110 sub foo : Validate( foo => 1, bar => 0 )
111 {
112 # insert code here
113 }
114
115 # takes positional params
116 # first two are mandatory, third is optional
117 sub bar : ValidatePos( 1, 1, 0 )
118 {
119 # insert code here
120 }
121
122 # for some reason Perl insists that the entire attribute be on one line
123 sub foo2 : Validate( foo => { type => ARRAYREF }, bar => { can => [ 'print', 'flush', 'frobnicate' ] }, baz => { type => SCALAR, callbacks => { 'numbers only' => sub { shift() =~ /^\d+$/ }, 'less than 90' => sub { shift() < 90 } } } )
124 {
125 # insert code here
126 }
127
128 # note that this is marked as a method. This is very important!
129 sub baz : Validate( foo => { type => ARRAYREF }, bar => { isa => 'Frobnicator' } ) method
130 {
131 # insert code here
132 }
133
134 =head1 DESCRIPTION
135
136 The Attribute::Params::Validate module allows you to validate method
137 or function call parameters just like Params::Validate does. However,
138 this module allows you to specify your validation spec as an
139 attribute, rather than by calling the C<validate> routine.
140
141 Please see Params::Validate for more information on how you can
142 specify what validation is performed.
143
144 =head2 EXPORT
145
146 This module exports everything that Params::Validate does except for
147 the C<validate> and C<validate_pos> subroutines.
148
149 =head2 ATTRIBUTES
150
151 =over 4
152
153 =item * Validate
154
155 This attribute corresponds to the C<validate> subroutine in
156 Params::Validate.
157
158 =item * ValidatePos
159
160 This attribute corresponds to the C<validate_pos> subroutine in
161 Params::Validate.
162
163 =back
164
165 =head2 OO
166
167 If you are using this module to mark B<methods> for validation, as
168 opposed to subroutines, it is crucial that you mark these methods with
169 the C<:method> attribute, as well as the C<Validate> or C<ValidatePos>
170 attribute.
171
172 If you do not do this, then the object or class used in the method
173 call will be passed to the validation routines, which is probably not
174 what you want.
175
176 =head2 CAVEATS
177
178 You B<must> put all the arguments to the C<Validate> or C<ValidatePos>
179 attribute on a single line, or Perl will complain.
180
181 =head1 SEE ALSO
182
183 Params::Validate
184
185 =head1 AUTHORS
186
187 =over 4
188
189 =item *
190
191 Dave Rolsky <autarch@urth.org>
192
193 =item *
194
195 Ilya Martynov <ilya@martynov.org>
196
197 =back
198
199 =head1 COPYRIGHT AND LICENSE
200
201 This software is Copyright (c) 2001 - 2015 by Dave Rolsky and Ilya Martynov.
202
203 This is free software, licensed under:
204
205 The Artistic License 2.0 (GPL Compatible)
206
207 =cut
22 use strict;
33 use warnings;
44
5 our $VERSION = '1.20';
5 our $VERSION = '1.21';
66
77 our @ISA = 'Exporter';
88
22 use strict;
33 use warnings;
44
5 our $VERSION = '1.20';
5 our $VERSION = '1.21';
66
77 use Params::Validate::Constants;
88 use Scalar::Util 1.10 ();
22 use strict;
33 use warnings;
44
5 our $VERSION = '1.20';
5 our $VERSION = '1.21';
66
77 use Carp;
88
44 use strict;
55 use warnings;
66
7 our $VERSION = '1.20';
7 our $VERSION = '1.21';
88
99 use Exporter;
1010 use Module::Implementation;
7474
7575 =head1 VERSION
7676
77 version 1.20
77 version 1.21
7878
7979 =head1 SYNOPSIS
8080
00 package # hide from PAUSE
11 Params::Validate;
22
3 our $VERSION = '1.20';
3 our $VERSION = '1.21';
44
55 BEGIN { $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'PP' }
66 use Params::Validate;
00 package # hide from PAUSE
11 Params::Validate;
22
3 our $VERSION = '1.20';
3 our $VERSION = '1.21';
44
55 BEGIN { $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'XS' }
66 use Params::Validate;
2525 'Test::NoTabs' => '0',
2626 'Test::Pod' => '1.41',
2727 'Test::Pod::Coverage' => '1.08',
28 'Test::Pod::LinkCheck' => '0',
29 'Test::Pod::No404s' => '0',
2830 'Test::Spelling' => '0.12',
2931 'Test::Synopsis' => '0',
3032 'Test::Taint' => '0.02'
3234 },
3335 'runtime' => {
3436 'requires' => {
35 'Attribute::Handlers' => '0.79',
3637 'Carp' => '0',
3738 'Exporter' => '0',
3839 'Module::Implementation' => '0',
3940 'Scalar::Util' => '1.10',
4041 'XSLoader' => '0',
41 'attributes' => '0',
4242 'perl' => '5.008001',
4343 'strict' => '0',
4444 'vars' => '0',
+0
-101
t/03-attribute.t less more
0 use strict;
1 use warnings;
2
3 use File::Spec;
4 use lib File::Spec->catdir( 't', 'lib' );
5
6 use PVTests;
7 use Test::More;
8
9 use Attribute::Params::Validate;
10 use Params::Validate qw(:all);
11
12 sub foo : Validate( c => { type => SCALAR } ) {
13 my %data = @_;
14 return $data{c};
15 }
16
17 sub bar : Validate( c => { type => SCALAR } ) method {
18 my $self = shift;
19 my %data = @_;
20 return $data{c};
21 }
22
23 sub baz :
24 Validate( foo => { type => ARRAYREF, callbacks => { '5 elements' => sub { @{shift()} == 5 } } } )
25 {
26 my %data = @_;
27 return $data{foo}->[0];
28 }
29
30 sub buz : ValidatePos( 1 ) {
31 return $_[0];
32 }
33
34 sub quux : ValidatePos( { type => SCALAR }, 1 ) {
35 return $_[0];
36 }
37
38 my $res = eval { foo( c => 1 ) };
39 is(
40 $@, q{},
41 "Call foo with a scalar"
42 );
43
44 is(
45 $res, 1,
46 'Check return value from foo( c => 1 )'
47 );
48
49 eval { foo( c => [] ) };
50
51 like(
52 $@, qr/The 'c' parameter .* was an 'arrayref'/,
53 'Check exception thrown from foo( c => [] )'
54 );
55
56 $res = eval { main->bar( c => 1 ) };
57 is(
58 $@, q{},
59 'Call bar with a scalar'
60 );
61
62 is(
63 $res, 1,
64 'Check return value from bar( c => 1 )'
65 );
66
67 eval { baz( foo => [ 1, 2, 3, 4 ] ) };
68
69 like(
70 $@, qr/The 'foo' parameter .* did not pass the '5 elements' callback/,
71 'Check exception thrown from baz( foo => [1,2,3,4] )'
72 );
73
74 $res = eval { baz( foo => [ 5, 4, 3, 2, 1 ] ) };
75
76 is(
77 $@, q{},
78 'Call baz( foo => [5,4,3,2,1] )'
79 );
80
81 is(
82 $res, 5,
83 'Check return value from baz( foo => [5,4,3,2,1] )'
84 );
85
86 eval { buz( [], 1 ) };
87
88 like(
89 $@, qr/2 parameters were passed to .* but 1 was expected/,
90 'Check exception thrown from quux( [], 1 )'
91 );
92
93 $res = eval { quux( 1, [] ) };
94
95 is(
96 $@, q{},
97 'Call quux'
98 );
99
100 done_testing();
1313
1414 use Test::More;
1515
16 plan tests => 8;
16 plan tests => 7;
1717
1818 my @module_files = (
19 'Attribute/Params/Validate.pm',
2019 'Params/Validate.pm',
2120 'Params/Validate/Constants.pm',
2221 'Params/Validate/PP.pm',
1414 use Test::EOL;
1515
1616 my @files = (
17 'lib/Attribute/Params/Validate.pm',
1817 'lib/Params/Validate.pm',
1918 'lib/Params/Validate/Constants.pm',
2019 'lib/Params/Validate/PP.pm',
2524 't/00-report-prereqs.t',
2625 't/01-validate.t',
2726 't/02-noop.t',
28 't/03-attribute.t',
2927 't/04-defaults.t',
3028 't/05-noop_default.t',
3129 't/06-options.t',
7977 't/release-portability.t',
8078 't/release-pp-01-validate.t',
8179 't/release-pp-02-noop.t',
82 't/release-pp-03-attribute.t',
8380 't/release-pp-04-defaults.t',
8481 't/release-pp-05-noop_default.t',
8582 't/release-pp-06-options.t',
1414 use Test::NoTabs;
1515
1616 my @files = (
17 'lib/Attribute/Params/Validate.pm',
1817 'lib/Params/Validate.pm',
1918 'lib/Params/Validate/Constants.pm',
2019 'lib/Params/Validate/PP.pm',
2524 't/00-report-prereqs.t',
2625 't/01-validate.t',
2726 't/02-noop.t',
28 't/03-attribute.t',
2927 't/04-defaults.t',
3028 't/05-noop_default.t',
3129 't/06-options.t',
7977 't/release-portability.t',
8078 't/release-pp-01-validate.t',
8179 't/release-pp-02-noop.t',
82 't/release-pp-03-attribute.t',
8380 't/release-pp-04-defaults.t',
8481 't/release-pp-05-noop_default.t',
8582 't/release-pp-06-options.t',
5353 Pit
5454 perl
5555 lib
56 Attribute
5756 Params
5857 Validate
5958 Constants
88 use strict;
99 use warnings;
1010
11 use Test::LeakTrace qw( no_leaks_ok );
1112 use Test::More;
12
13 BEGIN {
14 plan skip_all => q{Test::LeakTrace doesn't install with blead (as of 5.21.8)}
15 if $] >= 5.021008;
16 }
17
18 use Test::LeakTrace qw( no_leaks_ok );
1913
2014 use Params::Validate qw( validate );
2115
+0
-114
t/release-pp-03-attribute.t less more
0
1
2 use Test::More;
3
4 BEGIN {
5 unless ( $ENV{RELEASE_TESTING} ) {
6 plan skip_all => 'these tests are for release testing';
7 }
8
9 $ENV{PV_TEST_PERL} = 1;
10 }
11
12 use strict;
13 use warnings;
14
15 use File::Spec;
16 use lib File::Spec->catdir( 't', 'lib' );
17
18 use PVTests;
19 use Test::More;
20
21 use Attribute::Params::Validate;
22 use Params::Validate qw(:all);
23
24 sub foo : Validate( c => { type => SCALAR } ) {
25 my %data = @_;
26 return $data{c};
27 }
28
29 sub bar : Validate( c => { type => SCALAR } ) method {
30 my $self = shift;
31 my %data = @_;
32 return $data{c};
33 }
34
35 sub baz :
36 Validate( foo => { type => ARRAYREF, callbacks => { '5 elements' => sub { @{shift()} == 5 } } } )
37 {
38 my %data = @_;
39 return $data{foo}->[0];
40 }
41
42 sub buz : ValidatePos( 1 ) {
43 return $_[0];
44 }
45
46 sub quux : ValidatePos( { type => SCALAR }, 1 ) {
47 return $_[0];
48 }
49
50 my $res = eval { foo( c => 1 ) };
51 is(
52 $@, q{},
53 "Call foo with a scalar"
54 );
55
56 is(
57 $res, 1,
58 'Check return value from foo( c => 1 )'
59 );
60
61 eval { foo( c => [] ) };
62
63 like(
64 $@, qr/The 'c' parameter .* was an 'arrayref'/,
65 'Check exception thrown from foo( c => [] )'
66 );
67
68 $res = eval { main->bar( c => 1 ) };
69 is(
70 $@, q{},
71 'Call bar with a scalar'
72 );
73
74 is(
75 $res, 1,
76 'Check return value from bar( c => 1 )'
77 );
78
79 eval { baz( foo => [ 1, 2, 3, 4 ] ) };
80
81 like(
82 $@, qr/The 'foo' parameter .* did not pass the '5 elements' callback/,
83 'Check exception thrown from baz( foo => [1,2,3,4] )'
84 );
85
86 $res = eval { baz( foo => [ 5, 4, 3, 2, 1 ] ) };
87
88 is(
89 $@, q{},
90 'Call baz( foo => [5,4,3,2,1] )'
91 );
92
93 is(
94 $res, 5,
95 'Check return value from baz( foo => [5,4,3,2,1] )'
96 );
97
98 eval { buz( [], 1 ) };
99
100 like(
101 $@, qr/2 parameters were passed to .* but 1 was expected/,
102 'Check exception thrown from quux( [], 1 )'
103 );
104
105 $res = eval { quux( 1, [] ) };
106
107 is(
108 $@, q{},
109 'Call quux'
110 );
111
112 done_testing();
113