Module: EndOfLife::RubyVersion::Parser

Extended by:
Parser
Included in:
Parser
Defined in:
lib/end_of_life/ruby_version/parser.rb

Instance Method Summary collapse

Instance Method Details

#parse_file(file_name:, content:) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/end_of_life/ruby_version/parser.rb', line 9

def parse_file(file_name:, content:)
  if file_name == ".ruby-version"
    parse_ruby_version_file(content)
  elsif file_name == "Gemfile.lock"
    parse_gemfile_lock_file(content)
  elsif file_name == "Gemfile"
    parse_gemfile_file(content)
  elsif file_name == ".tool-versions"
    parse_tool_versions_file(content)
  else
    raise ArgumentError, "Unsupported file #{file_name}"
  end
end