Sha256: 98e1c0af2da62759bcfe0da3e8b32afe9adda10b0b6a0f98d34664d1e0ca2f28
Contents?: true
Size: 740 Bytes
Versions: 1
Compression:
Stored size: 740 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[Gpt3 Builder] 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/gpt3/builder/version.rb', output.join("\n"))
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
gpt3-builder-0.0.4 | hooks/update-version |