SlideShare une entreprise Scribd logo
1  sur  59
Télécharger pour lire hors ligne
Dist::Zilla
   raaaaaaaaar!
you @ cpan . org


This talk is about your life as a CPAN author.
CPAN == Dists

The CPAN is just a bunch of dists (distributions).
YourApp-1.0.tar.gz
                      isa Dist


and a distribution is just an archive file
dists contain files
~/code/YourApp$ find .
          ./Changes
          ./LICENSE
          ./MANIFEST.SKIP
          ./Makefile.PL
          ./README
          ./lib/YourApp.pm
          ./lib/YourApp/Reticulator.pm
          ./lib/YourApp/Util/mtfnpy.pm
          ./lib/YourApp/Xyzzy.pm
          ./t/unit-tests.t
          ./t/pod-coverage.t
          ./t/pod.t


this is all the crap in your working copy where you write this dist
making all these is a boring pain in the ass
being a dist author is hard!
          let’s go gemming!
Module::Starter
C  K S  !
   U
Module::Starter
 S
only gets you to a
 starting point
can’t rebuild from
templates post facto
can’t add files to your dist
no good for files that
need to be rebuilt a lot
Module::Install
generates some files
when running ‘make’
Makefile.PL


takes the usually short Makefile.PL
Makefile.PL




makes it slightly smaller
Module::Install
C K  S !
   U
Module::Install
 S
relies on
ExtUtils::MakeMaker
relies on
ExtUtils::MakeMaker
                 CK S!
              SU
puts insane complexity
 on user’s computer
bundles scary, versioned
   code in the dist
when bugs are fixed,
everybody re-releases
...to review...
writing code == fun
writing
=head1 LICENSE
   NOT FUN
Dist::Zilla
   raaaaaaaaar!
~/code/YourApp$ find .
           ./Changes
           ./LICENSE
           ./MANIFEST.SKIP
           ./Makefile.PL
           ./README
           ./lib/YourApp.pm
           ./lib/YourApp/Reticulator.pm
           ./lib/YourApp/Util/mtfnpy.pm
           ./lib/YourApp/Xyzzy.pm
           ./t/unit-tests.t
           ./t/pod-coverage.t
           ./t/pod.t


So, back to this list of files....
~/code/YourApp$ find .




           ./lib/YourApp.pm
           ./lib/YourApp/Reticulator.pm
           ./lib/YourApp/Util/mtfnpy.pm
           ./lib/YourApp/Xyzzy.pm
           ./t/unit-tests.t




Let’s get rid of all the crap
~/code/YourApp$ find .


           dist.conf


           ./lib/YourApp.pm
           ./lib/YourApp/Reticulator.pm
           ./lib/YourApp/Util/mtfnpy.pm
           ./lib/YourApp/Xyzzy.pm
           ./t/unit-tests.t




and replace it with a little config for Dist::Zilla
package YourApp;

          =head1 NAME

          YourApp - my awesome app

          =head1 VERSION

          version 1.001

          =cut

          our $VERSION = 0.001;

          =head1 DESCRIPTION

          This app is awesome.

          =head1 METHODS

          =head2 this_method

          This method does stuff.

          =cut

          method this_method { ... }

          =head2 that_method

          Also stuff.

          method that_method { ... }

          =head1 AUTHOR

          Margo Yapp <myapp@example.com>

          =head1 LICENSE

          Copyright (C) 2008, Margo Yapp.

          This is distributed under the terms of the accidental death and
          dismemberment license and if you redistribuet this document you
          will be “accidentally” deathed or dismembered. You have been
          told.

          =cut

          1;




Here’s a .pm file
package YourApp;

         =head1 NAME

         YourApp - my awesome app

         =head1 VERSION

         version 1.001

         =cut

         our $VERSION = 0.001;

         =head1 DESCRIPTION

         This app is awesome.

         =head1 METHODS

         =head2 this_method

         This method does stuff.

         =cut

         method this_method { ... }

         =head2 that_method

         Also stuff.

         method that_method { ... }

         =head1 AUTHOR

         Margo Yapp <myapp@example.com>

         =head1 LICENSE

         Copyright (C) 2008, Margo Yapp.

         This is distributed under the terms of the accidental death and
         dismemberment license and if you redistribuet this document you
         will be “accidentally” deathed or dismembered. You have been
         told.

         =cut

         1;




The =name section is annoying.
package YourApp;
          # ABSTRACT: my awesome app

          =head1 VERSION

          version 1.001

          =cut

          our $VERSION = 0.001;

          =head1 DESCRIPTION

          This app is awesome.

          =head1 METHODS

          =head2 this_method

          This method does stuff.

          =cut

          method this_method { ... }

          =head2 that_method

          Also stuff.

          method that_method { ... }

          =head1 AUTHOR

          Margo Yapp <myapp@example.com>

          =head1 LICENSE

          Copyright (C) 2008, Margo Yapp.

          This is distributed under the terms of the accidental death and
          dismemberment license and if you redistribuet this document you
          will be “accidentally” deathed or dismembered. You have been
          told.

          =cut

          1;




We’ll replace it with a comment.
package YourApp;
          # ABSTRACT: my awesome app

          =head1 VERSION

          version 1.001

          =cut

          our $VERSION = 0.001;

          =head1 DESCRIPTION

          This app is awesome.

          =head1 METHODS

          =head2 this_method

          This method does stuff.

          =cut

          method this_method { ... }

          =head2 that_method

          Also stuff.

          method that_method { ... }

          =head1 AUTHOR

          Margo Yapp <myapp@example.com>

          =head1 LICENSE

          Copyright (C) 2008, Margo Yapp.

          This is distributed under the terms of the accidental death and
          dismemberment license and if you redistribuet this document you
          will be “accidentally” deathed or dismembered. You have been
          told.

          =cut

          1;




The =version section is redundant.
package YourApp;
           # ABSTRACT: my awesome app

           our $VERSION = 0.001;

           =head1 DESCRIPTION

           This app is awesome.

           =head1 METHODS

           =head2 this_method

           This method does stuff.

           =cut

           method this_method { ... }

           =head2 that_method

           Also stuff.

           method that_method { ... }

           =head1 AUTHOR

           Margo Yapp <myapp@example.com>

           =head1 LICENSE

           Copyright (C) 2008, Margo Yapp.

           This is distributed under the terms of the accidental death and
           dismemberment license and if you redistribuet this document you
           will be “accidentally” deathed or dismembered. You have been
           told.

           =cut

           1;




Drop it.
package YourApp;
          # ABSTRACT: my awesome app

          our $VERSION = 0.001;

          =head1 DESCRIPTION

          This app is awesome.

          =head1 METHODS

          =head2 this_method

          This method does stuff.

          =cut

          method this_method { ... }

          =head2 that_method

          Also stuff.

          method that_method { ... }

          =head1 AUTHOR

          Margo Yapp <myapp@example.com>

          =head1 LICENSE

          Copyright (C) 2008, Margo Yapp.

          This is distributed under the terms of the accidental death and
          dismemberment license and if you redistribuet this document you
          will be “accidentally” deathed or dismembered. You have been
          told.

          =cut

          1;




Even the $VERSION is redundant, since we want it constant across the dist.
package YourApp;
         # ABSTRACT: my awesome app

         =head1 DESCRIPTION

         This app is awesome.

         =head1 METHODS

         =head2 this_method

         This method does stuff.

         =cut

         method this_method { ... }

         =head2 that_method

         Also stuff.

         method that_method { ... }

         =head1 AUTHOR

         Margo Yapp <myapp@example.com>

         =head1 LICENSE

         Copyright (C) 2008, Margo Yapp.

         This is distributed under the terms of the accidental death and
         dismemberment license and if you redistribuet this document you
         will be “accidentally” deathed or dismembered. You have been
         told.

         =cut

         1;




our overarching METHOD section is dumb
package YourApp;
          # ABSTRACT: my awesome app

          =head1 DESCRIPTION

          This app is awesome.

          =method this_method

          This method does stuff.

          =cut

          method this_method { ... }

          =method that_method

          Also stuff.

          method that_method { ... }

          =head1 AUTHOR

          Margo Yapp <myapp@example.com>

          =head1 LICENSE

          Copyright (C) 2008, Margo Yapp.

          This is distributed under the terms of the accidental death and
          dismemberment license and if you redistribuet this document you
          will be “accidentally” deathed or dismembered. You have been
          told.

          =cut

          1;




let’s just use =method for them all
package YourApp;
          # ABSTRACT: my awesome app

          =head1 DESCRIPTION

          This app is awesome.

          =method this_method

          This method does stuff.

          =cut

          method this_method { ... }

          =method that_method

          Also stuff.

          method that_method { ... }

          =head1 AUTHOR

          Margo Yapp <myapp@example.com>

          =head1 LICENSE

          Copyright (C) 2008, Margo Yapp.

          This is distributed under the terms of the accidental death and
          dismemberment license and if you redistribuet this document you
          will be “accidentally” deathed or dismembered. You have been
          told.

          =cut

          1;




Repeating the author everywhere is annoying, too.
package YourApp;
          # ABSTRACT: my awesome app

          =head1 DESCRIPTION

          This app is awesome.

          =method this_method

          This method does stuff.

          =cut

          method this_method { ... }

          =method that_method

          Also stuff.

          method that_method { ... }

          =head1 LICENSE

          Copyright (C) 2008, Margo Yapp.

          This is distributed under the terms of the accidental death and
          dismemberment license and if you redistribuet this document you
          will be “accidentally” deathed or dismembered. You have been
          told.

          =cut

          1;




Drop it, use author info found in DZ config.
package YourApp;
          # ABSTRACT: my awesome app

          =head1 DESCRIPTION

          This app is awesome.

          =method this_method

          This method does stuff.

          =cut

          method this_method { ... }

          =method that_method

          Also stuff.

          method that_method { ... }

          =head1 LICENSE

          Copyright (C) 2008, Margo Yapp.

          This is distributed under the terms of the accidental death and
          dismemberment license and if you redistribuet this document you
          will be “accidentally” deathed or dismembered. You have been
          told.

          =cut

          1;




The license is gigantic! Ugh!
package YourApp;
           # ABSTRACT: my awesome app

           =head1 DESCRIPTION

           This app is awesome.

           =method this_method

           This method does stuff.

           =cut

           method this_method { ... }

           =method that_method

           Also stuff.

           method that_method { ... }

           1;




Drop it.
package YourApp;
          # ABSTRACT: my awesome app

          =head1 DESCRIPTION

          This app is awesome.

          =method this_method

          This method does stuff.

          =cut

          method this_method { ... }

          =method that_method

          Also stuff.

          method that_method { ... }

          1;



Now our file is simple, just the unique docs and code it needs. It fits on one legible slide!
package YourApp;
          # ABSTRACT: my awesome app

          =head1 DESCRIPTION

          This app is awesome.

          =method this_method

          This method does stuff.

          =cut

          method this_method { ... }

          =method that_method

          Also stuff.

          method that_method { ... }

          1;



And is about half Perl.
the CLI interface
dzil new




the CLI interface
dzil new

          dzil test




the CLI interface
dzil new

          dzil test

          dzil build




the CLI interface
dzil new

          dzil test

          dzil build

          dzil release



the CLI interface
spin-off modules

                   CPAN::Uploader            String::RewritePrefix


                       Pod::Eventual         Config::INI::MVP::Reader



                           Pod::Weaver         Mixin::Linewise


                   Software::License            Data::Section


                      String::Flogger          Pod::Elemental

lots of spin-off modules
lots of prereqs
...but that’s okay...
dzil replaces “make dist”
...and the dist is boring
plain old Makefile.PL
    (or Build.PL)
users don’t notice that
 you used Dist::Zilla
they just notice how
 productive you are
Dist::Zilla
   raaaaaaaaar!

Contenu connexe

Plus de Ricardo Signes

Perl 5: Today, Tomorrow, and Christmas
Perl 5: Today, Tomorrow, and ChristmasPerl 5: Today, Tomorrow, and Christmas
Perl 5: Today, Tomorrow, and ChristmasRicardo Signes
 
What's New in Perl? v5.10 - v5.16
What's New in Perl?  v5.10 - v5.16What's New in Perl?  v5.10 - v5.16
What's New in Perl? v5.10 - v5.16Ricardo Signes
 
Perl 5.14 for Pragmatists
Perl 5.14 for PragmatistsPerl 5.14 for Pragmatists
Perl 5.14 for PragmatistsRicardo Signes
 
Dist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN DistributionsDist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN DistributionsRicardo Signes
 
Perl 5.12 for Everyday Use
Perl 5.12 for Everyday UsePerl 5.12 for Everyday Use
Perl 5.12 for Everyday UseRicardo Signes
 
Antediluvian Unix: A Guide to Unix Fundamentals
Antediluvian Unix: A Guide to Unix FundamentalsAntediluvian Unix: A Guide to Unix Fundamentals
Antediluvian Unix: A Guide to Unix FundamentalsRicardo Signes
 
Perl 5.10 for People Who Aren't Totally Insane
Perl 5.10 for People Who Aren't Totally InsanePerl 5.10 for People Who Aren't Totally Insane
Perl 5.10 for People Who Aren't Totally InsaneRicardo Signes
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdRicardo Signes
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterRicardo Signes
 
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!Ricardo Signes
 

Plus de Ricardo Signes (11)

Perl 5: Today, Tomorrow, and Christmas
Perl 5: Today, Tomorrow, and ChristmasPerl 5: Today, Tomorrow, and Christmas
Perl 5: Today, Tomorrow, and Christmas
 
What's New in Perl? v5.10 - v5.16
What's New in Perl?  v5.10 - v5.16What's New in Perl?  v5.10 - v5.16
What's New in Perl? v5.10 - v5.16
 
Perl 5.14 for Pragmatists
Perl 5.14 for PragmatistsPerl 5.14 for Pragmatists
Perl 5.14 for Pragmatists
 
Dist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN DistributionsDist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN Distributions
 
Perl 5.12 for Everyday Use
Perl 5.12 for Everyday UsePerl 5.12 for Everyday Use
Perl 5.12 for Everyday Use
 
i &lt;3 email
i &lt;3 emaili &lt;3 email
i &lt;3 email
 
Antediluvian Unix: A Guide to Unix Fundamentals
Antediluvian Unix: A Guide to Unix FundamentalsAntediluvian Unix: A Guide to Unix Fundamentals
Antediluvian Unix: A Guide to Unix Fundamentals
 
Perl 5.10 for People Who Aren't Totally Insane
Perl 5.10 for People Who Aren't Totally InsanePerl 5.10 for People Who Aren't Totally Insane
Perl 5.10 for People Who Aren't Totally Insane
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::Cmd
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::Exporter
 
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!
 

Dernier

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Dernier (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Dist::Zilla simplifies CPAN authorship

  • 1. Dist::Zilla raaaaaaaaar!
  • 2. you @ cpan . org This talk is about your life as a CPAN author.
  • 3. CPAN == Dists The CPAN is just a bunch of dists (distributions).
  • 4. YourApp-1.0.tar.gz isa Dist and a distribution is just an archive file
  • 6. ~/code/YourApp$ find . ./Changes ./LICENSE ./MANIFEST.SKIP ./Makefile.PL ./README ./lib/YourApp.pm ./lib/YourApp/Reticulator.pm ./lib/YourApp/Util/mtfnpy.pm ./lib/YourApp/Xyzzy.pm ./t/unit-tests.t ./t/pod-coverage.t ./t/pod.t this is all the crap in your working copy where you write this dist making all these is a boring pain in the ass
  • 7. being a dist author is hard! let’s go gemming!
  • 9. C K S ! U Module::Starter S
  • 10. only gets you to a starting point
  • 12. can’t add files to your dist
  • 13. no good for files that need to be rebuilt a lot
  • 15. generates some files when running ‘make’
  • 16. Makefile.PL takes the usually short Makefile.PL
  • 19. C K S ! U Module::Install S
  • 22. puts insane complexity on user’s computer
  • 23. bundles scary, versioned code in the dist
  • 24. when bugs are fixed, everybody re-releases
  • 28. Dist::Zilla raaaaaaaaar!
  • 29. ~/code/YourApp$ find . ./Changes ./LICENSE ./MANIFEST.SKIP ./Makefile.PL ./README ./lib/YourApp.pm ./lib/YourApp/Reticulator.pm ./lib/YourApp/Util/mtfnpy.pm ./lib/YourApp/Xyzzy.pm ./t/unit-tests.t ./t/pod-coverage.t ./t/pod.t So, back to this list of files....
  • 30. ~/code/YourApp$ find . ./lib/YourApp.pm ./lib/YourApp/Reticulator.pm ./lib/YourApp/Util/mtfnpy.pm ./lib/YourApp/Xyzzy.pm ./t/unit-tests.t Let’s get rid of all the crap
  • 31. ~/code/YourApp$ find . dist.conf ./lib/YourApp.pm ./lib/YourApp/Reticulator.pm ./lib/YourApp/Util/mtfnpy.pm ./lib/YourApp/Xyzzy.pm ./t/unit-tests.t and replace it with a little config for Dist::Zilla
  • 32. package YourApp; =head1 NAME YourApp - my awesome app =head1 VERSION version 1.001 =cut our $VERSION = 0.001; =head1 DESCRIPTION This app is awesome. =head1 METHODS =head2 this_method This method does stuff. =cut method this_method { ... } =head2 that_method Also stuff. method that_method { ... } =head1 AUTHOR Margo Yapp <myapp@example.com> =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; Here’s a .pm file
  • 33. package YourApp; =head1 NAME YourApp - my awesome app =head1 VERSION version 1.001 =cut our $VERSION = 0.001; =head1 DESCRIPTION This app is awesome. =head1 METHODS =head2 this_method This method does stuff. =cut method this_method { ... } =head2 that_method Also stuff. method that_method { ... } =head1 AUTHOR Margo Yapp <myapp@example.com> =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; The =name section is annoying.
  • 34. package YourApp; # ABSTRACT: my awesome app =head1 VERSION version 1.001 =cut our $VERSION = 0.001; =head1 DESCRIPTION This app is awesome. =head1 METHODS =head2 this_method This method does stuff. =cut method this_method { ... } =head2 that_method Also stuff. method that_method { ... } =head1 AUTHOR Margo Yapp <myapp@example.com> =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; We’ll replace it with a comment.
  • 35. package YourApp; # ABSTRACT: my awesome app =head1 VERSION version 1.001 =cut our $VERSION = 0.001; =head1 DESCRIPTION This app is awesome. =head1 METHODS =head2 this_method This method does stuff. =cut method this_method { ... } =head2 that_method Also stuff. method that_method { ... } =head1 AUTHOR Margo Yapp <myapp@example.com> =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; The =version section is redundant.
  • 36. package YourApp; # ABSTRACT: my awesome app our $VERSION = 0.001; =head1 DESCRIPTION This app is awesome. =head1 METHODS =head2 this_method This method does stuff. =cut method this_method { ... } =head2 that_method Also stuff. method that_method { ... } =head1 AUTHOR Margo Yapp <myapp@example.com> =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; Drop it.
  • 37. package YourApp; # ABSTRACT: my awesome app our $VERSION = 0.001; =head1 DESCRIPTION This app is awesome. =head1 METHODS =head2 this_method This method does stuff. =cut method this_method { ... } =head2 that_method Also stuff. method that_method { ... } =head1 AUTHOR Margo Yapp <myapp@example.com> =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; Even the $VERSION is redundant, since we want it constant across the dist.
  • 38. package YourApp; # ABSTRACT: my awesome app =head1 DESCRIPTION This app is awesome. =head1 METHODS =head2 this_method This method does stuff. =cut method this_method { ... } =head2 that_method Also stuff. method that_method { ... } =head1 AUTHOR Margo Yapp <myapp@example.com> =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; our overarching METHOD section is dumb
  • 39. package YourApp; # ABSTRACT: my awesome app =head1 DESCRIPTION This app is awesome. =method this_method This method does stuff. =cut method this_method { ... } =method that_method Also stuff. method that_method { ... } =head1 AUTHOR Margo Yapp <myapp@example.com> =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; let’s just use =method for them all
  • 40. package YourApp; # ABSTRACT: my awesome app =head1 DESCRIPTION This app is awesome. =method this_method This method does stuff. =cut method this_method { ... } =method that_method Also stuff. method that_method { ... } =head1 AUTHOR Margo Yapp <myapp@example.com> =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; Repeating the author everywhere is annoying, too.
  • 41. package YourApp; # ABSTRACT: my awesome app =head1 DESCRIPTION This app is awesome. =method this_method This method does stuff. =cut method this_method { ... } =method that_method Also stuff. method that_method { ... } =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; Drop it, use author info found in DZ config.
  • 42. package YourApp; # ABSTRACT: my awesome app =head1 DESCRIPTION This app is awesome. =method this_method This method does stuff. =cut method this_method { ... } =method that_method Also stuff. method that_method { ... } =head1 LICENSE Copyright (C) 2008, Margo Yapp. This is distributed under the terms of the accidental death and dismemberment license and if you redistribuet this document you will be “accidentally” deathed or dismembered. You have been told. =cut 1; The license is gigantic! Ugh!
  • 43. package YourApp; # ABSTRACT: my awesome app =head1 DESCRIPTION This app is awesome. =method this_method This method does stuff. =cut method this_method { ... } =method that_method Also stuff. method that_method { ... } 1; Drop it.
  • 44. package YourApp; # ABSTRACT: my awesome app =head1 DESCRIPTION This app is awesome. =method this_method This method does stuff. =cut method this_method { ... } =method that_method Also stuff. method that_method { ... } 1; Now our file is simple, just the unique docs and code it needs. It fits on one legible slide!
  • 45. package YourApp; # ABSTRACT: my awesome app =head1 DESCRIPTION This app is awesome. =method this_method This method does stuff. =cut method this_method { ... } =method that_method Also stuff. method that_method { ... } 1; And is about half Perl.
  • 47. dzil new the CLI interface
  • 48. dzil new dzil test the CLI interface
  • 49. dzil new dzil test dzil build the CLI interface
  • 50. dzil new dzil test dzil build dzil release the CLI interface
  • 51. spin-off modules CPAN::Uploader String::RewritePrefix Pod::Eventual Config::INI::MVP::Reader Pod::Weaver Mixin::Linewise Software::License Data::Section String::Flogger Pod::Elemental lots of spin-off modules
  • 55. ...and the dist is boring
  • 56. plain old Makefile.PL (or Build.PL)
  • 57. users don’t notice that you used Dist::Zilla
  • 58. they just notice how productive you are
  • 59. Dist::Zilla raaaaaaaaar!