Acme-Pi

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Test::Warnings" : "0",
            "perl" : "5.006"
         }
      },
      "runtime" : {
         "requires" : {
            "Exporter" : "5.57",
            "Math::BigFloat" : "0",
            "perl" : "5.008",
            "strict" : "0",
            "utf8" : "0",
            "warnings" : "0"
         }
      },
      "test" : {
         "recommends" : {
            "CPAN::Meta" : "2.120900"
         },
         "requires" : {
            "ExtUtils::MakeMaker" : "0",
            "File::Spec" : "0",

META.yml  view on Meta::CPAN

no_index:
  directory:
    - inc
    - t
    - xt
requires:
  Exporter: '5.57'
  Math::BigFloat: '0'
  perl: '5.008'
  strict: '0'
  utf8: '0'
  warnings: '0'
resources:
  bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Acme-Pi
  homepage: https://github.com/karenetheridge/Acme-Pi
  repository: https://github.com/karenetheridge/Acme-Pi.git
version: '3.14159265'
x_Dist_Zilla:
  perl:
    version: '5.041009'
  plugins:

dist.ini  view on Meta::CPAN

:version = 6.012    ; version requirement for Dist::Zilla itself

version = 3.14159265        ; we will add one significant figure for every release

; edits dist.ini after release to bump this version ^^
[=inc::MyBumpVersionAfterRelease]

[@Author::ETHER]
:version = 0.097
Test::PodSpelling.stopwords = Mmm
Test::MinimumVersion.max_target_perl = 5.008    ; utf8
-remove = Test::Pod::No404s ; can't connect to piday.org? :(
-remove = MetaProvides::Package ; populating version = 3?!
-remove = RewriteVersion    ; not using it, but make sure it never gets used
-remove = BumpVersionAfterRelease ; ""
-remove = RewriteVersion::Transitional
-remove = BumpVersionAfterRelease::Transitional
Prereqs::AuthorDeps.exclude[0] = MyCheckVersionIncremented
Prereqs::AuthorDeps.exclude[1] = MyBumpVersionAfterRelease
post-release commit.allow_dirty = dist.ini  ; add to existing list, without overriding
post-release commit.commit_msg = prep repository for next dev cycle after %v release (automatic commit)

dist.ini  view on Meta::CPAN

[=inc::MyCheckVersionIncremented]

[OnlyCorePrereqs]
starting_version = latest
skip = Module::Build::Tiny

[Prereqs]
perl = 5.008
strict = 0
warnings = 0
utf8 = 0
Exporter = 0

[Prereqs / TestRequires]
if = 0
version = 0

[Prereqs / DevelopRequires]
Test::Warnings = 0
Test::CleanNamespaces = 0.24

inc/MyBumpVersionAfterRelease.pm  view on Meta::CPAN

use strict;
use warnings;
package inc::MyBumpVersionAfterRelease;

use Moose;
with 'Dist::Zilla::Role::AfterRelease';
use utf8;
use Path::Tiny 0.061;

# this is a smarter version of:
# [Run::AfterRelease]
# run = %x -p -i -e's/^version = 3\.(\d+)\s/sprintf(q(version = %0.( . (length($1)+1) . q(g), atan2(1,1)*4)/x'

sub after_release
{
    my $self = shift;

inc/MyBumpVersionAfterRelease.pm  view on Meta::CPAN

    my $original_version = $self->zilla->version;
    my $length = length($original_version);

    # add another digit if we added a 0, as it will be numerically identical
    do {} while substr($Ï€, $length++, 1) eq '0';

    my $new_version = substr($Ï€, 0, $length);

    # munge dist.ini to edit version line
    my $path = path('dist.ini');
    my $content = $path->slurp_utf8;

    my $delta_length = $length - length($original_version);

    if ($content =~ s/^(version = )$original_version\s{$delta_length}(\s+)/$1$new_version$2/m)
    {
        # append+truncate to preserve file mode
        $path->append_utf8({ truncate => 1 }, $content);
        return 1;
    }

    return;
}

1;

lib/Acme/Pi.pm  view on Meta::CPAN

use strict;
use warnings;
package Acme::Pi; # git description: v3.1415926-16-g35c9c3f
# vim: set ts=8 sts=2 sw=2 tw=100 et :
# ABSTRACT: Mmm, pie
# KEYWORDS: pi π

use utf8;

my $version = atan2(1,1) * 4; $Acme::Pi::VERSION = substr("$version", 0, 16);

use Exporter 5.57 'import';
our @EXPORT = ('$π', '$𝝿', 'π', '𝝿');

use Math::BigFloat;

sub π () { Math::BigFloat->new(1)->batan2(1) * 4 }
sub 𝝿 () { π }

t/00-report-prereqs.dd  view on Meta::CPAN

                                      'Test::Warnings' => '0',
                                      'perl' => '5.006'
                                    }
                    },
       'runtime' => {
                      'requires' => {
                                      'Exporter' => '5.57',
                                      'Math::BigFloat' => '0',
                                      'perl' => '5.008',
                                      'strict' => '0',
                                      'utf8' => '0',
                                      'warnings' => '0'
                                    }
                    },
       'test' => {
                   'recommends' => {
                                     'CPAN::Meta' => '2.120900'
                                   },
                   'requires' => {
                                   'ExtUtils::MakeMaker' => '0',
                                   'File::Spec' => '0',

t/02-import.t  view on Meta::CPAN

use strict;
use warnings;

use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8
use Test::More 0.88;
use utf8;
use Acme::Pi;

ok(defined($Ï€), 'we have a defined $Ï€');
ok(defined($𝝿), 'we have a defined $𝝿');
ok(defined(π), 'we have a defined π sub');
ok(defined(𝝿), 'we have a defined 𝝿 sub');

ok((3.14 < $Ï€) && ($Ï€ < 3.15), '$Ï€ is between 3.14 and 3.15');
ok((3.14 < $𝝿) && ($𝝿 < 3.15), '$𝝿 is between 3.14 and 3.15');
ok((3.14 < π) && (π < 3.15), 'π is between 3.14 and 3.15');

t/03-mmd-eumm.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More 0.88;
use utf8;
use Acme::Pi;


use Module::Metadata;
diag 'using Module::Metadata ', Module::Metadata->VERSION;

my $mmd_version = Module::Metadata->new_from_module('Acme::Pi')->version;
diag 'Module::Metadata extracted $VERSION:  ', $mmd_version,
    ($mmd_version eq Acme::Pi->VERSION ? ': correct' : ': WRONG');

t/04-bignum.t  view on Meta::CPAN

use strict;
use warnings;

use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8
use Test::More 0.88;
use utf8;
use Acme::Pi;

my $original_length = length(atan2(1,1) * 4);

my $length = length(Ï€);
ok($length > 20, 'Ï€ has many digits of precision ('.$length.')');
ok($length > $original_length, '...which is more digits than the previous version of π ('.$original_length.')');

my $pi = π;
ok((3.14 < $pi) && ($pi < 3.15), 'local copy of π is between 3.14 and 3.15');



( run in 0.623 second using v1.01-cache-2.11-cpan-49f99fa48dc )