Sha256: 4f9ad1687cdb80bb853da8666eb8483ee7a895f4e11bdedd67825d24eabf072c
Contents?: true
Size: 622 Bytes
Versions: 8
Compression:
Stored size: 622 Bytes
Contents
module VersionInfo # Version data is stored in a ruby file into the project top module : # module MyProject # VERSION = "0.0.1" # VERSION.author = "jcangas" # VERSION.email = "jorge.cangas@gmail.com" # end # # The convenion is to name this file "version.rb" module ModuleStorage def default_file_name 'version.rb' end def load_from(io) self end def save content = File.read(file_name) content.gsub!(/(\s*VERSION\s*=\s*)('|").*('|")/, "\\1\\2#{tag}\\3") File.open(file_name, 'w' ) {|out| out.print content} self end end end
Version data entries
8 entries across 8 versions & 1 rubygems