Sha256: 67a4cf03971439cd685cbf9f2f71f38e03478c29200ef34b8c0c6397b257537e
Contents?: true
Size: 497 Bytes
Versions: 40
Compression:
Stored size: 497 Bytes
Contents
# frozen_string_literal: true require_relative "version" 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
Version data entries
40 entries across 40 versions & 1 rubygems