Sha256: 85c33750c80ed4a43b28aa7a6b7569f2b3dcff6f52fc4982d7ff40f0bd57e6e5
Contents?: true
Size: 620 Bytes
Versions: 18
Compression:
Stored size: 620 Bytes
Contents
# frozen_string_literal: true require_relative "../../shakapacker/version" module Shakapacker module Utils class VersionSyntaxConverter def rubygem_to_npm(rubygem_version = Shakapacker::VERSION) regex_match = rubygem_version.match(/(\d+\.\d+\.\d+)[.\-]?(.+)?/) return "#{regex_match[1]}-#{regex_match[2]}" if regex_match[2] regex_match[1].to_s end def npm_to_rubygem(npm_version) match = npm_version .tr("-", ".") .strip .match(/(\d.*)/) match.present? ? match[0] : nil end end end end
Version data entries
18 entries across 18 versions & 1 rubygems