Git Product home page Git Product logo

app-prt's People

Contributors

cxw42 avatar hitode909 avatar ishikawa avatar miyagawa avatar moznion avatar syohex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

app-prt's Issues

Find project root directory based on Makefile.PL or Build.PL in addition to cpanfile

Currently, App::PRT::Collector::AllFiles::find_project_root_directory() only looks for cpanfile to determine the project root. However, this means that it cannot find non-cpanfile, non-git clone project roots. Example repro:

Expected output: names of files in ., lib, t, xt

Observed output: Cannot decide target files at <...>/site_perl/5.26.2/App/PRT/CLI.pm line 57.

I think the fix may be as simple as changing this to:

if (-e $current->file('cpanfile') || -e $current->file('Makefile.PL') || -e $current->file('Build.PL')) {

What do you think? Thanks!

This is awesome!

I just wanted to say, prt is wonderful. I can't wait to see how this project evolves.

Request: support -h/--help again

I see that prt help was removed in #31. However, would it be possible to special-case -h/--help to invoke pod2usage? I just tripped over that. I am willing to send a PR if you are open to this idea. Please let me know either way. Thanks!

Make prt act like a git command

It seems like the prt command has a little unusual CLI interface where it takes the command name, then arbitrary length of arguments to the command, and finally filenames.

I wonder if this could be made simpler if prt command works against a work directory, much like git, so when you run prt rename_class Foo Bar it renames the package Foo to Bar in all perl files (by default *.pm and *.t) under the current directory.

To get this one step further, prt could actually be more "git-aware" in a way that:

  • detects project root directory by looking for .git/ directory (could be also useful to avoid accidental file overwrites against wrong files)
  • git command integration such as git mv when renaming files
  • only handles files in the git source tree (i.e. git ls-files)

This is just a thought.

Maybe the default prt command shouldn't limit the scope of commands in a way git is a requirement, but majority of use case will benefit from git being more tightly integrated. (There could probably git-prt shell wrapper, so that you can do git prt rename_class ...)

Why does t::test call `use lib`?

Test module t::test calls use lib to add lib/ to @INC regardless of run configuration. From here:

use lib file(__FILE__)->dir->parent->subdir('lib')->stringify;

Why is that? I commented it out and can still run ./Build test, PERL_USE_UNSAFE_INC=1 prove -l, and PERL_USE_UNSAFE_INC=1 minil test successfully on Perl 5.26.2.

The reason I ask is that I am working on the tests for #40, and I want to detect whether we are running from lib/ or blib/. With the above line in t::test, lib is included ahead of blib.

Would you please let me know why that line was added, if you happen to remember? If you are not sure, may I suggest removing it? Thanks!

Should prt itself have the capability to glob? [discussion, enhancement]

This relates to https://github.com/hitode909/App-PRT/blob/master/lib/App/PRT/CLI.pm#L72-L75 . In my testing,

$ prt list_files 'lib/**/*.pm'
lib/**/*.pm does not exist at lib/App/PRT/Collector/Files.pm line 17.

However,

shopt -s globstar; prt list_files lib/**/*.pm

works fine, because the shell expands the wildcards.

Should prt itself be able to expand wildcards? In #36 (comment) , @hitode909 mentioned

File::Zglob may resolve the glob issue. I'll try this module later.

I know there is also https://metacpan.org/pod/File::Globstar .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.