1
0
mirror of https://github.com/danbee/dotfiles-local synced 2025-03-04 08:49:07 +00:00
dotfiles-local/bin/tools_lib/tools_file.rb
2018-01-22 22:17:56 -05:00

25 lines
307 B
Ruby

require_relative "empty_file"
class ToolsFile
def initialize
end
def tools
@tools ||= format_tools
end
private
def format_tools
Hash[tools_file.lines.map do |tool|
tool.split
end]
end
def tools_file
File.read(".tool-versions")
rescue
EmptyFile.new
end
end