Sha256: 22844eb20e5d02d3360f1c36138b0dfe7826d72a697199160b5498ca41034f28

Contents?: true

Size: 674 Bytes

Versions: 30

Compression:

Stored size: 674 Bytes

Contents

require 'fileutils'
require 'yaml'

module Babelyoda
  class GitVersions

    def initialize
      @versions = load || {}
    end
    
    def exist?(filename)
      @versions.has_key?(filename)
    end
    
    def filename
      '.babelyoda/git_versions.yml'
    end
    
    def save!
      FileUtils.mkdir_p(File.dirname(filename))
      File.open(filename, 'w') {|f| f.write(@versions.to_yaml) }
    end
    
    def [](filename)
      @versions[filename]
    end
    
    def []=(filename, value)
      @versions[filename] = value
    end
    
  private
    
    def load
      @versions = YAML::load_file(filename) if File.exist?(filename)
    end
        
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
babelyoda-2.2.0 lib/babelyoda/git_versions.rb
babelyoda-2.1.20 lib/babelyoda/git_versions.rb
babelyoda-2.1.19 lib/babelyoda/git_versions.rb
babelyoda-2.1.18 lib/babelyoda/git_versions.rb
babelyoda-2.1.17 lib/babelyoda/git_versions.rb
babelyoda-2.1.16 lib/babelyoda/git_versions.rb
babelyoda-2.1.15 lib/babelyoda/git_versions.rb
babelyoda-2.1.14 lib/babelyoda/git_versions.rb
babelyoda-2.1.13 lib/babelyoda/git_versions.rb
babelyoda-2.1.12 lib/babelyoda/git_versions.rb
babelyoda-2.1.11 lib/babelyoda/git_versions.rb
babelyoda-2.1.10 lib/babelyoda/git_versions.rb
babelyoda-2.1.9 lib/babelyoda/git_versions.rb
babelyoda-2.1.8 lib/babelyoda/git_versions.rb
babelyoda-2.1.7 lib/babelyoda/git_versions.rb
babelyoda-2.1.6 lib/babelyoda/git_versions.rb
babelyoda-2.1.5 lib/babelyoda/git_versions.rb
babelyoda-2.1.4 lib/babelyoda/git_versions.rb
babelyoda-2.1.3 lib/babelyoda/git_versions.rb
babelyoda-2.1.2 lib/babelyoda/git_versions.rb