Version From Shard
A macro to declare the VERSION constant from the value found in
shard.yml, so you don't need to write the same version number in multiple places.
Add the dependency to your
dependencies: version: github: hugopl/version_from_shard
require "version_from_shard" module MyAwesomeApp VersionFromShard.declare end puts MyAwesomeApp::VERSION # Should print the version value found in shard.yml, e.g. "1.0.0"
If you are compiling a development version, i.e. not a tagged commit, the version will try to use
git describe --tags output (ignoring tag prefixes) for the version string. If git isn't found or someone is compiling the project from a tarball, normal version will be used.
version: 1.0.0 on your shard.yml file but your master branch is 1 commit ahead of the tag named
v1.0.0 that you released yesterday, in this case VersionFromShard.declare will declare a VERSION constant with the value
g2dd5299 is the current commit hash.
Suggestions are welcome.
- Fork it (https://github.com/hugopl/version_from_shard/fork)
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
- Hugo Parente Lima - creator and maintainer
- about 1 month ago
- October 28, 2019
Fri, 28 Feb 2020 03:01:43 GMT