0.0
No commit activity in last 3 years
No release in over 3 years
Simple command to discover what should be in ASDF's .tool-versions file
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

asdf-discover

A gem that provides an executable to populate asdf's .tool-versions file.

Changelog

Changelog following https://keepachangelog.com

Installation

$ gem install asdf-discover

Usage

Run asdf-discover in a project directory.

Languages / Versions Discovered

Lanuage File
Go go.mod
Ruby .ruby-version
Ruby .rvmrc
node.js .nvmrc
node.js .node-version

TODO

  • If a version comes from multiple sources, list them all (currently displays the first found)

  • Select a version from asdf list tool for versions specified with a requirement, e.g. "~> 1.10"

  • There seems to be 2 ways to find a version:

    • The contents of a file (e.g. .ruby-version)
    • A line in a file (e.g. go.mod)

    Consider a DSL for adding more:

    class GoMod
      include Asdf::Searcher
    
      scan_file "go.mod", for: /go ([0-9.]+)$/
    end
    
    class DotRubyVersion
      include Asdf::Searcher
    
      file_contents ".ruby-version"
    end

Development

After checking out the repo, run bundle install. Then, run rake spec to run the tests.

You can run the binary locally with: ruby -Ilib ./exe/asdf-discover path/to/directory

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jmks/asdf-discover.

License

The gem is available as open source under the terms of the MIT License.