Sha256: b4a85c2b8248319e33d352cb181edd7e42fa7a7036dad672a21df664b60d52f6
Contents?: true
Size: 635 Bytes
Versions: 56
Compression:
Stored size: 635 Bytes
Contents
# encoding: utf-8 require 'json' require 'fedux_org_stdlib/version_management/exceptions' module FeduxOrgStdlib # Version management module VersionManagement # Ruby version file parser class RubygemVersionFileParser attr_reader :version, :modules def parse(file) data = File.read(file) @version = data.match(/(?:VERSION|Version)\s+=\s+["']([^'"]+)["']/) { Regexp.last_match[1] } @modules = data.scan(/^\s*module\s+([A-Z][A-Za-z0-9]+(?:::[A-Z][A-Z0-9a-z]+)*)$/x).flatten fail Exceptions::VersionFileInvalid, JSON.dump(file: file) if version.blank? end end end end
Version data entries
56 entries across 56 versions & 1 rubygems