Reply-0.42000755001750001750 012757202233 11306 5ustar00doydoy000000000000README100644001750001750 43712757202233 12233 0ustar00doydoy000000000000Reply-0.42 This archive contains the distribution Reply, version 0.42: read, eval, print, loop, yay! This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License This README file was generated by Dist::Zilla::Plugin::Readme v6.005. Changes100644001750001750 1227212757202233 12706 0ustar00doydoy000000000000Reply-0.42Revision history for Reply 0.42 2016-08-23 - make tests pass again if Term::ReadKey is not installed (andk, #52) 0.41 2016-08-16 - add #vars command to list currently in scope variable names (garu, #39) - add Reply::Plugin::Pager to page long results (y, #47) 0.40 2016-06-25 - fix docs (y, #49) 0.39 2016-05-29 - allow ~/ in the history_file option to ReadLine (y, #48) 0.38 2015-12-02 - fix running reply without the Package plugin (2shortplanks, #45) 0.37 2014-11-18 - internal refactoring for extensibility (sergeyromanov, #41) 0.36 2014-11-16 - unshift onto @INC instead of pusing directories set with -l/-b/-I (ilmari, #40) 0.35 2014-07-04 - allow executing snippets and files from the argument list (suggested by tobyink, #36) 0.34 2013-08-29 - fix running reply without the ReadLine plugin (lestrrat, #26) 0.33 2013-08-16 - Support Term::ReadLine::Caroline (tokuhirom, #24) 0.32 2013-07-18 - Fix test failures if Carp::Always isn't installed (djerius, #21) - Clarify ReadLine documentation about the location of the history file (Kosuke Asami) 0.31 2013-07-18 - fix a ReadLine bug introduced in the previous release (Kosuke Asami, #22) 0.30 2013-07-17 - better support for Term::ReadLine::Perl5 (Kosuke Asami, #20) 0.29 2013-07-10 - Make CollapseStack always run under Carp::Always (#13) - Fix lexical subs (#19) 0.28 2013-07-10 - remove accidentally added dep on 'mro', which doesn't exist on 5.8 0.27 2013-07-10 - Add completion plugin for #-commands (#18) - More completion edge case fixes - More internal refactorings 0.26 2013-07-08 - Let Data::Printer handle coloring in the DataPrinter plugin. (Sawyer X) - Add a CollapseStack plugin, to make working with large stack traces easier. (sartak) 0.25 2013-07-05 - The DataDump plugin now respects object stringification overloads by default. This behavior can be disabled by setting the 'respect_stringification' option to 0. 0.24 2013-07-04 - use Devel::LexAlias to ensure that the lexical environment is persisted properly (gh #10) - a few internal refactorings 0.23 2013-07-03 - use the correct #! line (reported by SREZIC, RT86669) 0.22 2013-07-02 - few more completion edge cases 0.21 2013-07-01 - check inheritance in method completions - fix a couple more completion edge cases 0.20 2013-06-28 - completion for packages declared in the repl (Toby Inkster, gh-#7) - completion for functions (Toby Inkster, gh-#8) 0.19 2013-06-28 - fix test failures (reported by brunobuss) 0.18 2013-06-27 - tab completion support (with help from sartak) - lots of internal refactorings to make writing plugins easier 0.17 2013-06-27 - support color on windows (aero) 0.16 2013-06-26 - bump the Getopt::Long dep, for installing on older perls 0.15 2013-06-26 - add default command of #q for exiting the repl 0.14 2013-06-26 - add -l, -b, -I, and -M options (requested by Toby Inkster, RT86341) 0.13 2013-06-26 - allow plugins to configure the current package to use through the 'package' parameter in the compile callback 0.12 2013-06-25 - make the AutoRefresh plugin use the new track_require functionality in Class::Refresh (fixes a problem reported by Michael Reddick) 0.11 2013-06-24 - report failure to load of plugins which use modules that fail to load (reported by Michael Reddick) 0.10 2013-06-24 - don't pollute main::, since that's where the default configuration drops the user (reported by miyagawa) 0.09 2013-06-21 - fix tests 0.08 2013-06-21 - add AutoRefresh plugin (Michael Reddick) 0.07 2013-06-08 - expose a 'step' method to run single iterations of the repl - plugins specified in the 'plugins' constructor parameter are now run after loading config rather than before (this should give them more control over what actually runs - if this is a problem, i might add separate options for "before config" and "after config") - config handling is split out into a separate Reply::Config class for better reuse of the config loading logic - DataDumper plugin now sets Terse and Sortkeys, since that produces output that looks better - plugins can now set multiple independent lexical environments, to allow them to override the actual logical environment without wiping out special vars set by other plugins 0.06 2013-06-08 - add Timer plugin (Arthur Axel fREW Schmidt) - fix DataPrinter plugin when ~/.dataprinter has a custom value for 'alias' (Charles Bailey) 0.05 2013-06-04 - avoid test failures from DataPrinter, since it's optional 0.04 2013-06-04 - add a bit of option parsing to the reply script, to support choosing an alternate configuration file - Data::Printer plugin (creaktive) 0.03 2013-06-03 - fix LexicalPersistence plugin (reported by tokuhirom) 0.02 2013-06-03 - packaging and pod fixes 0.01 2013-06-03 - Initial release LICENSE100644001750001750 220712757202233 12375 0ustar00doydoy000000000000Reply-0.42This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License The MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. dist.ini100644001750001750 227612757202233 13042 0ustar00doydoy000000000000Reply-0.42name = Reply author = Jesse Luehrs license = MIT copyright_holder = Jesse Luehrs [FileFinder::Filter / WeaverFiles] finder = :InstallModules finder = :ExecFiles skip = ^lib/Reply/Plugin/Defaults.pm$ skip = ^lib/Reply/Util.pm$ [@DOY] :version = 0.14 dist = Reply repository = github Test::Compile_skip = ::(?:CollapseStack|Nopaste|DataDump|DataPrinter|Editor|AutoRefresh|Autocomplete::Keywords|Pager)$ PodWeaver_finder = WeaverFiles [MetaNoIndex] package = Reply::Plugin::Defaults package = Reply::Util [AutoPrereqs] skip = ^App::Nopaste$ skip = ^B::Keywords$ skip = ^Carp::Always$ skip = ^Class::Refresh$ skip = ^Data::Dump$ skip = ^Data::Printer$ skip = ^IO::Pager$ skip = ^mro$ skip = ^MRO::Compat$ skip = ^Proc::InvokeEditor$ skip = ^Term::ReadKey$ skip = ^Win32::Console::ANSI$ [Prereqs] Devel::LexAlias = 0 [Prereqs / RuntimeRecommends] App::Nopaste = 0 B::Keywords = 0 Carp::Always = 0 Class::Refresh = 0.05 Data::Dump = 0 Data::Printer = 0 IO::Pager = 0 Proc::InvokeEditor = 0 Term::ReadKey = 0 Term::ReadLine::Gnu = 0 ; XXX it'd be nice if we could make this recommended instead of required [OSPrereqs / MSWin32] Win32::Console::ANSI = 0 [PerlVersionPrereqs / 5.010] MRO::Compat = 0 META.yml100644001750001750 3703612757202233 12671 0ustar00doydoy000000000000Reply-0.42--- abstract: 'read, eval, print, loop, yay!' author: - 'Jesse Luehrs ' build_requires: File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::More: '0.88' blib: '1.01' perl: '5.006' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'Dist::Zilla version 6.005, CPAN::Meta::Converter version 2.150001' license: mit meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Reply no_index: package: - Reply::Plugin::Defaults - Reply::Util provides: Reply: file: lib/Reply.pm version: '0.42' Reply::App: file: lib/Reply/App.pm version: '0.42' Reply::Config: file: lib/Reply/Config.pm version: '0.42' Reply::Plugin: file: lib/Reply/Plugin.pm version: '0.42' Reply::Plugin::AutoRefresh: file: lib/Reply/Plugin/AutoRefresh.pm version: '0.42' Reply::Plugin::Autocomplete::Commands: file: lib/Reply/Plugin/Autocomplete/Commands.pm version: '0.42' Reply::Plugin::Autocomplete::Functions: file: lib/Reply/Plugin/Autocomplete/Functions.pm version: '0.42' Reply::Plugin::Autocomplete::Globals: file: lib/Reply/Plugin/Autocomplete/Globals.pm version: '0.42' Reply::Plugin::Autocomplete::Keywords: file: lib/Reply/Plugin/Autocomplete/Keywords.pm version: '0.42' Reply::Plugin::Autocomplete::Lexicals: file: lib/Reply/Plugin/Autocomplete/Lexicals.pm version: '0.42' Reply::Plugin::Autocomplete::Methods: file: lib/Reply/Plugin/Autocomplete/Methods.pm version: '0.42' Reply::Plugin::Autocomplete::Packages: file: lib/Reply/Plugin/Autocomplete/Packages.pm version: '0.42' Reply::Plugin::CollapseStack: file: lib/Reply/Plugin/CollapseStack.pm version: '0.42' Reply::Plugin::Colors: file: lib/Reply/Plugin/Colors.pm version: '0.42' Reply::Plugin::DataDump: file: lib/Reply/Plugin/DataDump.pm version: '0.42' Reply::Plugin::DataDumper: file: lib/Reply/Plugin/DataDumper.pm version: '0.42' Reply::Plugin::DataPrinter: file: lib/Reply/Plugin/DataPrinter.pm version: '0.42' Reply::Plugin::Editor: file: lib/Reply/Plugin/Editor.pm version: '0.42' Reply::Plugin::FancyPrompt: file: lib/Reply/Plugin/FancyPrompt.pm version: '0.42' Reply::Plugin::Hints: file: lib/Reply/Plugin/Hints.pm version: '0.42' Reply::Plugin::Interrupt: file: lib/Reply/Plugin/Interrupt.pm version: '0.42' Reply::Plugin::LexicalPersistence: file: lib/Reply/Plugin/LexicalPersistence.pm version: '0.42' Reply::Plugin::LoadClass: file: lib/Reply/Plugin/LoadClass.pm version: '0.42' Reply::Plugin::Nopaste: file: lib/Reply/Plugin/Nopaste.pm version: '0.42' Reply::Plugin::Packages: file: lib/Reply/Plugin/Packages.pm version: '0.42' Reply::Plugin::Pager: file: lib/Reply/Plugin/Pager.pm version: '0.42' Reply::Plugin::ReadLine: file: lib/Reply/Plugin/ReadLine.pm version: '0.42' Reply::Plugin::ResultCache: file: lib/Reply/Plugin/ResultCache.pm version: '0.42' Reply::Plugin::Timer: file: lib/Reply/Plugin/Timer.pm version: '0.42' recommends: App::Nopaste: '0' B::Keywords: '0' Carp::Always: '0' Class::Refresh: '0.05' Data::Dump: '0' Data::Printer: '0' IO::Pager: '0' Proc::InvokeEditor: '0' Term::ReadKey: '0' Term::ReadLine::Gnu: '0' requires: Config::INI::Reader::Ordered: '0' Data::Dumper: '0' Devel::LexAlias: '0' Eval::Closure: '0.11' Exporter: '0' File::HomeDir: '0' File::Spec: '0' Getopt::Long: '2.36' Module::Runtime: '0' Package::Stash: '0' PadWalker: '0' Scalar::Util: '0' Term::ANSIColor: '0' Term::ReadLine: '0' Time::HiRes: '0' Try::Tiny: '0' base: '0' overload: '0' strict: '0' warnings: '0' resources: bugtracker: https://github.com/doy/reply/issues homepage: http://metacpan.org/release/Reply repository: git://github.com/doy/reply.git version: '0.42' x_Dist_Zilla: perl: version: '5.022000' plugins: - class: Dist::Zilla::Plugin::FileFinder::Filter name: WeaverFiles version: '6.005' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@DOY/TestMoreDoneTesting' version: '6.005' - class: Dist::Zilla::Plugin::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . name: '@DOY/GatherDir' version: '6.005' - class: Dist::Zilla::Plugin::PruneCruft name: '@DOY/PruneCruft' version: '6.005' - class: Dist::Zilla::Plugin::ManifestSkip name: '@DOY/ManifestSkip' version: '6.005' - class: Dist::Zilla::Plugin::MetaYAML name: '@DOY/MetaYAML' version: '6.005' - class: Dist::Zilla::Plugin::License name: '@DOY/License' version: '6.005' - class: Dist::Zilla::Plugin::Readme name: '@DOY/Readme' version: '6.005' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@DOY/RunExtraTests' version: '0.028' - class: Dist::Zilla::Plugin::ExecDir name: '@DOY/ExecDir' version: '6.005' - class: Dist::Zilla::Plugin::ShareDir name: '@DOY/ShareDir' version: '6.005' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@DOY/MakeMaker' version: '6.005' - class: Dist::Zilla::Plugin::Manifest name: '@DOY/Manifest' version: '6.005' - class: Dist::Zilla::Plugin::TestRelease name: '@DOY/TestRelease' version: '6.005' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@DOY/ConfirmRelease' version: '6.005' - class: Dist::Zilla::Plugin::MetaConfig name: '@DOY/MetaConfig' version: '6.005' - class: Dist::Zilla::Plugin::MetaJSON name: '@DOY/MetaJSON' version: '6.005' - class: Dist::Zilla::Plugin::NextRelease name: '@DOY/NextRelease' version: '6.005' - class: Dist::Zilla::Plugin::CheckChangesHasContent name: '@DOY/CheckChangesHasContent' version: '0.008' - class: Dist::Zilla::Plugin::PkgVersion name: '@DOY/PkgVersion' version: '6.005' - class: Dist::Zilla::Plugin::Authority name: '@DOY/Authority' version: '1.009' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@DOY/PodCoverageTests' version: '6.005' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@DOY/PodSyntaxTests' version: '6.005' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - ':TestFiles' name: '@DOY/Test::NoTabs' version: '0.15' - class: Dist::Zilla::Plugin::EOLTests config: Dist::Zilla::Plugin::Test::EOL: filename: xt/release/eol.t finder: - ':InstallModules' - ':ExecFiles' - ':TestFiles' trailing_whitespace: '1' name: '@DOY/EOLTests' version: '0.18' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: 0 filename: t/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: test script_finder: - ':PerlExecFiles' skips: - '::(?:CollapseStack|Nopaste|DataDump|DataPrinter|Editor|AutoRefresh|Autocomplete::Keywords|Pager)$' name: '@DOY/Test::Compile' version: '2.054' - class: Dist::Zilla::Plugin::Metadata name: '@DOY/Metadata' version: '3.03' - class: Dist::Zilla::Plugin::MetaResources name: '@DOY/MetaResources' version: '6.005' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . name: '@DOY/Git::Check' version: '2.036' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: changelog Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@DOY/Git::Commit' version: '2.036' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: '0.42' tag_format: '%v' tag_message: '' Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@DOY/Git::Tag' version: '2.036' - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.01' version_by_branch: 0 version_regexp: (?^:^(\d+\.\d+)$) Dist::Zilla::Role::Git::Repo: repo_root: . name: '@DOY/Git::NextVersion' version: '2.036' - class: Dist::Zilla::Plugin::ContributorsFromGit name: '@DOY/ContributorsFromGit' version: '0.017' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: '@DOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.005' Dist::Zilla::Role::MetaProvider::Provider: inherit_missing: '1' inherit_version: '1' meta_noindex: '1' name: '@DOY/MetaProvides::Package' version: '2.003001' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: finder: - WeaverFiles plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.012' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.012' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Default/SingleEncoding' version: '4.012' - class: Pod::Weaver::Section::Name name: '@Default/Name' version: '4.012' - class: Pod::Weaver::Section::Version name: '@Default/Version' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Default/prelude' version: '4.012' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.012' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.012' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.012' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.012' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.012' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.012' - class: Pod::Weaver::Section::Leftovers name: '@Default/Leftovers' version: '4.012' - class: Pod::Weaver::Section::Region name: '@Default/postlude' version: '4.012' - class: Pod::Weaver::Section::Authors name: '@Default/Authors' version: '4.012' - class: Pod::Weaver::Section::Legal name: '@Default/Legal' version: '4.012' name: '@DOY/PodWeaver' version: '4.006' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@DOY/UploadToCPAN' version: '6.005' - class: Dist::Zilla::Plugin::MetaNoIndex name: MetaNoIndex version: '6.005' - class: Dist::Zilla::Plugin::AutoPrereqs name: AutoPrereqs version: '6.005' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: '6.005' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: recommends name: RuntimeRecommends version: '6.005' - class: Dist::Zilla::Plugin::OSPrereqs config: Dist::Zilla::Plugin::OSPrereqs: os: MSWin32 name: MSWin32 version: '0.005' - class: Dist::Zilla::Plugin::PerlVersionPrereqs config: Dist::Zilla::Plugin::PerlVersionPrereqs: perl_version: '5.010' name: '5.010' version: '0.01' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.005' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.005' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.005' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.005' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.005' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.005' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.005' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.005' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.005' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.005' - class: Dist::Zilla::Plugin::FinderCode name: '@DOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.005' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.005' x_authority: cpan:DOY x_contributors: - "Arthur Axel 'fREW' Schmidt " - 'Dagfinn Ilmari Mannsåker ' - 'John Barrett ' - 'Kosuke Asami ' - 'Michael Reddick ' - 'Sawyer X ' - 'Sergey Romanov ' - 'Shawn M Moore ' - 'Stanislaw Pusep ' - 'Toby Inkster ' - 'tokuhirom ' MANIFEST100644001750001750 227412757202233 12525 0ustar00doydoy000000000000Reply-0.42# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.005. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README bin/reply dist.ini lib/Reply.pm lib/Reply/App.pm lib/Reply/Config.pm lib/Reply/Plugin.pm lib/Reply/Plugin/AutoRefresh.pm lib/Reply/Plugin/Autocomplete/Commands.pm lib/Reply/Plugin/Autocomplete/Functions.pm lib/Reply/Plugin/Autocomplete/Globals.pm lib/Reply/Plugin/Autocomplete/Keywords.pm lib/Reply/Plugin/Autocomplete/Lexicals.pm lib/Reply/Plugin/Autocomplete/Methods.pm lib/Reply/Plugin/Autocomplete/Packages.pm lib/Reply/Plugin/CollapseStack.pm lib/Reply/Plugin/Colors.pm lib/Reply/Plugin/DataDump.pm lib/Reply/Plugin/DataDumper.pm lib/Reply/Plugin/DataPrinter.pm lib/Reply/Plugin/Defaults.pm lib/Reply/Plugin/Editor.pm lib/Reply/Plugin/FancyPrompt.pm lib/Reply/Plugin/Hints.pm lib/Reply/Plugin/Interrupt.pm lib/Reply/Plugin/LexicalPersistence.pm lib/Reply/Plugin/LoadClass.pm lib/Reply/Plugin/Nopaste.pm lib/Reply/Plugin/Packages.pm lib/Reply/Plugin/Pager.pm lib/Reply/Plugin/ReadLine.pm lib/Reply/Plugin/ResultCache.pm lib/Reply/Plugin/Timer.pm lib/Reply/Util.pm t/00-compile.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-syntax.t xt/release/eol.t bin000755001750001750 012757202233 11777 5ustar00doydoy000000000000Reply-0.42reply100644001750001750 257312757202233 13224 0ustar00doydoy000000000000Reply-0.42/bin#!perl use strict; use warnings; # PODNAME: reply # ABSTRACT: read, eval, print, loop, yay! use Reply::App; exit(Reply::App->new->run(@ARGV)); __END__ =pod =encoding UTF-8 =head1 NAME reply - read, eval, print, loop, yay! =head1 VERSION version 0.42 =head1 SYNOPSIS reply [-lb] [-I dir] [-M mod] [--version] [--help] [--cfg file] =head1 DESCRIPTION This script runs the L shell. It looks for a configuration file in C<.replyrc> in your home directory, and will generate a basic configuration for you if that file does not exist. See the L documentation for more information about using and configuring this program. =head1 OPTIONS reply takes these command line options: =over 4 =item -I lib Adds the given directory to C<@INC>. =item -l Equivalent to C<-I lib>. =item -b Equivalent to C<-I blib/lib -I blib/arch>. =item -M Carp::Always Loads the specified module before starting the repl. It is loaded within the repl, so things like exporting work properly. =item --cfg ~/.replyrc Specifies a different configuration file to use. C<~/.replyrc> is the default. =item --version Displays the program version. =item --help Displays usage information. =back =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut META.json100644001750001750 6005512757202233 13036 0ustar00doydoy000000000000Reply-0.42{ "abstract" : "read, eval, print, loop, yay!", "author" : [ "Jesse Luehrs " ], "dynamic_config" : 1, "generated_by" : "Dist::Zilla version 6.005, CPAN::Meta::Converter version 2.150001", "license" : [ "mit" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Reply", "no_index" : { "package" : [ "Reply::Plugin::Defaults", "Reply::Util" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::EOL" : "0", "Test::More" : "0.88", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } }, "runtime" : { "recommends" : { "App::Nopaste" : "0", "B::Keywords" : "0", "Carp::Always" : "0", "Class::Refresh" : "0.05", "Data::Dump" : "0", "Data::Printer" : "0", "IO::Pager" : "0", "Proc::InvokeEditor" : "0", "Term::ReadKey" : "0", "Term::ReadLine::Gnu" : "0" }, "requires" : { "Config::INI::Reader::Ordered" : "0", "Data::Dumper" : "0", "Devel::LexAlias" : "0", "Eval::Closure" : "0.11", "Exporter" : "0", "File::HomeDir" : "0", "File::Spec" : "0", "Getopt::Long" : "2.36", "Module::Runtime" : "0", "Package::Stash" : "0", "PadWalker" : "0", "Scalar::Util" : "0", "Term::ANSIColor" : "0", "Term::ReadLine" : "0", "Time::HiRes" : "0", "Try::Tiny" : "0", "base" : "0", "overload" : "0", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::More" : "0.88", "blib" : "1.01", "perl" : "5.006" } } }, "provides" : { "Reply" : { "file" : "lib/Reply.pm", "version" : "0.42" }, "Reply::App" : { "file" : "lib/Reply/App.pm", "version" : "0.42" }, "Reply::Config" : { "file" : "lib/Reply/Config.pm", "version" : "0.42" }, "Reply::Plugin" : { "file" : "lib/Reply/Plugin.pm", "version" : "0.42" }, "Reply::Plugin::AutoRefresh" : { "file" : "lib/Reply/Plugin/AutoRefresh.pm", "version" : "0.42" }, "Reply::Plugin::Autocomplete::Commands" : { "file" : "lib/Reply/Plugin/Autocomplete/Commands.pm", "version" : "0.42" }, "Reply::Plugin::Autocomplete::Functions" : { "file" : "lib/Reply/Plugin/Autocomplete/Functions.pm", "version" : "0.42" }, "Reply::Plugin::Autocomplete::Globals" : { "file" : "lib/Reply/Plugin/Autocomplete/Globals.pm", "version" : "0.42" }, "Reply::Plugin::Autocomplete::Keywords" : { "file" : "lib/Reply/Plugin/Autocomplete/Keywords.pm", "version" : "0.42" }, "Reply::Plugin::Autocomplete::Lexicals" : { "file" : "lib/Reply/Plugin/Autocomplete/Lexicals.pm", "version" : "0.42" }, "Reply::Plugin::Autocomplete::Methods" : { "file" : "lib/Reply/Plugin/Autocomplete/Methods.pm", "version" : "0.42" }, "Reply::Plugin::Autocomplete::Packages" : { "file" : "lib/Reply/Plugin/Autocomplete/Packages.pm", "version" : "0.42" }, "Reply::Plugin::CollapseStack" : { "file" : "lib/Reply/Plugin/CollapseStack.pm", "version" : "0.42" }, "Reply::Plugin::Colors" : { "file" : "lib/Reply/Plugin/Colors.pm", "version" : "0.42" }, "Reply::Plugin::DataDump" : { "file" : "lib/Reply/Plugin/DataDump.pm", "version" : "0.42" }, "Reply::Plugin::DataDumper" : { "file" : "lib/Reply/Plugin/DataDumper.pm", "version" : "0.42" }, "Reply::Plugin::DataPrinter" : { "file" : "lib/Reply/Plugin/DataPrinter.pm", "version" : "0.42" }, "Reply::Plugin::Editor" : { "file" : "lib/Reply/Plugin/Editor.pm", "version" : "0.42" }, "Reply::Plugin::FancyPrompt" : { "file" : "lib/Reply/Plugin/FancyPrompt.pm", "version" : "0.42" }, "Reply::Plugin::Hints" : { "file" : "lib/Reply/Plugin/Hints.pm", "version" : "0.42" }, "Reply::Plugin::Interrupt" : { "file" : "lib/Reply/Plugin/Interrupt.pm", "version" : "0.42" }, "Reply::Plugin::LexicalPersistence" : { "file" : "lib/Reply/Plugin/LexicalPersistence.pm", "version" : "0.42" }, "Reply::Plugin::LoadClass" : { "file" : "lib/Reply/Plugin/LoadClass.pm", "version" : "0.42" }, "Reply::Plugin::Nopaste" : { "file" : "lib/Reply/Plugin/Nopaste.pm", "version" : "0.42" }, "Reply::Plugin::Packages" : { "file" : "lib/Reply/Plugin/Packages.pm", "version" : "0.42" }, "Reply::Plugin::Pager" : { "file" : "lib/Reply/Plugin/Pager.pm", "version" : "0.42" }, "Reply::Plugin::ReadLine" : { "file" : "lib/Reply/Plugin/ReadLine.pm", "version" : "0.42" }, "Reply::Plugin::ResultCache" : { "file" : "lib/Reply/Plugin/ResultCache.pm", "version" : "0.42" }, "Reply::Plugin::Timer" : { "file" : "lib/Reply/Plugin/Timer.pm", "version" : "0.42" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/doy/reply/issues" }, "homepage" : "http://metacpan.org/release/Reply", "repository" : { "type" : "git", "url" : "git://github.com/doy/reply.git", "web" : "https://github.com/doy/reply" } }, "version" : "0.42", "x_Dist_Zilla" : { "perl" : { "version" : "5.022000" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::FileFinder::Filter", "name" : "WeaverFiles", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@DOY/TestMoreDoneTesting", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." } }, "name" : "@DOY/GatherDir", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@DOY/PruneCruft", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@DOY/ManifestSkip", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@DOY/MetaYAML", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@DOY/License", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@DOY/Readme", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@DOY/RunExtraTests", "version" : "0.028" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@DOY/ExecDir", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@DOY/ShareDir", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@DOY/MakeMaker", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@DOY/Manifest", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@DOY/TestRelease", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@DOY/ConfirmRelease", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@DOY/MetaConfig", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@DOY/MetaJSON", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@DOY/NextRelease", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", "name" : "@DOY/CheckChangesHasContent", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@DOY/PkgVersion", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@DOY/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@DOY/PodCoverageTests", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@DOY/PodSyntaxTests", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", ":TestFiles" ] } }, "name" : "@DOY/Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::EOLTests", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/release/eol.t", "finder" : [ ":InstallModules", ":ExecFiles", ":TestFiles" ], "trailing_whitespace" : "1" } }, "name" : "@DOY/EOLTests", "version" : "0.18" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : "0", "fail_on_warning" : "author", "fake_home" : 0, "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "test", "script_finder" : [ ":PerlExecFiles" ], "skips" : [ "::(?:CollapseStack|Nopaste|DataDump|DataPrinter|Editor|AutoRefresh|Autocomplete::Keywords|Pager)$" ] } }, "name" : "@DOY/Test::Compile", "version" : "2.054" }, { "class" : "Dist::Zilla::Plugin::Metadata", "name" : "@DOY/Metadata", "version" : "3.03" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "@DOY/MetaResources", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@DOY/Git::Check", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "changelog" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@DOY/Git::Commit", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "0.42", "tag_format" : "%v", "tag_message" : "" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@DOY/Git::Tag", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.01", "version_by_branch" : 0, "version_regexp" : "(?^:^(\\d+\\.\\d+)$)" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@DOY/Git::NextVersion", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::ContributorsFromGit", "name" : "@DOY/ContributorsFromGit", "version" : "0.017" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@DOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.005" } ] }, "Dist::Zilla::Role::MetaProvider::Provider" : { "inherit_missing" : "1", "inherit_version" : "1", "meta_noindex" : "1" } }, "name" : "@DOY/MetaProvides::Package", "version" : "2.003001" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ "WeaverFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.012" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Default/SingleEncoding", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Default/Name", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Default/Version", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/prelude", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Default/Leftovers", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/postlude", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Default/Authors", "version" : "4.012" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Default/Legal", "version" : "4.012" } ] } }, "name" : "@DOY/PodWeaver", "version" : "4.006" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@DOY/UploadToCPAN", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "MetaNoIndex", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "AutoPrereqs", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "recommends" } }, "name" : "RuntimeRecommends", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::OSPrereqs", "config" : { "Dist::Zilla::Plugin::OSPrereqs" : { "os" : "MSWin32" } }, "name" : "MSWin32", "version" : "0.005" }, { "class" : "Dist::Zilla::Plugin::PerlVersionPrereqs", "config" : { "Dist::Zilla::Plugin::PerlVersionPrereqs" : { "perl_version" : "5.010" } }, "name" : "5.010", "version" : "0.01" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.005" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@DOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.005" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "6.005" } }, "x_authority" : "cpan:DOY", "x_contributors" : [ "Arthur Axel 'fREW' Schmidt ", "Dagfinn Ilmari Manns\u00e5ker ", "John Barrett ", "Kosuke Asami ", "Michael Reddick ", "Sawyer X ", "Sergey Romanov ", "Shawn M Moore ", "Stanislaw Pusep ", "Toby Inkster ", "tokuhirom " ] } Makefile.PL100644001750001750 450312757202233 13343 0ustar00doydoy000000000000Reply-0.42# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.005. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "read, eval, print, loop, yay!", "AUTHOR" => "Jesse Luehrs ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Reply", "EXE_FILES" => [ "bin/reply" ], "LICENSE" => "mit", "MIN_PERL_VERSION" => "5.006", "NAME" => "Reply", "PREREQ_PM" => { "Config::INI::Reader::Ordered" => 0, "Data::Dumper" => 0, "Devel::LexAlias" => 0, "Eval::Closure" => "0.11", "Exporter" => 0, "File::HomeDir" => 0, "File::Spec" => 0, "Getopt::Long" => "2.36", "Module::Runtime" => 0, "Package::Stash" => 0, "PadWalker" => 0, "Scalar::Util" => 0, "Term::ANSIColor" => 0, "Term::ReadLine" => 0, "Time::HiRes" => 0, "Try::Tiny" => 0, "base" => 0, "overload" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::More" => "0.88", "blib" => "1.01" }, "VERSION" => "0.42", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Config::INI::Reader::Ordered" => 0, "Data::Dumper" => 0, "Devel::LexAlias" => 0, "Eval::Closure" => "0.11", "Exporter" => 0, "File::HomeDir" => 0, "File::Spec" => 0, "Getopt::Long" => "2.36", "IO::Handle" => 0, "IPC::Open3" => 0, "Module::Runtime" => 0, "Package::Stash" => 0, "PadWalker" => 0, "Scalar::Util" => 0, "Term::ANSIColor" => 0, "Term::ReadLine" => 0, "Test::More" => "0.88", "Time::HiRes" => 0, "Try::Tiny" => 0, "base" => 0, "blib" => "1.01", "overload" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; if ( $^O eq 'MSWin32' ) { $WriteMakefileArgs{PREREQ_PM}{'Win32::Console::ANSI'} = '0'; } if ($] < 5.010) { $WriteMakefileArgs{PREREQ_PM} = { %{ $WriteMakefileArgs{PREREQ_PM} }, "MRO::Compat" => "0", }; } WriteMakefile(%WriteMakefileArgs); lib000755001750001750 012757202233 11775 5ustar00doydoy000000000000Reply-0.42Reply.pm100644001750001750 2045012757202233 13607 0ustar00doydoy000000000000Reply-0.42/libpackage Reply; our $AUTHORITY = 'cpan:DOY'; $Reply::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: read, eval, print, loop, yay! use Module::Runtime qw(compose_module_name require_module); use Scalar::Util qw(blessed weaken); use Try::Tiny; use Reply::Config; sub new { my $class = shift; my %opts = @_; my $self = bless {}, $class; $self->{plugins} = []; $self->{_default_plugin} = $self->_instantiate_plugin('Defaults'); if (defined $opts{config}) { if (!ref($opts{config})) { $opts{config} = Reply::Config->new(file => $opts{config}); } $self->_load_config($opts{config}); } $self->_load_plugin($_) for @{ $opts{plugins} || [] }; return $self; } sub run { my $self = shift; while (1) { my $continue = $self->step; last unless $continue; } print "\n"; } sub step { my $self = shift; my ($line, $verbose) = @_; if (defined $line) { print $self->_wrapped_plugin('prompt'), $line, "\n" if $verbose; } else { $line = $self->_read; } return unless defined $line; $line = $self->_preprocess_line($line); try { my @result = $self->_eval($line); $self->_print_result(@result); } catch { $self->_print_error($_); }; my ($continue) = $self->_loop; return $continue; } sub _load_config { my $self = shift; my ($config) = @_; my $data = $config->data; my $root_config; for my $section (@$data) { my ($name, $data) = @$section; if ($name eq '_') { $root_config = $data; } else { $self->_load_plugin($name => $data); } } for my $line (sort grep { /^script_line/ } keys %$root_config) { $self->step($root_config->{$line}); } if (defined(my $file = $root_config->{script_file})) { my $contents = do { open my $fh, '<', $file or die "Couldn't open $file: $!"; local $/ = undef; <$fh> }; $self->step($contents); } } sub _load_plugin { my $self = shift; my ($plugin, $opts) = @_; $plugin = $self->_instantiate_plugin($plugin, $opts); push @{ $self->{plugins} }, $plugin; } sub _instantiate_plugin { my $self = shift; my ($plugin, $opts) = @_; if (!blessed($plugin)) { $plugin = compose_module_name("Reply::Plugin", $plugin); require_module($plugin); die "$plugin is not a valid plugin" unless $plugin->isa("Reply::Plugin"); my $weakself = $self; weaken($weakself); $plugin = $plugin->new( %$opts, publisher => sub { $weakself->_publish(@_) }, ); } return $plugin; } sub _plugins { my $self = shift; return ( @{ $self->{plugins} }, $self->{_default_plugin}, ); } sub _read { my $self = shift; my $prompt = $self->_wrapped_plugin('prompt'); return $self->_wrapped_plugin('read_line', $prompt); } sub _preprocess_line { my $self = shift; my ($line) = @_; if ($line =~ s/^#(\w+)(?:\s+|$)//) { ($line) = $self->_chained_plugin("command_\L$1", $line); } return "\n#line 1 \"reply input\"\n$line"; } sub _eval { my $self = shift; my ($line) = @_; ($line) = $self->_chained_plugin('mangle_line', $line) if defined $line; my ($code) = $self->_wrapped_plugin('compile', $line); return $self->_wrapped_plugin('execute', $code); } sub _print_error { my $self = shift; my ($error) = @_; ($error) = $self->_chained_plugin('mangle_error', $error); $self->_wrapped_plugin('print_error', $error); } sub _print_result { my $self = shift; my (@result) = @_; @result = $self->_chained_plugin('mangle_result', @result); $self->_wrapped_plugin('print_result', @result); } sub _loop { my $self = shift; $self->_chained_plugin('loop', 1); } sub _publish { my $self = shift; $self->_concatenate_plugin(@_); } sub _wrapped_plugin { my $self = shift; my @plugins = ref($_[0]) ? @{ shift() } : $self->_plugins; my ($method, @args) = @_; @plugins = grep { $_->can($method) } @plugins; return @args unless @plugins; my $plugin = shift @plugins; my $next = sub { $self->_wrapped_plugin(\@plugins, $method, @_) }; return $plugin->$method($next, @args); } sub _chained_plugin { my $self = shift; my @plugins = ref($_[0]) ? @{ shift() } : $self->_plugins; my ($method, @args) = @_; @plugins = grep { $_->can($method) } @plugins; for my $plugin (@plugins) { @args = $plugin->$method(@args); } return @args; } sub _concatenate_plugin { my $self = shift; my @plugins = ref($_[0]) ? @{ shift() } : $self->_plugins; my ($method, @args) = @_; @plugins = grep { $_->can($method) } @plugins; my @results; for my $plugin (@plugins) { push @results, $plugin->$method(@args); } return @results; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply - read, eval, print, loop, yay! =head1 VERSION version 0.42 =head1 SYNOPSIS use Reply; Reply->new(config => "$ENV{HOME}/.replyrc")->run; =head1 DESCRIPTION NOTE: This is an early release, and implementation details of this module are still very much in flux. Feedback is welcome! Reply is a lightweight, extensible REPL for Perl. It is plugin-based (see L), and through plugins supports many advanced features such as coloring and pretty printing, readline support, and pluggable commands. =head1 METHODS =head2 new(%opts) Creates a new Reply instance. Valid options are: =over 4 =item config Name of a configuration file to load. This should contain INI-style configuration for plugins as described above. =item plugins An arrayref of additional plugins to load. =back =head2 run Runs the repl. Will continue looping until the C callback returns undef (typically when the user presses C), or the C callback returns false (by default, the C<#q> command quits the repl in this way). =head2 step($line, $verbose) Runs a single iteration of the repl. If C<$line> is given, it will be used as the string to evaluate (and the C and C callbacks will not be called). If C<$verbose> is true, the prompt and line will be displayed as though they were typed. Returns true if the repl can continue, and false if it was requested to quit. =head1 CONFIGURATION Configuration uses an INI-style format similar to the configuration format of L. Section names are used as the names of plugins, and any options within a section are passed as arguments to that plugin. Plugins are loaded in order as they are listed in the configuration file, which can affect the results in some cases where multiple plugins are hooking into a single callback (see L for more information). In addition to plugin configuration, there are some additional options recognized. These must be specified at the top of the file, before any section headers. =over 4 =item script_file This contains a filename whose contents will be evaluated as perl code once the configuration is done being loaded. =item script_line> Any options that start with C will be sorted by their key and then each value will be evaluated individually once the configuration is done being loaded. NOTE: this is currently a hack due to the fact that L doesn't support multiple keys with the same name in a section. This may be fixed in the future to just allow specifying C multiple times. =back =head1 BUGS No known bugs. Please report any bugs to GitHub Issues at L. =head1 SEE ALSO L =head1 SUPPORT You can find this documentation for this module with the perldoc command. perldoc Reply You can also look for information at: =over 4 =item * MetaCPAN L =item * Github L =item * RT: CPAN's request tracker L =item * CPAN Ratings L =back =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut t000755001750001750 012757202233 11472 5ustar00doydoy000000000000Reply-0.4200-compile.t100644001750001750 566112757202233 13674 0ustar00doydoy000000000000Reply-0.42/tuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054 use Test::More; plan tests => 24 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Reply.pm', 'Reply/App.pm', 'Reply/Config.pm', 'Reply/Plugin.pm', 'Reply/Plugin/Autocomplete/Commands.pm', 'Reply/Plugin/Autocomplete/Functions.pm', 'Reply/Plugin/Autocomplete/Globals.pm', 'Reply/Plugin/Autocomplete/Lexicals.pm', 'Reply/Plugin/Autocomplete/Methods.pm', 'Reply/Plugin/Autocomplete/Packages.pm', 'Reply/Plugin/Colors.pm', 'Reply/Plugin/DataDumper.pm', 'Reply/Plugin/Defaults.pm', 'Reply/Plugin/FancyPrompt.pm', 'Reply/Plugin/Hints.pm', 'Reply/Plugin/Interrupt.pm', 'Reply/Plugin/LexicalPersistence.pm', 'Reply/Plugin/LoadClass.pm', 'Reply/Plugin/Packages.pm', 'Reply/Plugin/ReadLine.pm', 'Reply/Plugin/ResultCache.pm', 'Reply/Plugin/Timer.pm', 'Reply/Util.pm' ); my @scripts = ( 'bin/reply' ); # no fake home requested my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } foreach my $file (@scripts) { SKIP: { open my $fh, '<', $file or warn("Unable to open $file: $!"), next; my $line = <$fh>; close $fh and skip("$file isn't perl", 1) unless $line =~ /^#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/; my @flags = $1 ? split(' ', $1) : (); my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, @flags, '-c', $file); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$file compiled ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; # in older perls, -c output is simply the file portion of the path being tested if (@_warnings = grep { !/\bsyntax OK$/ } grep { chomp; $_ ne (File::Spec->splitpath($file))[2] } @_warnings) { warn @_warnings; push @warnings, @_warnings; } } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; Reply000755001750001750 012757202233 13070 5ustar00doydoy000000000000Reply-0.42/libApp.pm100644001750001750 750312757202233 14313 0ustar00doydoy000000000000Reply-0.42/lib/Replypackage Reply::App; our $AUTHORITY = 'cpan:DOY'; $Reply::App::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: command line app runner for Reply use Getopt::Long 2.36 'GetOptionsFromArray'; use Reply; use Reply::Config; sub new { bless {}, shift } sub run { my $self = shift; my @argv = @_; Getopt::Long::Configure("gnu_getopt"); my $cfgfile = '.replyrc'; my $exitcode; my (@modules, @script_lines, @files); my $parsed = GetOptionsFromArray( \@argv, 'cfg:s' => \$cfgfile, 'l|lib' => sub { unshift @INC, 'lib' }, 'b|blib' => sub { unshift @INC, 'blib/lib', 'blib/arch' }, 'I:s@' => sub { unshift @INC, $_[1] }, 'M:s@' => \@modules, 'e:s@' => \@script_lines, 'version' => sub { $exitcode = 0; version() }, 'help' => sub { $exitcode = 0; usage() }, ); @files = @argv; for my $file (@files) { if (!stat $file) { die "Can't read $file: $!"; } } if (!$parsed) { usage(1); $exitcode = 1; } return $exitcode if defined $exitcode; my $cfg = Reply::Config->new(file => $cfgfile); my %args = (config => $cfg); my $file = $cfg->file; if (!-e $file) { print("$file not found. Generating a default...\n"); unless ($self->generate_default_config($file)) { %args = (); } } my $reply = Reply->new(%args); $reply->step("use $_") for @modules; $reply->step($_, 1) for @script_lines; $reply->step('do "' . quotemeta($_) . '"', 1) for @files; $reply->run; return 0; } sub generate_default_config { my $self = shift; my ($file) = @_; if (open my $fh, '>', $file) { my $contents = do { local $/; }; $contents =~ s/use 5.XXX/use $]/; print $fh $contents; close $fh; return 1; } else { warn "Couldn't write to $file"; return 0; } } sub usage { my $fh = $_[0] ? *STDERR : *STDOUT; print $fh " reply [-lb] [-I dir] [-M mod] [--version] [--help] [--cfg file]\n"; } sub version { my $fh = $_[0] ? *STDERR : *STDOUT; print $fh "Reply version $Reply::VERSION\n"; } 1; =pod =encoding UTF-8 =head1 NAME Reply::App - command line app runner for Reply =head1 VERSION version 0.42 =head1 SYNOPSIS use Reply::App; exit(Reply::App->new->run(@ARGV)); =head1 DESCRIPTION This module encapsulates the various bits of functionality related to running L as a command line application. =head1 METHODS =head2 new Returns a new Reply::App instance. Takes no arguments. =head2 run(@argv) Parses the argument list given (typically from @ARGV), along with the user's configuration file, and attempts to start a Reply shell. A default configuration file will be generated for the user if none exists. =head2 generate_default_config($file) Generates default configuration file as per specified destination. =head2 usage($exitcode) Prints usage information to the screen. If C<$exitcode> is 0, it will be printed to C, otherwise it will be printed to C. =head2 version($exitcode) Prints version information to the screen. If C<$exitcode> is 0, it will be printed to C, otherwise it will be printed to C. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut __DATA__ script_line1 = use strict script_line2 = use warnings script_line3 = use 5.XXX [Interrupt] [FancyPrompt] [DataDumper] [Colors] [ReadLine] [Hints] [Packages] [LexicalPersistence] [ResultCache] [Autocomplete::Packages] [Autocomplete::Lexicals] [Autocomplete::Functions] [Autocomplete::Globals] [Autocomplete::Methods] [Autocomplete::Commands] release000755001750001750 012757202233 13302 5ustar00doydoy000000000000Reply-0.42/xteol.t100644001750001750 262512757202233 14413 0ustar00doydoy000000000000Reply-0.42/xt/releaseuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::EOLTests 0.18 use Test::More 0.88; use Test::EOL; my @files = ( 'bin/reply', 'lib/Reply.pm', 'lib/Reply/App.pm', 'lib/Reply/Config.pm', 'lib/Reply/Plugin.pm', 'lib/Reply/Plugin/AutoRefresh.pm', 'lib/Reply/Plugin/Autocomplete/Commands.pm', 'lib/Reply/Plugin/Autocomplete/Functions.pm', 'lib/Reply/Plugin/Autocomplete/Globals.pm', 'lib/Reply/Plugin/Autocomplete/Keywords.pm', 'lib/Reply/Plugin/Autocomplete/Lexicals.pm', 'lib/Reply/Plugin/Autocomplete/Methods.pm', 'lib/Reply/Plugin/Autocomplete/Packages.pm', 'lib/Reply/Plugin/CollapseStack.pm', 'lib/Reply/Plugin/Colors.pm', 'lib/Reply/Plugin/DataDump.pm', 'lib/Reply/Plugin/DataDumper.pm', 'lib/Reply/Plugin/DataPrinter.pm', 'lib/Reply/Plugin/Defaults.pm', 'lib/Reply/Plugin/Editor.pm', 'lib/Reply/Plugin/FancyPrompt.pm', 'lib/Reply/Plugin/Hints.pm', 'lib/Reply/Plugin/Interrupt.pm', 'lib/Reply/Plugin/LexicalPersistence.pm', 'lib/Reply/Plugin/LoadClass.pm', 'lib/Reply/Plugin/Nopaste.pm', 'lib/Reply/Plugin/Packages.pm', 'lib/Reply/Plugin/Pager.pm', 'lib/Reply/Plugin/ReadLine.pm', 'lib/Reply/Plugin/ResultCache.pm', 'lib/Reply/Plugin/Timer.pm', 'lib/Reply/Util.pm', 't/00-compile.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; Util.pm100644001750001750 315512757202233 14507 0ustar00doydoy000000000000Reply-0.42/lib/Replypackage Reply::Util; our $AUTHORITY = 'cpan:DOY'; $Reply::Util::VERSION = '0.42'; use strict; use warnings; BEGIN { if ($] < 5.010) { require MRO::Compat; } else { require mro; } } use Package::Stash; use Scalar::Util 'blessed'; use Exporter 'import'; our @EXPORT_OK = qw( $ident_rx $varname_rx $fq_ident_rx $fq_varname_rx methods all_packages ); # XXX this should be updated for unicode our $varstart_rx = qr/[A-Z_a-z]/; our $varcont_rx = qr/[0-9A-Z_a-z]/; our $ident_rx = qr/${varstart_rx}${varcont_rx}*/; our $sigil_rx = qr/[\$\@\%\&\*]/; our $varname_rx = qr/$sigil_rx\s*$ident_rx/; our $fq_ident_rx = qr/$ident_rx(?:::$varcont_rx+)*/; our $fq_varname_rx = qr/$varname_rx(?:::$varcont_rx+)*/; sub methods { my ($invocant) = @_; my $class = blessed($invocant) || $invocant; my @mro = ( @{ mro::get_linear_isa('UNIVERSAL') }, @{ mro::get_linear_isa($class) }, ); my @methods; for my $package (@mro) { my $stash = eval { Package::Stash->new($package) }; next unless $stash; push @methods, $stash->list_all_symbols('CODE'); } return @methods; } sub all_packages { my ($root) = @_; $root ||= \%::; my @packages; for my $fragment (grep { /::$/ } keys %$root) { next if ref($root) && $root == \%:: && $fragment eq 'main::'; push @packages, ( $fragment, map { $fragment . $_ } all_packages($root->{$fragment}) ); } return map { s/::$//; $_ } @packages; } =begin Pod::Coverage methods all_packages =end Pod::Coverage =cut 1; Config.pm100644001750001750 347712757202233 15006 0ustar00doydoy000000000000Reply-0.42/lib/Replypackage Reply::Config; our $AUTHORITY = 'cpan:DOY'; $Reply::Config::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: config loading for Reply use Config::INI::Reader::Ordered; use File::HomeDir; use File::Spec; sub new { my $class = shift; my %opts = @_; $opts{file} = '.replyrc' unless defined $opts{file}; my $file = File::Spec->catfile( (File::Spec->file_name_is_absolute($opts{file}) ? () : (File::HomeDir->my_home)), $opts{file} ); my $self = bless {}, $class; $self->{file} = $file; $self->{config} = Config::INI::Reader::Ordered->new; return $self; } sub file { shift->{file} } sub data { my $self = shift; return $self->{config}->read_file($self->{file}); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Config - config loading for Reply =head1 VERSION version 0.42 =head1 SYNOPSIS use Reply; use Reply::Config; Reply->new(config => Reply::Config->new(file => 'something_else'))->run; =head1 DESCRIPTION This class abstracts out the config file loading, so that other applications can start up Reply shells using similar logic. Reply configuration is specified in an INI format - see L for more details. =head1 METHODS =head2 new(%opts) Creates a new config object. Valid options are: =over 4 =item file Configuration file to use. If the file is specified by a relative path, it will be relative to the user's home directory, otherwise it will be used as-is. =back =head2 file Returns the absolute path to the config file that is to be used. =head2 data Returns the loaded configuration data. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Plugin.pm100644001750001750 1603712757202233 15053 0ustar00doydoy000000000000Reply-0.42/lib/Replypackage Reply::Plugin; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: base class for Reply plugins use Reply::Util 'methods'; sub new { my $class = shift; my (%opts) = @_; die "publisher is required" unless $opts{publisher}; return bless { publisher => $opts{publisher}, }, $class; } sub publish { my $self = shift; $self->{publisher}->(@_); } sub commands { my $self = shift; return map { s/^command_//; $_ } grep { /^command_/ } methods($self); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin - base class for Reply plugins =head1 VERSION version 0.42 =head1 SYNOPSIS package Reply::Plugin::Foo; use strict; use warnings; use base 'Reply::Plugin'; # ... =head1 DESCRIPTION A L plugin is an object which adds some functionality to a Reply instance by implementing some specific methods which the Reply object will call at various points during execution. Plugins may implement as many callback methods as necessary to implement their functionality (although the more callbacks a given plugin implements, the more likely it is that the plugin may be more useful as multiple independent plugins). Callback methods have three potential calling conventions: =over 4 =item wrapped Wrapped callbacks receive a coderef as their first argument (before any arguments to the callback itself), and that coderef can be used to call the next callback in the list (if more than one plugin implements a given callback). In particular, this allows calling the next plugin multiple times, or not at all if necessary. Wrapped plugins should always call their coderef in list context. All plugins listed below are wrapped plugins unless indicated otherwise. =item chained Chained callbacks receive a list of arguments, and return a new list of arguments which will be passed to the next plugin in the chain. This allows each plugin a chance to modify a value before it's actually used by the repl. =item concatenate Concatenate callbacks receive a list of arguments, and return a list of response values. Each plugin that implements the given callback will be called with the same arguments, and the results will be concatenated together into a single list, which will be returned. Callbacks for published messages are of this type. =back =head2 CALLBACKS =over 4 =item prompt Called to determine the prompt to use when reading the next line. Takes no arguments, and returns a single string to use as the prompt. The default implementation returns C<< ">" >> =item read_line Called to actually read a line from the user. Takes no arguments, and returns a single string. The default implementation uses the C<< <> >> operator to read a single line from C. =item command_C<$name> (chained) If the line read from the user is of the form C<"#foo args...">, then plugins will be searched for a callback method named C. This callback takes a single string containing the provided arguments, and returns a new line to evaluate instead, if any. =item mangle_line (chained) Modifies the line read from the user before it's evaluated. Takes the line as a string and returns the modified line. =item compile Compiles the string of Perl code into a coderef. Takes the line of code as a string and a hash of extra parameters, and returns the coderef to be executed. The default implementation uses L to compile the given string. The hash of extra parameters is passed directly to C. =item execute Executes the coderef which has just been compiled. Takes the coderef and a list of parameters to pass to it, and returns the list of results returned by calling the coderef. The default implementation just calls the coderef directly. =item mangle_error (chained) If the C or C callbacks throw an exception, this callback will be called to modify the exception before it is passed to C. It receives the exception and returns the modified exception. =item print_error If the C or C callbacks throw an exception, this callback will be called to display it to the user. It receives the exception and returns nothing. The default implementation just uses C to print it to the screen. =item mangle_result (chained) This callback is used to modify the result of evaluating the line of code before it is displayed. It receives the list of results and returns a modified list of results. =item print_result This callback displays to the user the results of evaluating the given line of code. It receives the list of results, and returns nothing. The default implementation just uses C to print them to the screen. =item loop (chained) This callback is called at the end of each evaluation. It receives whether the repl has been requested to terminate so far, and returns whether the repl should terminate. =back Reply plugins can also communicate among each other via a pub/sub mechanism. By calling the C method, all plugins which respond to the given message (implement a method of the given name) will have that method called with the given arguments, and all of the responses will be collected and returned. Some messages used by the default plugins are: =over 4 =item tab_handler ($line) Plugins can publish this message when they want to attempt tab completion. Plugins that respond to this message should return a list of potential completions of the line which is passed in. =item lexical_environment Plugins which wish to modify the lexical environment should do so by implementing this message, which should return a hashref of variable names (including sigils) to value references. There can be more than one lexical environment (each maintained by a different plugin), so plugins that wish to inspect the lexical environment should do so by calling C<< $self->publish('lexical_environment') >>, and then merging together all of the hashrefs which are returned. =item package Plugins which wish to modify the currently active package should do so by implementing this message, which should return the name of the current package. Then, to access the currently active package, a plugin can call C<< ($self->publish('package'))[-1] >>. =back Your plugins, however, are not limited to these messages - you can use whatever messages you want to communicate. =head1 METHODS =head2 publish ($name, @args) Publish a message to other plugins which respond to it. All loaded plugins which implement a method named C<$name> will have it called with C<@args> as the parameters. Returns a list of everything that each plugin responded with. =head2 commands Returns the names of the C<#> commands that this plugin implements. This can be used in conjunction with C - C<< $plugin->publish('commands') >> will return a list of all commands which are available in the current Reply session. =for Pod::Coverage new =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut author000755001750001750 012757202233 13164 5ustar00doydoy000000000000Reply-0.42/xtno-tabs.t100644001750001750 257412757202233 15064 0ustar00doydoy000000000000Reply-0.42/xt/authoruse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'bin/reply', 'lib/Reply.pm', 'lib/Reply/App.pm', 'lib/Reply/Config.pm', 'lib/Reply/Plugin.pm', 'lib/Reply/Plugin/AutoRefresh.pm', 'lib/Reply/Plugin/Autocomplete/Commands.pm', 'lib/Reply/Plugin/Autocomplete/Functions.pm', 'lib/Reply/Plugin/Autocomplete/Globals.pm', 'lib/Reply/Plugin/Autocomplete/Keywords.pm', 'lib/Reply/Plugin/Autocomplete/Lexicals.pm', 'lib/Reply/Plugin/Autocomplete/Methods.pm', 'lib/Reply/Plugin/Autocomplete/Packages.pm', 'lib/Reply/Plugin/CollapseStack.pm', 'lib/Reply/Plugin/Colors.pm', 'lib/Reply/Plugin/DataDump.pm', 'lib/Reply/Plugin/DataDumper.pm', 'lib/Reply/Plugin/DataPrinter.pm', 'lib/Reply/Plugin/Defaults.pm', 'lib/Reply/Plugin/Editor.pm', 'lib/Reply/Plugin/FancyPrompt.pm', 'lib/Reply/Plugin/Hints.pm', 'lib/Reply/Plugin/Interrupt.pm', 'lib/Reply/Plugin/LexicalPersistence.pm', 'lib/Reply/Plugin/LoadClass.pm', 'lib/Reply/Plugin/Nopaste.pm', 'lib/Reply/Plugin/Packages.pm', 'lib/Reply/Plugin/Pager.pm', 'lib/Reply/Plugin/ReadLine.pm', 'lib/Reply/Plugin/ResultCache.pm', 'lib/Reply/Plugin/Timer.pm', 'lib/Reply/Util.pm', 't/00-compile.t' ); notabs_ok($_) foreach @files; done_testing; pod-syntax.t100644001750001750 25212757202233 15576 0ustar00doydoy000000000000Reply-0.42/xt/author#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); pod-coverage.t100644001750001750 33412757202233 16044 0ustar00doydoy000000000000Reply-0.42/xt/author#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Plugin000755001750001750 012757202233 14326 5ustar00doydoy000000000000Reply-0.42/lib/ReplyHints.pm100644001750001750 426212757202233 16115 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::Hints; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Hints::VERSION = '0.42'; my $default_hints; my $default_hinthash; my $default_warning_bits; BEGIN { $default_hints = $^H; $default_hinthash = \%^H; $default_warning_bits = ${^WARNING_BITS}; } use strict; use warnings; # ABSTRACT: persists lexical hints across input lines use base 'Reply::Plugin'; sub new { my $class = shift; my $self = $class->SUPER::new(@_); $self->{hints} = $default_hints; $self->{hinthash} = $default_hinthash; $self->{warning_bits} = $default_warning_bits; return $self; } sub mangle_line { my $self = shift; my ($line) = @_; my $package = __PACKAGE__; return <{hints}; our $hinthash = $self->{hinthash}; our $warning_bits = $self->{warning_bits}; my @result = $next->($line, %args); $self->{hints} = $hints; $self->{hinthash} = $hinthash; $self->{warning_bits} = $warning_bits; return @result; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Hints - persists lexical hints across input lines =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [Hints] =head1 DESCRIPTION This plugin persists the values of various compile time lexical hints between evaluated lines. This means, for instance, that entering a line like C at the Reply prompt will cause C to be enabled for all future lines (at least until C is given). =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Pager.pm100644001750001750 310112757202233 16055 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::Pager; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Pager::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: command to automatically open long results in a pager use base 'Reply::Plugin'; use Term::ReadKey; sub new { my $class = shift; my %opts = @_; if (defined $opts{pager}) { $ENV{PAGER} = $opts{pager}; } # delay this because it checks $ENV{PAGER} at load time require IO::Pager; my $self = $class->SUPER::new(@_); return $self; } sub print_result { my $self = shift; my ($next, @result) = @_; my ($cols, $rows) = GetTerminalSize; my @lines = map { split /\n/ } @result; if (@lines >= $rows - 2) { IO::Pager::open(my $fh) or die "Couldn't run pager: $!"; $fh->print(@result, "\n"); } else { $next->(@result); } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Pager - command to automatically open long results in a pager =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [Pager] pager = less =head1 DESCRIPTION This plugin notices when too much output is going to be displayed as the result of an expression, and automatically loads the result into a pager instead. The C option can be specified to provide a different pager to use, otherwise it will use the value of C<$ENV{PAGER}>. =for Pod::Coverage print_result =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Timer.pm100644001750001750 241412757202233 16105 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::Timer; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Timer::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: time commands use base 'Reply::Plugin'; use Time::HiRes qw(gettimeofday tv_interval); sub new { my $class = shift; my %opts = @_; my $self = $class->SUPER::new(@_); $self->{mintime} = $opts{mintime} || 0.01; return $self; } sub execute { my ($self, $next, @args) = @_; my $t0 = [gettimeofday]; my @ret = $next->(@args); my $elapsed = tv_interval($t0); if ($elapsed > $self->{mintime}) { if ($elapsed >= 1) { printf "Execution Time: %0.3fs\n", $elapsed } else { printf "Execution Time: %dms\n", $elapsed * 1000 } } return @ret; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Timer - time commands =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [Timer] mintime = 0.01 =head1 DESCRIPTION This plugin prints timer info for results that take longer than C. the default C is C<< 0.01 >> seconds. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Colors.pm100644001750001750 435712757202233 16276 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::Colors; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Colors::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: colorize output use base 'Reply::Plugin'; use Term::ANSIColor; BEGIN { if ($^O eq 'MSWin32') { require Win32::Console::ANSI; Win32::Console::ANSI->import; } } sub new { my $class = shift; my %opts = @_; my $self = $class->SUPER::new(@_); $self->{error} = $opts{error} || 'red'; $self->{warning} = $opts{warning} || 'yellow'; $self->{result} = $opts{result} || 'green'; return $self; } sub compile { my $self = shift; my ($next, @args) = @_; local $SIG{__WARN__} = sub { $self->print_warn(@_) }; $next->(@args); } sub execute { my $self = shift; my ($next, @args) = @_; local $SIG{__WARN__} = sub { $self->print_warn(@_) }; $next->(@args); } sub print_error { my $self = shift; my ($next, $error) = @_; print color($self->{error}); $next->($error); local $| = 1; print color('reset'); } sub print_result { my $self = shift; my ($next, @result) = @_; print color($self->{result}); $next->(@result); local $| = 1; print color('reset'); } sub print_warn { my $self = shift; my ($warning) = @_; print color($self->{warning}); print $warning; local $| = 1; print color('reset'); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Colors - colorize output =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [Colors] error = bright red warning = bright yellow result = bright green =head1 DESCRIPTION This plugin adds coloring to the results when they are printed to the screen. By default, errors are C, warnings are C, and normal results are C, although this can be overridden through configuration as shown in the synopsis. L is used to generate the colors, so any value that is accepted by that module is a valid value for the C, C, and C options. =for Pod::Coverage print_warn =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Editor.pm100644001750001750 447012757202233 16257 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::Editor; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Editor::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: command to edit the current line in a text editor use base 'Reply::Plugin'; use File::HomeDir; use File::Spec; use Proc::InvokeEditor; sub new { my $class = shift; my %opts = @_; my $self = $class->SUPER::new(@_); $self->{editor} = Proc::InvokeEditor->new( (defined $opts{editor} ? (editors => [ $opts{editor} ]) : ()) ); $self->{current_text} = ''; return $self; } sub command_e { my $self = shift; my ($line) = @_; my $text; if (length $line) { if ($line =~ s+^~/++) { $line = File::Spec->catfile(File::HomeDir->my_home, $line); } elsif ($line =~ s+^~([^/]*)/++) { $line = File::Spec->catfile(File::HomeDir->users_home($1), $line); } my $current_text = do { local $/; if (open my $fh, '<', $line) { <$fh>; } else { warn "Couldn't open $line: $!"; return ''; } }; $text = $self->{editor}->edit($current_text, '.pl'); } else { $text = $self->{editor}->edit($self->{current_text}, '.pl'); $self->{current_text} = $text; } return $text; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Editor - command to edit the current line in a text editor =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [Editor] editor = emacs =head1 DESCRIPTION This plugin provides the C<#e> command. It will launch your editor, and allow you to edit bits of code in your editor, which will then be evaluated all at once. The text you entered will be saved, and restored the next time you enter the command. Alternatively, you can pass a filename to the C<#e> command, and the contents of that file will be preloaded instead. The C option can be specified to provide a different editor to use, otherwise it will use the value of C<$ENV{VISUAL}> or C<$ENV{EDITOR}>. =for Pod::Coverage command_e =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Nopaste.pm100644001750001750 525212757202233 16441 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::Nopaste; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Nopaste::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: command to nopaste a transcript of the current session use base 'Reply::Plugin'; use App::Nopaste; sub new { my $class = shift; my %opts = @_; my $self = $class->SUPER::new(@_); $self->{history} = ''; $self->{service} = $opts{service}; return $self; } sub prompt { my $self = shift; my ($next, @args) = @_; my $prompt = $next->(@args); $self->{prompt} = $prompt; return $prompt; } sub read_line { my $self = shift; my ($next, @args) = @_; my $line = $next->(@args); $self->{line} = "$line\n" if defined $line; return $line; } sub print_error { my $self = shift; my ($next, $error) = @_; $self->{result} = $error; $next->($error); } sub print_result { my $self = shift; my ($next, @result) = @_; $self->{result} = @result ? join('', @result) . "\n" : ''; $next->(@result); } sub loop { my $self = shift; my ($continue) = @_; my $prompt = delete $self->{prompt}; my $line = delete $self->{line}; my $result = delete $self->{result}; $self->{history} .= "$prompt$line$result" if defined $prompt && defined $line && defined $result; $continue; } sub command_nopaste { my $self = shift; my ($line) = @_; $line = "Reply session" unless length $line; print App::Nopaste->nopaste( text => $self->{history}, desc => $line, lang => 'perl', (defined $self->{service} ? (services => [ $self->{service} ]) : ()), ) . "\n"; return ''; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Nopaste - command to nopaste a transcript of the current session =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [Nopaste] service = Gist =head1 DESCRIPTION This plugin provides a C<#nopaste> command, which will use L to nopaste a transcript of the current Reply session. The C option can be used to choose an alternate service to use, rather than using the one that App::Nopaste chooses on its own. If arguments are passed to the C<#nopaste> command, they will be used as the title of the paste. Note that this plugin should be loaded early in your configuration file, in order to ensure that it sees all modifications to the result (due to plugins like [DataDump], etc). =for Pod::Coverage command_nopaste =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut DataDump.pm100644001750001750 301212757202233 16517 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::DataDump; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::DataDump::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: format results using Data::Dump use base 'Reply::Plugin'; use Data::Dump 'dumpf'; use overload (); sub new { my $class = shift; my %opts = @_; $opts{respect_stringification} = 1 unless defined $opts{respect_stringification}; my $self = $class->SUPER::new(@_); $self->{filter} = sub { my ($ctx, $ref) = @_; return unless $ctx->is_blessed; my $stringify = overload::Method($ref, '""'); return unless $stringify; return { dump => $stringify->($ref), }; } if $opts{respect_stringification}; return $self; } sub mangle_result { my $self = shift; my (@result) = @_; return @result ? dumpf(@result, $self->{filter}) : (); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::DataDump - format results using Data::Dump =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [DataDump] respect_stringification = 1 =head1 DESCRIPTION This plugin uses L to format results. By default, if it reaches an object which has a stringification overload, it will dump that directly. To disable this behavior, set the C option to a false value. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Packages.pm100644001750001750 324412757202233 16545 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::Packages; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Packages::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: persist the current package between lines use base 'Reply::Plugin'; sub new { my $class = shift; my %opts = @_; my $self = $class->SUPER::new(@_); $self->{package} = $opts{default_package} || 'main'; return $self; } sub mangle_line { my $self = shift; my ($line) = @_; my $package = __PACKAGE__; return <($line, %args); # XXX it'd be nice to avoid using globals here, but we can't use # eval_closure's environment parameter since we need to access the # information in a BEGIN block $self->{package} = our $package; return @result; } sub package { my $self = shift; return $self->{package}; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Packages - persist the current package between lines =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [Packages] default_package = My::Scratchpad =head1 DESCRIPTION This plugin persists the state of the current package between lines. This allows lines such as C in the Reply shell to do what you'd expect. The C configuration option can also be used to set the initial package to use when Reply starts up. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Defaults.pm100644001750001750 423412757202233 16576 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::Defaults; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Defaults::VERSION = '0.42'; # XXX Eval::Closure imposes its own hints on things that are eval'ed at the # moment, but this may be fixed in the future BEGIN { our $default_hints = $^H; our $default_hinthash = { %^H }; our $default_warning_bits = ${^WARNING_BITS}; } use strict; use warnings; use base 'Reply::Plugin'; use Eval::Closure 0.11; sub new { my $class = shift; my $self = $class->SUPER::new(@_); $self->{quit} = 0; return $self; } sub prompt { "> " } sub read_line { my $self = shift; my ($next, $prompt) = @_; print $prompt; return scalar ; } (my $PREFIX = <<'PREFIX') =~ s/__PACKAGE__/__PACKAGE__/ge; BEGIN { $^H = $__PACKAGE__::default_hints; %^H = %$__PACKAGE__::default_hinthash; ${^WARNING_BITS} = $__PACKAGE__::default_warning_bits; } PREFIX sub compile { my $self = shift; my ($next, $line, %args) = @_; my $env = { map { %$_ } $self->publish('lexical_environment') }; my $package = ($self->publish('package'))[-1]; $package = 'main' unless defined $package; my $prefix = "package $package;\n$PREFIX"; my $code = eval_closure( source => "sub {\n$prefix;\n$line\n}", terse_error => 1, alias => 1, environment => $env, %args, ); return $code; } sub execute { my $self = shift; my ($next, $code, @args) = @_; return $code->(@args); } sub print_error { my $self = shift; my ($next, $error) = @_; print $error if defined $error; } sub print_result { my $self = shift; my ($next, @result) = @_; print @result, "\n" if @result; } sub command_q { my $self = shift; $self->{quit} = 1; return ''; } sub command_vars { my $self = shift; my %env = map { %$_ } $self->publish('lexical_environment'); return '(' . join(', ', map { qq<'$_'> } keys %env) . ')'; } sub loop { my $self = shift; my ($continue) = @_; $continue = 0 if $self->{quit}; return $continue; } =begin Pod::Coverage new command_q command_vars =end Pod::Coverage =cut 1; ReadLine.pm100644001750001750 1126712757202233 16536 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::ReadLine; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::ReadLine::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: use Term::ReadLine for user input use base 'Reply::Plugin'; use File::HomeDir; use File::Spec; use Scalar::Util 'weaken'; use Term::ReadLine; sub new { my $class = shift; my %opts = @_; my $self = $class->SUPER::new(@_); $self->{term} = Term::ReadLine->new('Reply'); my $history = $opts{history_file} || '.reply_history'; $history =~ s{^~/}{$ENV{HOME}/}; $self->{history_file} = File::Spec->catfile( (File::Spec->file_name_is_absolute($history) ? () : (File::HomeDir->my_data)), $history ); $self->{rl_gnu} = $self->{term}->ReadLine eq 'Term::ReadLine::Gnu'; $self->{rl_perl5} = $self->{term}->ReadLine eq 'Term::ReadLine::Perl5'; $self->{rl_caroline} = $self->{term}->ReadLine eq 'Term::ReadLine::Caroline'; if ($self->{rl_perl5}) { # output compatible with Term::ReadLine::Gnu $readline::rl_scroll_nextline = 0; } if ($self->{rl_perl5} || $self->{rl_gnu} || $self->{rl_caroline}) { $self->{term}->StifleHistory($opts{history_length}) if defined $opts{history_length} && $opts{history_length} >= 0; } if (open my $fh, '<', $self->{history_file}) { for my $line (<$fh>) { chomp $line; $self->{term}->addhistory($line); } } else { my $e = $!; warn "Couldn't open $self->{history_file} for reading: $e" if -e $self->{history_file}; } $self->_register_tab_complete; return $self; } sub read_line { my $self = shift; my ($next, $prompt) = @_; return $self->{term}->readline($prompt); } sub DESTROY { my $self = shift; return if defined $self->{history_length} && $self->{history_length} == 0; # XXX support more later return unless ($self->{rl_gnu} || $self->{rl_perl5} || $self->{rl_caroline}); $self->{term}->WriteHistory($self->{history_file}) or warn "Couldn't write history to $self->{history_file}"; } sub _register_tab_complete { my $self = shift; my $term = $self->{term}; weaken(my $weakself = $self); if ($self->{rl_gnu}) { $term->Attribs->{attempted_completion_function} = sub { my ($text, $line, $start, $end) = @_; # discard everything after the cursor for completion purposes substr($line, $end) = ''; my @matches = $weakself->publish('tab_handler', $line); my $match_index = 0; return $term->completion_matches($text, sub { my ($text, $index) = @_; return $matches[$index]; }); }; } if ($self->{rl_perl5}) { $term->Attribs->{completion_function} = sub { my ($text, $line, $start) = @_; my $end = $start + length($text); # discard everything after the cursor for completion purposes substr($line, $end) = ''; my @matches = $weakself->publish('tab_handler', $line); return scalar(@matches) ? @matches : (); }; } if ($self->{rl_caroline}) { $term->caroline->completion_callback(sub { my ($line) = @_; my @matches = $weakself->publish('tab_handler', $line); # for variable completion, method name completion. if (@matches && $line =~ /\W/) { $line =~ s/[:\w]+\z//; @matches = map { $line.$_ } @matches; } return scalar(@matches) ? @matches : (); }); } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::ReadLine - use Term::ReadLine for user input =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [ReadLine] history_file = .hist history_length = 100 =head1 DESCRIPTION This plugin uses L to read lines from the user. This enables useful features such as line editing and command history. The history will be persisted between runs, by default in C<.reply_history> in your application data directory, although this is changeable with the C option. To limit the number of lines written to this file, you can use the C option. Setting a C of C<0> will disable writing history to a file entirely. NOTE: you probably want to install a reasonable L backend in order for this plugin to be very useful. L is highly recommended if possible. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Interrupt.pm100644001750001750 201612757202233 17017 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::Interrupt; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Interrupt::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: allows using Ctrl+C to interrupt long-running lines use base 'Reply::Plugin'; sub compile { my $self = shift; my ($next, @args) = @_; local $SIG{INT} = sub { die "Interrupted" }; $next->(@args); } sub execute { my $self = shift; my ($next, @args) = @_; local $SIG{INT} = sub { die "Interrupted" }; $next->(@args); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Interrupt - allows using Ctrl+C to interrupt long-running lines =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [Interrupt] =head1 DESCRIPTION This plugin allows you to use Ctrl+C to interrupt long running commands without exiting the Reply shell entirely. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut LoadClass.pm100644001750001750 252712757202233 16677 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::LoadClass; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::LoadClass::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: attempts to load classes implicitly if possible use base 'Reply::Plugin'; use Module::Runtime 'use_package_optimistically'; use Try::Tiny; sub execute { my $self = shift; my ($next, @args) = @_; try { $next->(@args); } catch { if (/^Can't locate object method "[^"]*" via package "([^"]*)"/) { use_package_optimistically($1); $next->(@args); } else { die $_; } } } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::LoadClass - attempts to load classes implicitly if possible =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [LoadClass] =head1 DESCRIPTION If executing a line of code fails due to a method not being defined on a package, this plugin will load the corresponding module and then try executing the line again. This simplifies common cases like running C<< DateTime->now >> at the prompt before loading L - this plugin will cause DateTime to be loaded implicitly. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut DataDumper.pm100644001750001750 171212757202233 17053 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::DataDumper; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::DataDumper::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: format results using Data::Dumper use base 'Reply::Plugin'; use Data::Dumper; sub new { my $class = shift; $Data::Dumper::Terse = 1; $Data::Dumper::Sortkeys = 1; return $class->SUPER::new(@_); } sub mangle_result { my $self = shift; my (@result) = @_; return Dumper(@result == 0 ? () : @result == 1 ? $result[0] : \@result); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::DataDumper - format results using Data::Dumper =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [DataDumper] =head1 DESCRIPTION This plugin uses L to format results. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut FancyPrompt.pm100644001750001750 230112757202233 17262 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::FancyPrompt; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::FancyPrompt::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: provides a more informative prompt use base 'Reply::Plugin'; sub new { my $class = shift; my $self = $class->SUPER::new(@_); $self->{counter} = 0; $self->{prompted} = 0; return $self; } sub prompt { my $self = shift; my ($next) = @_; $self->{prompted} = 1; return $self->{counter} . $next->(); } sub loop { my $self = shift; my ($continue) = @_; $self->{counter}++ if $self->{prompted}; $self->{prompted} = 0; $continue; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::FancyPrompt - provides a more informative prompt =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [FancyPrompt] =head1 DESCRIPTION This plugin enhances the default Reply prompt. Currently, the only difference is that it includes a counter of the number of lines evaluated so far in the current session. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut ResultCache.pm100644001750001750 346412757202233 17235 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::ResultCache; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::ResultCache::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: retain previous results to be able to refer to them later use base 'Reply::Plugin'; sub new { my $class = shift; my %opts = @_; my $self = $class->SUPER::new(@_); $self->{results} = []; $self->{result_name} = $opts{variable} || 'res'; return $self; } sub execute { my $self = shift; my ($next, @args) = @_; my @res = $next->(@args); if (@res == 1) { push @{ $self->{results} }, $res[0]; } elsif (@res > 1) { push @{ $self->{results} }, \@res; } return @res; } sub mangle_result { my $self = shift; my ($result) = @_; return unless defined $result; return '$' . $self->{result_name} . '[' . $#{ $self->{results} } . '] = ' . $result; } sub lexical_environment { my $self = shift; return { "\@$self->{result_name}" => [ @{ $self->{results} } ] }; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::ResultCache - retain previous results to be able to refer to them later =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [ResultCache] variable = r =head1 DESCRIPTION This plugin caches the results of successful evaluations, and provides them in a lexical array (by default C<@res>, although this can be changed via the C option). This means that you can, for instance, access the value returned by the previous line with C<$res[-1]>. It also modifies the output to include an indication of where the value is stored, for later reference. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut DataPrinter.pm100644001750001750 160112757202233 17237 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::DataPrinter; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::DataPrinter::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: format results using Data::Printer use base 'Reply::Plugin'; use Data::Printer alias => 'p', colored => 1, return_value => 'dump'; sub mangle_result { my ($self, @result) = @_; return unless @result; ( @result == 1 ) && return p($result[0]); return p(@result); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::DataPrinter - format results using Data::Printer =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [DataPrinter] =head1 DESCRIPTION This plugin uses L to format results. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut AutoRefresh.pm100644001750001750 371712757202233 17263 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::AutoRefresh; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::AutoRefresh::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: automatically refreshes the external code you use use base 'Reply::Plugin'; use Class::Refresh 0.05 (); sub new { my $class = shift; my %opts = @_; $opts{track_require} = 1 unless defined $opts{track_require}; Class::Refresh->import(track_require => $opts{track_require}); # so that when we load things after this plugin, they get a copy of # Module::Runtime which has the call to require() rebound to our overridden # copy. if this plugin is loaded first, these should be the only # modules loaded so far which load arbitrary user-specified modules. Class::Refresh->refresh_module('Module::Runtime'); Class::Refresh->refresh_module('base'); return $class->SUPER::new(@_); } sub compile { my $self = shift; my ($next, @args) = @_; Class::Refresh->refresh; $next->(@args); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::AutoRefresh - automatically refreshes the external code you use =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [AutoRefresh] track_require = 1 =head1 DESCRIPTION This plugin automatically refreshes all loaded modules before every statement execution. It's useful if you are working on a module in a file and you want the changes to automatically be loaded in Reply. It takes a single argument, C, which defaults to true. If this option is set, the C functionality from L will be enabled. Note that to use the C functionality, this module must be loaded as early as possible (preferably first), so that other modules correctly see the global override. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut CollapseStack.pm100644001750001750 352512757202233 17561 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::CollapseStack; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::CollapseStack::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: display error stack traces only on demand use base 'Reply::Plugin'; { local @SIG{qw(__DIE__ __WARN__)}; require Carp::Always; } sub new { my $class = shift; my %opts = @_; my $self = $class->SUPER::new(@_); $self->{num_lines} = $opts{num_lines} || 1; return $self; } sub compile { my $self = shift; my ($next, @args) = @_; local $SIG{__DIE__} = \&Carp::Always::_die; $next->(@args); } sub execute { my $self = shift; my ($next, @args) = @_; local $SIG{__DIE__} = \&Carp::Always::_die; $next->(@args); } sub mangle_error { my $self = shift; my $error = shift; $self->{full_error} = $error; my @lines = split /\n/, $error; if (@lines > $self->{num_lines}) { splice @lines, $self->{num_lines}; $error = join "\n", @lines, " (Run #stack to see the full trace)\n"; } return $error; } sub command_stack { my $self = shift; # XXX should use print_error here print($self->{full_error} || "No stack to display.\n"); return ''; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::CollapseStack - display error stack traces only on demand =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [CollapseStack] num_lines = 1 =head1 DESCRIPTION This plugin hides stack traces until you specifically request them with the C<#stack> command. The number of lines of stack to always show is configurable; specify the C option. =for Pod::Coverage command_stack =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut LexicalPersistence.pm100644001750001750 262712757202233 20621 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Pluginpackage Reply::Plugin::LexicalPersistence; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::LexicalPersistence::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: persists lexical variables between lines use base 'Reply::Plugin'; use PadWalker 'peek_sub', 'closed_over'; sub new { my $class = shift; my %opts = @_; my $self = $class->SUPER::new(@_); $self->{env} = {}; return $self; } sub compile { my $self = shift; my ($next, $line, %args) = @_; my ($code) = $next->($line, %args); my $new_env = peek_sub($code); delete $new_env->{$_} for keys %{ closed_over($code) }; $self->{env} = { %{ $self->{env} }, %$new_env, }; return $code; } sub lexical_environment { my $self = shift; return $self->{env}; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::LexicalPersistence - persists lexical variables between lines =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [LexicalPersistence] =head1 DESCRIPTION This plugin persists the values of lexical variables between input lines. For instance, with this plugin you can enter C into the Reply shell, and then use C<$x> as expected in subsequent lines. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Autocomplete000755001750001750 012757202233 16767 5ustar00doydoy000000000000Reply-0.42/lib/Reply/PluginGlobals.pm100644001750001750 713112757202233 21052 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Plugin/Autocompletepackage Reply::Plugin::Autocomplete::Globals; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Autocomplete::Globals::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: tab completion for global variables use base 'Reply::Plugin'; use Package::Stash; use Reply::Util qw($fq_ident_rx $fq_varname_rx); sub new { my $class = shift; my $self = $class->SUPER::new(@_); return $self; } sub tab_handler { my $self = shift; my ($line) = @_; my ($maybe_var) = $line =~ /($fq_varname_rx)$/; return unless $maybe_var; $maybe_var =~ s/\s+//g; my ($sigil, $rest) = $maybe_var =~ /(.)(.*)/; my @parts = split '::', $rest, -1; return if grep { /:/ } @parts; return if @parts && $parts[0] =~ /^[0-9]/; my $var_prefix = pop @parts; $var_prefix = '' unless defined $var_prefix; my $stash_name = join('::', @parts); my $stash = eval { Package::Stash->new(@parts ? $stash_name : 'main') }; return unless $stash; my @symbols = map { s/^(.)main::/$1/; $_ } _recursive_symbols($stash); my $prefix = $stash_name ? $stash_name . '::' . $var_prefix : $var_prefix; my @results; for my $global (@symbols) { my ($global_sigil, $global_name) = $global =~ /(.)(.*)/; next unless index($global_name, $prefix) == 0; # this is weird, not sure why % gets stripped but not $ or @ if ($sigil eq $global_sigil) { push @results, $sigil eq '%' ? $global : $global_name; } elsif ($global_sigil eq '@' && $sigil eq '$') { push @results, "$global_name\["; } elsif ($global_sigil eq '%') { push @results, "$global_name\{"; } } return @results; } sub _recursive_symbols { my ($stash) = @_; my $stash_name = $stash->name; my @symbols; for my $name ($stash->list_all_symbols) { # main can have things in it like "_new(join('::', $stash_name, $name)); next if $next->namespace == $stash->namespace; push @symbols, _recursive_symbols($next); } else { push @symbols, "\$${stash_name}::$name" if $stash->has_symbol("\$$name"); push @symbols, "\@${stash_name}::$name" if $stash->has_symbol("\@$name"); push @symbols, "\%${stash_name}::$name" if $stash->has_symbol("\%$name"); push @symbols, "\&${stash_name}::$name" if $stash->has_symbol("\&$name"); push @symbols, "\*${stash_name}::$name" if $stash->has_symbol($name); } } return @symbols; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Autocomplete::Globals - tab completion for global variables =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [ReadLine] [Autocomplete::Globals] =head1 DESCRIPTION This plugin registers a tab key handler to autocomplete global variables in Perl code. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Methods.pm100644001750001750 322212757202233 21067 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Plugin/Autocompletepackage Reply::Plugin::Autocomplete::Methods; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Autocomplete::Methods::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: tab completion for methods use base 'Reply::Plugin'; use Scalar::Util 'blessed'; use Reply::Util qw($ident_rx $fq_ident_rx $fq_varname_rx methods); sub tab_handler { my $self = shift; my ($line) = @_; my ($invocant, $method_prefix) = $line =~ /($fq_varname_rx|$fq_ident_rx)->($ident_rx)?$/; return unless $invocant; # XXX unicode return unless $invocant =~ /^[\$A-Z_a-z]/; $method_prefix = '' unless defined $method_prefix; my $class; if ($invocant =~ /^\$/) { # XXX should support globals here my $env = { map { %$_ } $self->publish('lexical_environment'), }; my $var = $env->{$invocant}; return unless $var && ref($var) eq 'REF' && blessed($$var); $class = blessed($$var); } else { $class = $invocant; } my @results; for my $method (methods($class)) { push @results, $method if index($method, $method_prefix) == 0; } return sort @results; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Autocomplete::Methods - tab completion for methods =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [ReadLine] [Autocomplete::Methods] =head1 DESCRIPTION This plugin registers a tab key handler to autocomplete method names in Perl code. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Keywords.pm100644001750001750 231612757202233 21276 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Plugin/Autocompletepackage Reply::Plugin::Autocomplete::Keywords; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Autocomplete::Keywords::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: tab completion for perl keywords use base 'Reply::Plugin'; use B::Keywords qw/@Functions @Barewords/; sub tab_handler { my $self = shift; my ($line) = @_; my ($before, $last_word) = $line =~ /(.*?)(\w+)$/; return unless $last_word; return if $before =~ /^#/; # command return if $before =~ /::$/; # Package::function call return if $before =~ /->\s*$/; # method call return if $before =~ /[\$\@\%\&\*]\s*$/; my $re = qr/^\Q$last_word/; return grep { $_ =~ $re } @Functions, @Barewords; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Autocomplete::Keywords - tab completion for perl keywords =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [ReadLine] [Autocomplete::Keywords] =head1 DESCRIPTION This plugin registers a tab key handler to autocomplete keywords in Perl code. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Lexicals.pm100644001750001750 330312757202233 21230 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Plugin/Autocompletepackage Reply::Plugin::Autocomplete::Lexicals; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Autocomplete::Lexicals::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: tab completion for lexical variables use base 'Reply::Plugin'; use Reply::Util qw($varname_rx); sub tab_handler { my $self = shift; my ($line) = @_; my ($var) = $line =~ /($varname_rx)$/; return unless $var; my ($sigil, $name_prefix) = $var =~ /(.)(.*)/; # these can't be lexicals return if $sigil eq '&' || $sigil eq '*'; my $env = { map { %$_ } $self->publish('lexical_environment') }; my @env = keys %$env; my @results; for my $env_var (@env) { my ($env_sigil, $env_name) = $env_var =~ /(.)(.*)/; next unless index($env_name, $name_prefix) == 0; # this is weird, not sure why % gets stripped but not $ or @ if ($sigil eq $env_sigil) { push @results, $sigil eq '%' ? $env_var : $env_name; } elsif ($env_sigil eq '@' && $sigil eq '$') { push @results, "$env_name\["; } elsif ($env_sigil eq '%') { push @results, "$env_name\{"; } } return @results; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Autocomplete::Lexicals - tab completion for lexical variables =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [ReadLine] [Autocomplete::Lexicals] =head1 DESCRIPTION This plugin registers a tab key handler to autocomplete lexical variables in Perl code. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Packages.pm100644001750001750 237512757202233 21212 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Plugin/Autocompletepackage Reply::Plugin::Autocomplete::Packages; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Autocomplete::Packages::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: tab completion for package names use base 'Reply::Plugin'; use Module::Runtime '$module_name_rx'; use Reply::Util 'all_packages'; sub tab_handler { my $self = shift; my ($line) = @_; # $module_name_rx does not permit trailing :: my ($before, $package_fragment) = $line =~ /(.*?)(${module_name_rx}:?:?)$/; return unless $package_fragment; return if $before =~ /^#/; # command return if $before =~ /->\s*$/; # method call return if $before =~ /[\$\@\%\&\*]\s*$/; return sort grep { index($_, $package_fragment) == 0 } all_packages(); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Autocomplete::Packages - tab completion for package names =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [ReadLine] [Autocomplete::Packages] =head1 DESCRIPTION This plugin registers a tab key handler to autocomplete package names in Perl code. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Commands.pm100644001750001750 176412757202233 21236 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Plugin/Autocompletepackage Reply::Plugin::Autocomplete::Commands; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Autocomplete::Commands::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: tab completion for reply commands use base 'Reply::Plugin'; sub tab_handler { my $self = shift; my ($line) = @_; my ($prefix) = $line =~ /^#(.*)/; return unless defined $prefix; my @commands = $self->publish('commands'); return map { "#$_" } sort grep { index($_, $prefix) == 0 } @commands; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Autocomplete::Commands - tab completion for reply commands =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [ReadLine] [Autocomplete::Commands] =head1 DESCRIPTION This plugin registers a tab key handler to autocomplete Reply commands. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut Functions.pm100644001750001750 306612757202233 21442 0ustar00doydoy000000000000Reply-0.42/lib/Reply/Plugin/Autocompletepackage Reply::Plugin::Autocomplete::Functions; our $AUTHORITY = 'cpan:DOY'; $Reply::Plugin::Autocomplete::Functions::VERSION = '0.42'; use strict; use warnings; # ABSTRACT: tab completion for function names use base 'Reply::Plugin'; use Module::Runtime '$module_name_rx'; use Package::Stash; sub tab_handler { my $self = shift; my ($line) = @_; my ($before, $fragment) = $line =~ /(.*?)(${module_name_rx}(::)?)$/; return unless $fragment; return if $before =~ /^#/; # commands my $current_package = ($self->publish('package'))[-1]; my ($package, $func); if ($fragment =~ /:/) { ($package, $func) = ($fragment =~ /^(.+:)(\w*)$/); $func = '' unless defined $func; $package =~ s/:{1,2}$//; } else { $package = $current_package; $func = $fragment; } return map { $package eq $current_package ? $_ : "$package\::$_" } grep { $func ? /^\Q$func/ : 1 } 'Package::Stash'->new($package)->list_all_symbols('CODE'); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Reply::Plugin::Autocomplete::Functions - tab completion for function names =head1 VERSION version 0.42 =head1 SYNOPSIS ; .replyrc [ReadLine] [Autocomplete::Functions] =head1 DESCRIPTION This plugin registers a tab key handler to autocomplete function names in Perl code, including imported functions. =head1 AUTHOR Jesse Luehrs =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2016 by Jesse Luehrs. This is free software, licensed under: The MIT (X11) License =cut