require_helpers.cr
Requiring with relative paths is brittle and often hard to read. Rather than typing this:
require "../../my/file"
You can do this
require_src "my/file"
Installation
Add this to your application's shard.yml
:
dependencies:
require_helpers:
github: paulcsmith/require_helpers.cr
Usage
Add this to your project to require the helper macros.
require "require_helpers"
Then you can use these macros in your project.
require_src
for requiring a file in your project'ssrc
directory.require_spec
for requiring a file in your project'ssrc
directory.require_wd
for requiring a file from your project's current working directory.require_src
andrequire_spec
use this macro under the hood.
Contributing
- Fork it ( https://github.com/paulcsmith/require_helpers/cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- paulcsmith Paul Smith - creator, maintainer