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

Version Path
version_info-1.7.7 lib/version_info/module_storage.rb
version_info-1.7.6 lib/version_info/module_storage.rb
version_info-1.7.5 lib/version_info/module_storage.rb
version_info-1.7.4 lib/version_info/module_storage.rb
version_info-1.7.3 lib/version_info/module_storage.rb
version_info-1.7.2 lib/version_info/module_storage.rb
version_info-1.7.1 lib/version_info/module_storage.rb
version_info-1.7.0 lib/version_info/module_storage.rb