From 09bb1fcd4073a374b3a61c99e48e05a866b23c08 Mon Sep 17 00:00:00 2001 From: "Lewis E. Bogan" Date: Sun, 15 Jul 2018 19:55:53 -0700 Subject: [PATCH] add a VERSION constant (#471) --- spec/config_spec.cr | 8 ++++++++ src/kemal/config.cr | 2 ++ 2 files changed, 10 insertions(+) diff --git a/spec/config_spec.cr b/spec/config_spec.cr index 9ea27bc..65c44e7 100644 --- a/spec/config_spec.cr +++ b/spec/config_spec.cr @@ -54,4 +54,12 @@ describe "Config" do Kemal::CLI.new test_option.should eq("FOOBAR") end + + it "returns a string" do + Kemal::VERSION.should be_a(String) + end + + it "gets the version from shards.yml" do + Kemal::VERSION.should eq("0.23.0") + end end diff --git a/src/kemal/config.cr b/src/kemal/config.cr index d865c5e..508ec36 100644 --- a/src/kemal/config.cr +++ b/src/kemal/config.cr @@ -1,4 +1,6 @@ module Kemal + VERSION = {{ `shards version #{__DIR__}`.chomp.stringify }} + # Stores all the configuration options for a Kemal application. # It's a singleton and you can access it like. #