Git Product home page Git Product logo

justprep's Introduction

just v1.19+ has Includes and Modules!

import: just allows for recursive imports whereas justprep does not.

mod: feature in just may be a little unstable but still worth checking out.

I am looking forward to when I can declare justprep a dead project because its features have been fully implemented in the main just application.

Just a quick notice that the brew workflow and formula for justprep are not working. Ypu can download the latest crystal binary release.

justprep

Just a CLI pre-processor tool for task runners like "just" my current favorite.

justprep is implemented as a Ruby gem and as a Crystal binary. A large part of the code base is shared between Ruby and Crystal. These common files have the file extension *.crb to indicate that they are both Crystal and Ruby.

There is no specific speed benchmark between the two implementations. I can't perceive any specific speed of processing differences between the two implementations with the small sets of task files that I use. Its really a matter of your project workflow. If your projects are primarily Ruby, then install the Ruby gem version. If you do not primarily use Ruby (why not? Its a GREAT language!) then install the Crystal version.

TL;DR Examples and you should look through the wiki for inspiration.

See the CHANGELOG for recent changes.

Installation for the Ruby version

gem install justprep

Installation for the Crystal version

brew tap madbomber/justprep
brew install --build-from-source justprep

Ypu can also download a binary release.

Documentation

Since this capability is implemented in both Ruby and Crystal there is only one set of documentation. Both implementations act the same way. See the repository's Wiki for details.

CLI Task Runners Supported

Command-line options/flags

  FLAGS:
      --version   Shows the current version
  -h, --help      Displays this usage message
      --no-brag   Do not add header/footer around included content

See the wiki for details on what the --no-brag option does.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/MadBomber/justprep.

If you have a different CLI task runner than what justprep currently supports, let me know so we can add it to the support list.

License

justprep is available as open source under the terms of the MIT License.

justprep's People

Contributors

fncontroloption avatar lutostag avatar madbomber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

justprep's Issues

GEM: An error in the filename does not set exit status correctly

A justprep include file missing message does not set the exit status correctly. It should be set to 1 so that the follow-on execution of just is abored. This is true in the RubyGem version. Check the Crystal version to verify exit status is set correctly there.

Consider directory processing

As part of that exploration of alternate uses ...

What if JUSTPREP_FILENAME_IN and JUSTPREP_FILENAME_OUT were directories not files.

  1. FIXME: I don't think they are actually checked to see that they are a file only that they exist.

  2. Both would have to be directories or both files. when not then its an error

  3. all files from the input directory are copied to the output directory with their included content. If a file does not have any inclusionary keywords then it is copied as is.

brew formula needs to have bottles

The command brew tap madbomber/brews is working with an install like brew install --build-from-source justprep

Greg was able to get bottles setup in his formula. I'm guessing that it had something to do with a github workflow action.

Fix typo in README.md file

Near the bottom of the README.md file in the Limitations section

reads: ... file must be preset
should read: ... file must be present

add flag to turn off begin/end lines for the included content.

Part of that idea from the wiki on alternate uses.

Keeping the same concept of using envar for config ...

JUSTPRE_INCLUDE_MARKERS with default "on" || some truthy value
That would be the status quo.

When its "off" || some falsey value then the begin/end marker lines for included text are not inserted into the output file.

Investigate Hierarchical Layering

Consider a directory tree that looks like this:

home
├── main.just
└── projects
    ├── main.just
    ├── thing_one
    │   └── main.just
    └── thing_two
        └── main.just

Now suppose you have CD'ed into your thing_two project. What you may have is an explicit inclusion of all of the upper-level main.just files so that at the lowest level all the defined recipes are available. BUT if there was an implicit hierarchical layering in effect the upper level main.just files would be implicitly included.

However, sometimes implicit inclusion can lead to trouble. So is it worth considering?

With implicit layering you have access to all recipes that have been defined in the directory path with their lower-level over-rides.

You have the ability to do the same thing currently with explicit inclusions. A potential problem occurs when you move a directory from one path tree to another. But because of the explicit nature of the inclusions, the justfiles generated will include recipes that may no longer be appropriate.

Implement the FAKE module convention

setup "module" as a special keyword such that:

module path/to/my_mod/justfile

is replaced by:

module_my_mod := "path/to/my_mod/justfile"

and a new recipe for that module is added at the end of the current justfile that is being generated like this:

# Module my_mod
@my_mod what='' args='':
  just -f {{module_my_mod}} {{what}} {{args}}

Use an system environment variable $JUSTPREP_MODULE_KEYWORD to designate the keyword to be used for module processing.

Add support for the "run" CLI task runner

Why not? It is a minor modification to support run.

Use a new system environment variable: JUSTPREP_FOR=run
Then in the fake module system use the content of $JUSTPREP_FOR as the command to execute. Will also need to customize the param to support pointing to a different Runfile than the default.

easy-peasy

Target this for release v1.2.4

Investigate Recursion

Currently the software supports only a single-level inclusion process. Consider allowing the included files also designate files for inclusion. Lookout for cycles. Maybe limit number of levels to some small number to avoid stack overflows.

Add a Homebrew Formula

Look at adding a formula for homebrew to support the easy installation of the crystal version of the software.

add -d . to just command line for module processing

The auto generated recipe for a module has a single line that invokes just and the specific justfile that may be outside of the local working directory hierarchie. Need to add "-d ." to the just command line parameters in order for the module recipes to be executed in the correct location.

Needs to look like this:

# Module gem
@gem what='' args='':
  just -d . -f {{module_gem}} {{what}} {{args}}

Automatic built releases

Hey @MadBomber. First off wanted to say thanks for working on a great project!

Appreciate you thinking about how to include other justfiles in a clean way that is usable right now!

I've been using it for a while now for my personal projects -- but some folks I have been talking with about justprep have a hard time to install it.

Would you be interested if I setup some automatic github actions to build binaries for folks (starting with the crystal one) whenever you cut a new release?

I would like to help out if possible, but first just 😉 wanted to check if that was something you would appreciate!

If not that is fine too. Appreciate your work!

refactor both gem and crystal code

There is some refactoring that can be of benefit. For example, create a method to standardize the error message format.

Also it might be interesting to extract out those methods between ruby and crystal that have common source code to both.

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.