-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use shards version in crystal init tool
`shards version` is a new shards command which finds a `shard.yml` in the directory tree above the path given and returns the version specified in it. We can use it here to automatically generate the version constant for libraries directly from shard.yml, meaning it will never be out of sync. The `VERSION` constant is also moved into the main library file, instead of being placed in a separate `version.cr`. The old `version.cr` convention persisted from ruby due to the need for gemspec files to require only the version constant from the library.
- Loading branch information
Showing
4 changed files
with
5 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
require "./<%= config.name %>/*" | ||
|
||
# TODO: Write documentation for `<%= module_name %>` | ||
module <%= module_name %> | ||
VERSION = {{ `shards version #{__DIR__}`.chomp.stringify }} | ||
|
||
# TODO: Put your code here | ||
end |
This file was deleted.
Oops, something went wrong.