Sha256: 45969384abcd6424928550672bdf9468ac099fb6eab1f604a716ccd2024dfc37
Contents?: true
Size: 612 Bytes
Versions: 11
Compression:
Stored size: 612 Bytes
Contents
module Semvergen class VersionFile def initialize(file) @file = file end def version if file.read =~ /VERSION\s*=\s*["'](\d+\.\d+\.\d+)["']/ $1 else raise "Don't understand version" end end def version=(new_version) content = file.read.gsub(/VERSION.*$/, %Q[VERSION = "#{new_version}"]) file.truncate(0) file.write content file.flush end def file @file.rewind @file end def path @file.path end VERSION_TEMPLATE = <<-RUBY module Quattro VERSION = "%s" end RUBY end end
Version data entries
11 entries across 11 versions & 1 rubygems