Sha256: 5b094fa24342effaec6f8c004b5282670990d99d9a1de9bca0f1e07033b166b8
Contents?: true
Size: 734 Bytes
Versions: 7
Compression:
Stored size: 734 Bytes
Contents
#!/usr/bin/env ruby # frozen_string_literal: true # NOTE: you may need change file permissions # chmod +x hooks/update-version exit 1 if ARGV.empty? version = ARGV[0] version = version[1..-1] # revoke 'v' character, e.g. v0.1.1 becomes 0.1.1 namespaces = %w[KManager] indent = 0 output = ['# frozen_string_literal: true', ''] namespaces.each do |namespace| output.push "#{' ' * indent}module #{namespace}" indent += 1 end output.push "#{' ' * indent}VERSION = \'#{version}'" indent -= 1 namespaces.each do output.push "#{' ' * indent}end" indent -= 1 end output.push('') printf "%-25<label>s : %<version>s\n", label: 'GEM VERSION', version: version File.write('lib/k_manager/version.rb', output.join("\n"))
Version data entries
7 entries across 7 versions & 1 rubygems