Skip Menu |

This queue is for tickets about the Crypt-Random-Source-Strong-Win32 CPAN distribution.

Report information
The Basics
Id: 95862
Status: new
Priority: 0/
Queue: Crypt-Random-Source-Strong-Win32

People
Owner: Nobody in particular
Requestors: haarg [...] haarg.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] Convert from Any::Moose to Moo
Any::Moose is deprecated by the author, and should be avoided. Moo is a suitable replacement, and is compatible with both Moose and Mouse super-classes. Attached is a patch that does the conversion.
Subject: convert-to-moo.patch
diff --git c/Makefile.PL w/Makefile.PL index aba0fcd..5c0402a 100644 --- c/Makefile.PL +++ w/Makefile.PL @@ -6,9 +6,11 @@ all_from 'lib/Crypt/Random/Source/Strong/Win32.pm'; test_requires 'Test::use::ok' => 0; test_requires 'Test::Exception' => 0; -requires 'Any::Moose' => 0.11; -# 0.06 was where C::R::S started using Any::Moose. -requires 'Crypt::Random::Source' => '0.06'; +# for InstanceOf +requires 'Types::Standard' => 0.008; +# version needed for inheriting from Mouse classes +requires 'Moo' => 0.091004; +requires 'Crypt::Random::Source' => 0; # 0.55 fixes a bug with char* that might affect us. requires 'Win32::API' => 0.55; # 0.35 fixes a memory leak in GetOSVersion, which we use. diff --git c/lib/Crypt/Random/Source/Strong/Win32.pm w/lib/Crypt/Random/Source/Strong/Win32.pm index 87b9db9..cb2ac90 100644 --- c/lib/Crypt/Random/Source/Strong/Win32.pm +++ w/lib/Crypt/Random/Source/Strong/Win32.pm @@ -1,9 +1,10 @@ package Crypt::Random::Source::Strong::Win32; use 5.008; -use Any::Moose; +use Moo; use Win32; use Win32::API; use Win32::API::Type; +use Types::Standard qw(InstanceOf Int); our $VERSION = '0.07'; @@ -12,13 +13,12 @@ extends qw( Crypt::Random::Source::Base ); -has 'rtlgenrand' => (is => 'ro', isa => 'Win32::API', lazy_build => 1); +has 'rtlgenrand' => (is => 'lazy', isa => InstanceOf['Win32::API']); # For Windows 2000 only. -has 'crypt_context' => (is => 'ro', isa => 'Int', lazy_build => 1); -has 'cryptacquirecontext' => (is => 'ro', isa => 'Win32::API', - lazy_build => 1); -has 'cryptgenrandom' => (is => 'ro', isa => 'Win32::API', lazy_build => 1); +has 'crypt_context' => (is => 'lazy', isa => Int); +has 'cryptacquirecontext' => (is => 'lazy', isa => InstanceOf['Win32::API']); +has 'cryptgenrandom' => (is => 'lazy', isa => InstanceOf['Win32::API']); # The type of cryptographic service provider we want to use. # This doesn't really matter for our purposes, so we just pick