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

Version Path
k_manager-0.0.37 hooks/update-version
k_manager-0.0.36 hooks/update-version
k_manager-0.0.35 hooks/update-version
k_manager-0.0.33 hooks/update-version
k_manager-0.0.32 hooks/update-version
k_manager-0.0.30 hooks/update-version
k_manager-0.0.28 hooks/update-version