Sha256: e79074a23a2978929bac070c2673240e7fcd1ad7c6dc4fa4c237a7ac0c045a5e
Contents?: true
Size: 726 Bytes
Versions: 1
Compression:
Stored size: 726 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[KDoc] 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_doc/version.rb', output.join("\n"))
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
k_doc-0.0.38 | hooks/update-version |