Acme-LookOfDisapproval

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

# This Build.PL for Acme-LookOfDisapproval was generated by Dist::Zilla::Plugin::ModuleBuildTiny 0.017.
use strict;
use warnings;


use 5.016;
use Module::Build::Tiny 0.034;
Build_PL();


use utf8;
use File::Spec::Functions;
my $source = catfile(qw(anotherlib Acme o_o.pm));
open my $source_fh, '<', $source or die "cannot open $source for reading: $!";
my $dest = catfile(qw(lib Acme ಠ_ಠ.pm));
open my $dest_fh, '>', $dest or die "cannot create $dest for writing: $!";
local $/;
print $dest_fh (<$source_fh>);
close $source_fh;
close $dest_fh;

META.json  view on Meta::CPAN

   "abstract" : "Send warnings with \u0ca0_\u0ca0",
   "author" : [
      "Karen Etheridge <ether@cpan.org>"
   ],
   "dynamic_config" : 0,
   "generated_by" : "Dist::Zilla version 6.032, CPAN::Meta::Converter version 2.150010",
   "keywords" : [
      "unicode",
      "canary",
      "warning",
      "utf8",
      "symbol",
      "\u0ca0_\u0ca0"
   ],
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : 2
   },

META.json  view on Meta::CPAN

            "Test::Portability::Files" : "0",
            "Test::Spelling" : "0.17",
            "perl" : "5.006"
         }
      },
      "runtime" : {
         "requires" : {
            "Exporter" : "0",
            "perl" : "5.016",
            "strict" : "0",
            "utf8" : "0",
            "warnings" : "0"
         }
      },
      "test" : {
         "recommends" : {
            "CPAN::Meta" : "2.120900"
         },
         "requires" : {
            "File::Spec" : "0",
            "JSON::PP" : "0",

META.json  view on Meta::CPAN

            "version" : "6.032"
         },
         {
            "class" : "Dist::Zilla::Plugin::Keywords",
            "config" : {
               "Dist::Zilla::Plugin::Keywords" : {
                  "keywords" : [
                     "unicode",
                     "canary",
                     "warning",
                     "utf8",
                     "symbol",
                     "\u0ca0_\u0ca0"
                  ]
               }
            },
            "name" : "@Author::ETHER/Keywords",
            "version" : "0.007"
         },
         {
            "class" : "Dist::Zilla::Plugin::UseUnsafeInc",

META.yml  view on Meta::CPAN

configure_requires:
  File::Spec::Functions: '0'
  Module::Build::Tiny: '0.034'
  perl: '5.008'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.032, CPAN::Meta::Converter version 2.150010'
keywords:
  - unicode
  - canary
  - warning
  - utf8
  - symbol
  - ಠ_ಠ
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Acme-LookOfDisapproval
no_index:
  directory:
    - inc
    - t
    - xt
requires:
  Exporter: '0'
  perl: '5.016'
  strict: '0'
  utf8: '0'
  warnings: '0'
resources:
  bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Acme-LookOfDisapproval
  homepage: https://github.com/karenetheridge/Acme-LookOfDisapproval
  repository: https://github.com/karenetheridge/Acme-LookOfDisapproval.git
version: '0.008'
x_Dist_Zilla:
  perl:
    version: '5.041007'
  plugins:

META.yml  view on Meta::CPAN

      name: '@Author::ETHER/MetaConfig'
      version: '6.032'
    -
      class: Dist::Zilla::Plugin::Keywords
      config:
        Dist::Zilla::Plugin::Keywords:
          keywords:
            - unicode
            - canary
            - warning
            - utf8
            - symbol
            - ಠ_ಠ
      name: '@Author::ETHER/Keywords'
      version: '0.007'
    -
      class: Dist::Zilla::Plugin::UseUnsafeInc
      config:
        Dist::Zilla::Plugin::UseUnsafeInc:
          dot_in_INC: 0
      name: '@Author::ETHER/UseUnsafeInc'

anotherlib/Acme/o_o.pm  view on Meta::CPAN

use strict;
use warnings;
use utf8;
package Acme::ಠ_ಠ;
# vim: set ts=8 sts=2 sw=2 tw=100 et :
# ABSTRACT: Send warnings with ಠ_ಠ

our $VERSION = '0.007';

use Acme::LookOfDisapproval;
our @EXPORT = ('ಠ_ಠ');

sub import {

anotherlib/Acme/o_o.pm  view on Meta::CPAN

=head1 NAME

Acme::ಠ_ಠ - Send warnings with ಠ_ಠ

=head1 VERSION

version 0.008

=head1 SYNOPSIS

    use utf8;
    use Acme::ಠ_ಠ;
    ಠ_ಠ 'you did something dumb';

=head1 DESCRIPTION

See L<Acme::LookOfDisapproval>.

=for stopwords unicode

This module also serves as a test of unicode module names. I have no idea if

dist.ini  view on Meta::CPAN

:version = 5

[FileFinder::ByName / AnotherLib]
dir = anotherlib

[@Author::ETHER]
:version = 0.103
installer[0] = MakeMaker::Fallback
installer[1] = ModuleBuildTiny::Fallback
MakeMaker::Fallback.:version = 0.029
MakeMaker::Fallback.header = use utf8;
MakeMaker::Fallback.WriteMakefile_arg = PM => { 'lib/Acme/LookOfDisapproval.pm' => '$(INST_LIB)/Acme/LookOfDisapproval.pm', 'anotherlib/Acme/o_o.pm' => '$(INST_LIB)/Acme/ಠ_ಠ.pm' }
ModuleBuildTiny.static = no     ; MBT's heuristics are weaker than [StaticInstall]'s
-remove = PodCoverageTests      ; "Invalid and untaintable filename"
-remove = Test::MinimumVersion  ; PPI cannot parse either .pm file
-remove = MetaProvides::Package ; Acme::ಠ_ಠ is rejected by CPAN::Meta::Validator
AutoPrereqs.skip = ^Acme::ಠ_ಠ$
Prereqs::AuthorDeps.exclude[0] = MungeInstallers
Prereqs::AuthorDeps.exclude[1] = Metadata
Test::Compile.:version = 2.038  ; for 'file' option
Test::Compile.file = Acme/ಠ_ಠ.pm

inc/MungeInstallers.pm  view on Meta::CPAN

use strict;
use warnings;
package inc::MungeInstallers;
# vim: set ts=8 sts=2 sw=2 tw=100 et :

use utf8;
use Moose;
with 'Dist::Zilla::Role::InstallTool';
use namespace::autoclean;

# TODO - this should really be a separate phase that runs after InstallTool -
# until then, all we can do is die if we are run too soon
sub setup_installer {
    my $self = shift;

    my @build_files = grep $_->name eq 'Build.PL', @{ $self->zilla->files };

inc/MungeInstallers.pm  view on Meta::CPAN

    $self->log_fatal('No Build.PL was found to munge!')
        if @build_files != 1;

    for my $file (@build_files) {
        # check for template markers in file content
        $self->log_fatal([ 'ran too soon, before %s template(s) evaluated', $file->name ])
            if $file->content =~ /\{\{/;

        $file->content($file->content . <<'COPY_MODULE');

use utf8;
use File::Spec::Functions;
my $source = catfile(qw(anotherlib Acme o_o.pm));
open my $source_fh, '<', $source or die "cannot open $source for reading: $!";
my $dest = catfile(qw(lib Acme ಠ_ಠ.pm));
open my $dest_fh, '>', $dest or die "cannot create $dest for writing: $!";
local $/;
print $dest_fh (<$source_fh>);
close $source_fh;
close $dest_fh;
COPY_MODULE

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

use strict;
use warnings;
use utf8;
package Acme::LookOfDisapproval; # git description: v0.007-16-g8154023
# vim: set ts=8 sts=2 sw=2 tw=100 et :
# ABSTRACT: Send warnings with ಠ_ಠ
# KEYWORDS: unicode canary warning utf8 symbol ಠ_ಠ

our $VERSION = '0.008';

use Exporter;
our @EXPORT = ('ಠ_ಠ');

sub import {
  utf8->import;
  goto &Exporter::import;
}

sub ಠ_ಠ { goto &CORE::warn }

1;

__END__

=pod

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

    BEGIN {
        no strict 'refs';
        *{__PACKAGE__ . '::ಠ_ಠ'} = *CORE::warn;
    }

But this is even nicer:

    sub ಠ_ಠ { goto &CORE::warn }

I also played around with L<Import::Into> to manage the export of both the
L<utf8> pragma and the C<ಠ_ಠ> symbol. However, that's just silly when we can
call C<import> directly on L<utf8> (it's a pragma, so the caller doesn't
matter -- only when it is called: during the caller's compilation cycle),
and then we can export our symbol by using L<goto> to jump to L<Exporter>.

=for stopwords dzil utf8

I also discovered while writing this distribution that L<Dist::Zilla> is not
able to munge files with utf8 characters, therefore I had to switch to packaging
this distribution with vanilla L<ExtUtils::MakeMaker>; also, a number of the
author and release tests that would have been added by dzil automatically
didn't work either (for example, see C<t/00-compile.t> -- C<< qx(^$X "require $_") >>
both needs the C<:binmode> or C<:encoding(UTF-8)> layer applied to C<STDOUT>, and
requires the L<utf8> pragma applied in the sub-perl (leading to more patches).

After pushing several patches to core L<Dist::Zilla> and some independently-distributed plugins,
I have been able to switch back to packaging with L<Dist::Zilla>.
Everything is now much more unicode-clean! 💃

=head1 SEE ALSO

=over 4

=item *

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

                                      'Test::Portability::Files' => '0',
                                      'Test::Spelling' => '0.17',
                                      'perl' => '5.006'
                                    }
                    },
       'runtime' => {
                      'requires' => {
                                      'Exporter' => '0',
                                      'perl' => '5.016',
                                      'strict' => '0',
                                      'utf8' => '0',
                                      'warnings' => '0'
                                    }
                    },
       'test' => {
                   'recommends' => {
                                     'CPAN::Meta' => '2.120900'
                                   },
                   'requires' => {
                                   'File::Spec' => '0',
                                   'JSON::PP' => '0',

t/02-Acme-o_o.t  view on Meta::CPAN

use strict;
use warnings;
# vim: set ts=8 sts=2 sw=2 tw=100 et :

use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8
use Test::More 0.88;
use Test::Warnings 0.009 ':no_end_test', ':all';
use utf8;
use Acme::ಠ_ಠ;
use JSON::PP;

my $line; my $file = __FILE__;
is(
    warning { ಠ_ಠ('oh noes'); $line = __LINE__ },
    "oh noes at $file line $line.\n",
    'warning appears, and with the right file and line',
);



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