mirror of
https://gitea.invidious.io/iv-org/shard-radix.git
synced 2024-08-15 00:43:21 +00:00
Add VERSION constant for runtime usage
Introduce `Radix::VERSION` to be used at runtime by users of the library for any purpose this will help them (expose them, use conditional blocks or similar). Also add spec that checks that defined versions in both `shard.yml` and `Radix::VERSION` matches to avoid messing up releases.
This commit is contained in:
parent
54d3b627a2
commit
77789be285
4 changed files with 20 additions and 0 deletions
|
@ -5,6 +5,8 @@ This project aims to comply with [Semantic Versioning](http://semver.org/),
|
|||
so please check *Changed* and *Removed* notes before upgrading.
|
||||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- Introduce `Radix::VERSION` so library version can be used at runtime.
|
||||
|
||||
## [0.3.0] - 2016-04-16
|
||||
### Fixed
|
||||
|
|
14
spec/radix/version_spec.cr
Normal file
14
spec/radix/version_spec.cr
Normal file
|
@ -0,0 +1,14 @@
|
|||
require "../spec_helper"
|
||||
require "yaml"
|
||||
|
||||
module Radix
|
||||
describe VERSION do
|
||||
it "matches version defined in shard.yml" do
|
||||
contents = File.read(File.expand_path("../../../shard.yml", __FILE__))
|
||||
meta = YAML.parse(contents)
|
||||
|
||||
meta["version"]?.should_not be_falsey
|
||||
Radix::VERSION.should eq(meta["version"].as_s)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1 +1,2 @@
|
|||
require "./radix/tree"
|
||||
require "./radix/version"
|
||||
|
|
3
src/radix/version.cr
Normal file
3
src/radix/version.cr
Normal file
|
@ -0,0 +1,3 @@
|
|||
module Radix
|
||||
VERSION = "0.3.0"
|
||||
end
|
Loading…
Reference in a new issue