Skip to content

Sija/crystal-environment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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