Adds Crystal::Environment
module for querying CRYSTAL_ENV
variable in a
compile-time safe manner.
Add this to your application's shard.yml
:
dependencies:
crystal-environment:
github: Sija/crystal-environment
require "crystal-environment"
Crystal.env.name # => "development"
Crystal.env.development? # => true
Crystal.env.production? # => false
# Defining custom environments
Crystal.env.staging? # Throws compile-time error
Crystal::Environment.setup %i(staging)
Crystal.env.staging? # => true
- Fork it
- 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
- @Sija Sijawusz Pur Rahnama - creator, maintainer