crystal-environment v0.1.0

Crystal::Environment

crystal-environment CI Releases License

Adds Crystal::Environment module for querying CRYSTAL_ENV variable in a compile-time safe manner.

Installation

Add this to your application's shard.yml:

dependencies:
  crystal-environment:
    github: Sija/crystal-environment

Usage

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

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • @Sija Sijawusz Pur Rahnama - creator, maintainer
Repository

crystal-environment

Owner
Statistic
  • 6
  • 1
  • 0
  • 1
  • 1
  • 6 months ago
  • November 2, 2017
License

MIT License

Links
Synced at

Mon, 06 May 2024 15:48:31 GMT

Languages