about summary refs log tree commit homepage
path: root/GIT-VERSION-GEN
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-01-02 22:29:12 +0000
committerEric Wong <e@80x24.org>2016-01-02 22:29:28 +0000
commit9e24bae3428f726800da2963a8f2695f7d4064cd (patch)
treedd4ce29efffa4f0da9c6d9ada903a277ec81196b /GIT-VERSION-GEN
parent1105a6957eed26a922a27bd6e6dbbc457524b664 (diff)
downloadyahns-9e24bae3428f726800da2963a8f2695f7d4064cd.tar.gz
There are likely yet-to-be-discovered bugs in here.
Also, keeping explicit #freeze calls for 2.2 users, since most
users have not migrated to 2.3, yet.
Diffstat (limited to 'GIT-VERSION-GEN')
-rwxr-xr-xGIT-VERSION-GEN5
1 files changed, 3 insertions, 2 deletions
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 608a76d..3109918 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,11 +1,12 @@
 #!/usr/bin/env ruby
 # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
+# frozen_string_literal: true
 CONSTANT = "Yahns::VERSION"
 RVF = "lib/yahns/version.rb"
 GVF = "GIT-VERSION-FILE"
 DEF_VER = "v1.11.0"
-vn = DEF_VER
+vn = DEF_VER.dup
 
 # First see if there is a version file (included in release tarballs),
 # then try git-describe, then default.
@@ -23,7 +24,7 @@ if File.exist?(".git")
 end
 
 vn = vn.sub!(/\Av/, "")
-new_ruby_version = "#{CONSTANT} = '#{vn}' # :nodoc:\n"
+new_ruby_version = "#{CONSTANT} = '#{vn}'.freeze # :nodoc:\n"
 cur_ruby_version = File.read(RVF) rescue nil
 if new_ruby_version != cur_ruby_version
   File.open(RVF, "w") { |fp| fp.write(new_ruby_version) }