lib/makit/version.rb in makit-0.0.52 vs lib/makit/version.rb in makit-0.0.53
- old
+ new
@@ -1,9 +1,9 @@
# frozen_string_literal: true
module Makit
- VERSION = "0.0.52"
+ VERSION = "0.0.53"
class Version
# given an array of version strings, return the highest version
def self.get_highest_version(versions)
versions.sort { |a, b| Gem::Version.new(a) <=> Gem::Version.new(b) }.last
@@ -55,8 +55,14 @@
new_text = text.gsub(/<Version>([-\w\d.]+)</, "<Version>#{version}<") if filename.include?(".csproj")
new_text = text.gsub(/<version>([-\w\d.]+)</, "<version>#{version}<") if filename.include?(".nuspec")
new_text = text.gsub(/ Version="([\d\.]+)"/, " Version=\"#{version}\"") if filename.include?(".wxs")
new_text = text.gsub(/version\s+=\s+['"]([\w.]+)['"]/, "version=\"#{version}\"") if filename.include?(".toml")
File.open(filename, "w") { |f| f.write(new_text) } if new_text != text
+ end
+
+ def self.set_version_in_files(glob_pattern, version)
+ Dir.glob(glob_pattern).each do |filename|
+ set_version_in_file(filename, version)
+ end
end
end
end