Sha256: a371733672f27c45c5b414d856242463483a490857b41be1741da58349bffcb9
Contents?: true
Size: 782 Bytes
Versions: 103
Compression:
Stored size: 782 Bytes
Contents
module MinimumViableProduct module Iteration CONFIG_FILE = File.join(Rails.root, '.iteration') class << self def write(json) _file = File.open( CONFIG_FILE, "w+" ) _file.write(JSON.pretty_generate(json)) _file.close @config = json end def read @config ||= begin JSON.parse( IO.read(CONFIG_FILE), symbolize_names: false ) rescue write({'version' => '0.0.1'}) end end def bump!(bump) config = read config['version'] = Semantic::Version.new(config['version']).increment!(bump.downcase.to_sym).to_s write(config) end def version read["version"] end end end end
Version data entries
103 entries across 102 versions & 3 rubygems