Sha256: 70bd282fc00869450117982c168f8d7c958e953a7c5b044fb9ef7bd8e9ca0274

Contents?: true

Size: 616 Bytes

Versions: 4

Compression:

Stored size: 616 Bytes

Contents

module VersionInfo
  class Storage
    attr :data
    
    def initialize(data)
      super()
      @data = data
      load if file_name && File.exist?(file_name)
    end
    
    def file_name
      @file_name ||= Dir.pwd + '/' + default_file_name
    end

    def file_name=(value)
      @file_name = value
    end

    def load
      File.open(file_name, 'r') {|io| load_from(io)}
      self
    end

    def save      
	    File.open(file_name, 'w' ) {|out| save_to(out)}
	    self
    end
  end
end

require 'version_info/text_storage'
require 'version_info/yaml_storage'
require 'version_info/module_storage'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
version_info-1.8.7 lib/version_info/storage.rb
version_info-1.8.5 lib/version_info/storage.rb
version_info-1.8.2 lib/version_info/storage.rb
version_info-1.8.0 lib/version_info/storage.rb