123456789_123456789_123456789_123456789_123456789_

Class: Selenium::Support::NightlyVersionGenerator Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: rb/lib/selenium/support/nightly_version_generator.rb

Overview

Updates version in version.rb file with nightly suffix:

- VERSION = '4.6.1'
+ VERSION = '4.6.1.nightly.20221126'

Constant Summary

Class Method Summary

Class Method Details

.call(version_file, version_suffix)

[ GitHub ]

  
# File 'rb/lib/selenium/support/nightly_version_generator.rb', line 35

def self.call(version_file, version_suffix)
  version_suffix ||= Date.today.strftime('%Y%m%d')
  version_file_contents = File.read(version_file)
  version_file_contents.gsub!(REGEXP) do
    old_version = Regexp.last_match(1)
    new_version = [old_version, version_suffix].join('.')
    puts("#{old_version} -> #{new_version}")

    "VERSION = '#{new_version}'"
  end

  File.write(version_file, version_file_contents)
end