• Stars
    star
    5
  • Rank 2,774,592 (Top 57 %)
  • Language
    Crystal
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The simplest YAML to ENV config loader in Crystal

Envyable

The simplest yaml to ENV config loader.

Build status

Envyable takes a config YAML file and loads the entries into your ENV hash. Keep your development environment clean of application specific configuration.

Installation

It is only recommended that you use Envyable in your development environment. There are better ways to set environment variables in production.

Add this to your application's shard.yml:

development_dependencies:
  envyable:
    github: philnash/envyable.cr

Usage

You will need a YAML file which contains your application config. I like to use config/env.yml. Put your default settings in the root and then override them on an environment by environment basis.

Example YAML file

The following YAML file sets the API_CLIENT_ID in all environments to "development-id" then overrides it in the test environment to "test-id".

API_CLIENT_ID: development-id
test:
  API_CLIENT_ID: test-id

Load the configuration

To load the configuration you just need to require the library and then call load.

require "envyable"
Envyable.load("path/to/yml", "development")

All config is loaded as a string.

By default the development environment will be loaded. If you have a config file called env.yml in the config directory and you wanted to load the development environment, then you would include the following:

require "envyable"
Envyable.load("./config/env.yml")

Version control

It is not recommended that you check the YAML file in to version control. I like to check in a env.yml.example file that shows the required keys, but does not include any credentials.

Contributing

  1. Fork it ( https://github.com/philnash/envyable.cr/fork )
  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

More Repositories

1

bitly

🗜 A Ruby wrapper for the bit.ly API
Ruby
447
star
2

pwned

😱 An easy, Ruby way to use the Pwned Passwords API.
Ruby
360
star
3

react-express-starter

A starter kit for React applications with a back end server all in the same project
JavaScript
179
star
4

react-web-audio

A small example React app that listens to the microphone and visualises the audio
JavaScript
163
star
5

mediadevices-camera-selection

🎥 Examples on how to switch devices with the mediaDevices API
JavaScript
162
star
6

twilio-video-react-hooks

A video chat application built with Twilio Video and React Hooks
JavaScript
105
star
7

screen-capture

An exploration of screen capture in browsers.
JavaScript
103
star
8

ngrok-for-vscode

🚇 A VSCode extension to control ngrok from the command palette
TypeScript
103
star
9

meta-spotify

[deprecated] A ruby wrapper for the Spotify Metadata API
Ruby
84
star
10

envyable

The simplest yaml to ENV config loader.
Ruby
76
star
11

sms-messages-app

A web powered SMS Messages app you can use with a Twilio number
CSS
69
star
12

web-assistant

A collection of experiments building towards a browser powered assistant
HTML
65
star
13

crotp

CrOTP - One Time Passwords for Crystal
Crystal
62
star
14

useful-twilio-functions

A set of useful Twilio Functions.
JavaScript
53
star
15

video-chat

An example of setting up basic video chat with WebRTC, node.js and Twilio
JavaScript
37
star
16

jekyll-gzip

Generate gzipped assets and files for your Jekyll site at build time
Ruby
35
star
17

react-twilio-phone

A Twilio Client based web phone, built with React
JavaScript
34
star
18

philna.sh

Phil Nash's personal site and blog
Astro
33
star
19

bulk-sms-alerts

An example of sending one, a few and many SMS messages using the Twilio APi
JavaScript
33
star
20

send-sms-react-twilio

An example React application that can send SMS messages via the Twilio API
JavaScript
32
star
21

react-programmable-chat

A React example of Twilio Programmable Chat
JavaScript
29
star
22

web-share-wrapper

A web component that wraps other share elements to replace with a web share button where supported.
JavaScript
22
star
23

twilio-video-svelte

A Twilio Video application built with Svelte
Svelte
21
star
24

whats_playing

Collaborative playlists over WhatsApp with Twilio and Spotify
Ruby
21
star
25

first-twilio-video-application

A demo of Twilio Video for the Build your first Twilio Video application webinar.
JavaScript
20
star
26

ruby-whatsapp-bots

A repo of WhatsApp bots built in Ruby
Ruby
19
star
27

ruby-google-sheets-sinatra

An example app using Ruby, Google Sheets and Sinatra
HTML
18
star
28

twiml_template

TwiML templates for Rails and Tilt.
Ruby
17
star
29

quote-bot

A bot built with Twilio SMS and Claudia Bot Builder
JavaScript
15
star
30

jekyll-brotli

Generate brotli compressed assets and files for your Jekyll site at build time
Ruby
15
star
31

twilio-chat-kendo-react

An example Twilio Programmable Chat application application using React and KendoReact Conversational UI
JavaScript
14
star
32

service-worker-background-fetch

A proof of concept of the background fetch API
HTML
12
star
33

guybot

A mighty pirate (and Twitter bot)
Ruby
12
star
34

jekyll-zopfli

Generate gzipped assets and files for your Jekyll site at build time using Zopfli compression
Ruby
12
star
35

ruby-quick-test

Run ruby test files quickly in Atom
CoffeeScript
12
star
36

jekyll-web_monetization

A Jekyll plugin to add Web Monetization API payment pointers to your site
Ruby
10
star
37

whatsapp-bot-capabilities

An example of a WhatsApp bot that can respond to location messages and can send images, vcards and location messages
JavaScript
9
star
38

pwned.js

An easy, promise based, way to test passwords securely against the Pwned Passwords API v2 in Node.js.
TypeScript
9
star
39

leap-motion-experiments

JavaScript
9
star
40

the-web-is-getting-pushy

An example of push notifications and service workers
JavaScript
9
star
41

web-monetization-components

A collection of web components you can use on your web monetized websites.
HTML
8
star
42

twilio-video-screen-sharing

JavaScript
8
star
43

community-sms-broadcast

An application that you can use to broadcast SMS messages to people listed on a Google Spreadsheet, powered by Twilio Functions and Twilio Programmable SMS
JavaScript
8
star
44

jsconf-schedule

An offline HTML schedule for JSConf EU
CSS
8
star
45

time-formatter

A web component that converts a date time into your user's time zone and formats it locally.
HTML
7
star
46

twilio-fax-ruby-sinatra

An application to send faxes with the Twilio Fax API
Ruby
7
star
47

jekyll-mastodon_webfinger

A Jekyll plugin that adds a WebFinger file to your site, allowing you to use your own domain to help others discover your Mastodon profile.
Ruby
7
star
48

twitter-sms

Send and receive tweets by SMS
Ruby
7
star
49

web-otp-input

A custom element to make it really easy to use the WebOTP API
JavaScript
6
star
50

super-secret-puppies

Ruby
6
star
51

tatooine

A Ruby interface to SWAPI (the Star Wars API).
Ruby
6
star
52

rails-phone-number-verification

An example application for verifying phone numbers in a Rails application.
Ruby
6
star
53

phism

A video collaboration app that we're building on Twitch: https://twitch.tv/phil_nash
JavaScript
5
star
54

whatrtc

WhatRTC? Everything you need to know to connect browsers to the world.
CSS
5
star
55

github-weekends

A silly browser extension that marks weekend contributions on GitHub's contribution graph in red
JavaScript
5
star
56

ship-it

Don't just comment, ship it.
JavaScript
5
star
57

sendgrid-email-status

A Rails application that sends emails via the SendGrid API and tracks their status
Ruby
4
star
58

fxrates-ios

A currency exchange rate calculator for iOS, written in Swift
Swift
4
star
59

getUserMedia

An example of using getUserMedia
JavaScript
4
star
60

advent-of-code

Advent of Code 2017-2020 solutions in Crystal
Crystal
4
star
61

twilio-video-chat-web-component

A Web Component version of Twilio Video [deprecated]
HTML
4
star
62

omg

Quick and dirty debugging any ruby!
Ruby
4
star
63

collabify

CSS
4
star
64

sms-bulb

HTML
4
star
65

celebrity-spotting

A Sinatra app that takes images from the Twilio API for WhatsApp and uses AWS Rekognition to spot celebrities
Ruby
4
star
66

ynfb

YNFB
Ruby
3
star
67

elixir-examples

Elixir
3
star
68

twiml_template_example

Examples on using the twiml_template gem
Ruby
3
star
69

contact-picker-twilio-client

A browser based phone that uses the Contact Picker API
JavaScript
3
star
70

fun-with-getusermedia

Fun with getUserMedia
JavaScript
2
star
71

exploring-amp-email

A collection of projects implementing AMP email with SendGrid
JavaScript
2
star
72

hubot-twilio-ip-messaging

A Hubot adapter for Twilio IP Messaging
CoffeeScript
2
star
73

four-steps-from-javascript-to-typescript

JavaScript
2
star
74

thereminjs

JavaScript
2
star
75

philnash

philnash/philnash is philnash's repo about philnash
JavaScript
2
star
76

jira-twilio-plugins

HTML
2
star
77

twilio-client-and-accessibility

Exploring accessiblity and Twilio Client
Ruby
2
star
78

superclass-twilio-video-demo

A demo of Twilio Video for Superclass 2019
JavaScript
2
star
79

ng-sms-messages

An SMS application for Twilio, written with Angular and Service Workers
TypeScript
2
star
80

video-collaboration

An application using Twilio Video implementing various collaboration features
JavaScript
2
star
81

advanced-twilio-video

An example of using some advanced Twilio Video features to improve the user experience
JavaScript
2
star
82

twilio-liftoff

The example code for the Twilio Liftoff webinar series
JavaScript
2
star
83

sms-messages-hanami

An example application for receiving and responding to SMS messages from Twilio in Hanami
Ruby
2
star
84

pirate-api

🏴‍☠️ An API wrapper for translating from English to Pirate and generating pirate insults ☠️
TypeScript
2
star
85

worlds-worst-synth

The world's worst synth
JavaScript
2
star
86

dad-jokes-cli

A CLI for getting Dad Jokes
JavaScript
1
star
87

twilio-typescript-examples

Examples of using Twilio with TypeScript
TypeScript
1
star
88

crystal-experiments

Crystal Experiments with the Twilio API
Crystal
1
star
89

install-service-worker

Three different ways to install a service worker
HTML
1
star
90

WindowSize

A bookmarklet to get the current height and width of the viewport
JavaScript
1
star
91

todomvc-indexeddb

A vanilla JS implementation of TodoMVC with an IndexedDB data store
JavaScript
1
star
92

taskrouter_priority

A priority call centre built with Twilio TaskRouter
Ruby
1
star
93

Sheenboard

1
star
94

bluemix-twilio-alchemy

HTML
1
star
95

discogs-scanner

A web app to scan records and add them to your Discogs collection
Svelte
1
star
96

twilio-autopilot-competition-entry-bot

The back-end Twilio Functions for a Twilio Autopilot bot that asks questions and enters people into a competition
JavaScript
1
star
97

react-js-to-ts

An example application to move from JS to TS in React
JavaScript
1
star
98

rainbow

A silly demo of device orientation events
1
star
99

asst

A command line interface for OpenAI's ChatGPT written in JavaScript
JavaScript
1
star
100

growler_alerts_starter

HTML
1
star