Sha256: ecc90f6501588f6d5380707371195e0343fa8edbf46de1c20a9036e7839cbf41
Contents?: true
Size: 549 Bytes
Versions: 61
Compression:
Stored size: 549 Bytes
Contents
# frozen_string_literal: true require_relative "version" module ReactOnRails class VersionSyntaxConverter def rubygem_to_npm(rubygem_version = ReactOnRails::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
Version data entries
61 entries across 61 versions & 1 rubygems