dkimot
dkimot

Reputation: 2289

How to access module version in Crystal Lang?

I see that a frequent convention is to add a file often named version.cr or named after the module it is attached to. Inside of that file, there is a definition of the module with VERSION = "[semver]". How can I access that version?

Upvotes: 0

Views: 90

Answers (1)

Sven
Sven

Reputation: 5265

Using the namespace operator ::, this can be achieved with Module::VERSION where Module is the name of the module you're trying to access it from.

Upvotes: 2

Related Questions