<NME> version_syntax_converter.rb
<BEF> require_relative "version"

class VersionSyntaxConverter
  def rubygem_to_npm(rubygem_version)
    rubygem_version ||= ReactOnRails::VERSION
    regex_match = rubygem_version.match(/(\d+\.\d+\.\d+)[.\-]?(.+)?/)
    if regex_match[2]
      return "#{regex_match[1]}-#{regex_match[2]}"
      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

<MSG> improve README

<DFF> @@ -1,8 +1,7 @@
 require_relative "version"
 
 class VersionSyntaxConverter
-  def rubygem_to_npm(rubygem_version)
-    rubygem_version ||= ReactOnRails::VERSION
+  def rubygem_to_npm(rubygem_version = ReactOnRails::VERSION)
     regex_match = rubygem_version.match(/(\d+\.\d+\.\d+)[.\-]?(.+)?/)
     if regex_match[2]
       return "#{regex_match[1]}-#{regex_match[2]}"

{'addition_count': 1, 'commit_subject': 'improve README', 'deletion_count': 2, 'file_extension': '.rb', 'lang': 'rb', 'license': 'mit', 'repo_name': 'shakacode/react_on_rails'}