For installing ruby, we'd like to minimize the number of locations that would need to be manually updated to declare the ruby version.
For most ruby projects, it's very common to have a .ruby-version that contains the version. When someone does a hermit instally ruby that files could potentially deviate. That file is commonly used by ruby version managers like rvm and rbenv, and while hermit would/could be replacing those there are other situations that that file may be used such as in custom CI scripting.
One option that appears possible is to use the on events (as described here) to write a .ruby-version file with the version.
Using that feature, we might be able to do something like this:
on "install" {
run {
cmd = "echo ${version} >> .ruby-version"
}
}
That would apply to all installations of ruby, even ones that may not wish to use or preserve a .ruby-version file. We could augment this to conditionally update a .ruby-version file if it's present and not create it if it doesn't exist.
Using run also doesn't seem as structured as the existing set of built-in set of triggers. We could add a trigger called write and give it more options:
on "install" {
write {
content = "${version}"
file = ".ruby-version"
only-if = "exists"
}
}
For installing ruby, we'd like to minimize the number of locations that would need to be manually updated to declare the ruby version.
For most ruby projects, it's very common to have a
.ruby-versionthat contains the version. When someone does ahermit instally rubythat files could potentially deviate. That file is commonly used by ruby version managers like rvm and rbenv, and while hermit would/could be replacing those there are other situations that that file may be used such as in custom CI scripting.One option that appears possible is to use the
onevents (as described here) to write a.ruby-versionfile with the version.Using that feature, we might be able to do something like this:
That would apply to all installations of ruby, even ones that may not wish to use or preserve a
.ruby-versionfile. We could augment this to conditionally update a .ruby-version file if it's present and not create it if it doesn't exist.Using
runalso doesn't seem as structured as the existing set of built-in set of triggers. We could add a trigger calledwriteand give it more options: