sentry-run
A shard using Sentry for reload code changes with Sentry.run.
Installation
Add this to your application's shard.yml:
development_dependencies:
sentry-run:
github: faustinoaq/sentry-run
Then run shards update.
Usage
require "kemal"
require "sentry-run"
get "/" do
"Hello world"
end
Sentry.config(files: ["src/app.cr"]) # => optional
Sentry.run do
Kemal.run
end
You can use Sentry.run for recompile and reload your code without external sentry.cr.
Also you can use Sentry.config:
Sentry.config(files: ["src/app.cr"])
# Default values
# process_name = "App"
# build_command = "crystal build #{__FILE__}"
# run_command = "./#{File.basename(__FILE__, ".cr")}"
# build_args = [] of String
# run_args = [] of String
# files = ["src/**/*.cr", "src/**/*.ecr"]
# should_build = true
How does it work?
Basically this shard checks a sentry.lock file.
When you run your code Sentry.run create a sentry.lock and then yield a block. After a code change Sentry recompiles your file and rerun a new app instance with run_command in Sentry.config.
Contributing
- Fork it ( https://github.com/faustinoaq/sentry-run/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
Disclaimer
Sentry.run is intended for use in a development environment.
Contributors
- faustinoaq Faustino Aguilar - creator, maintainer