class Origen::Application::VersionTracker
Keeps track of production released versions
Constants
- STORAGE_FILE
Public Instance Methods
Source
# File lib/origen/application/version_tracker.rb, line 14 def add_version(version) restore_to_latest versions << version save check_in end
Adds a new version to the tracker
Source
# File lib/origen/application/version_tracker.rb, line 44 def check_in Origen.app.rc.checkin(STORAGE_FILE, force: true, unmanaged: true, comment: 'Recorded new version in the version tracker') end
Check in the persisted storage container
Source
# File lib/origen/application/version_tracker.rb, line 49 def restore_to_latest @storage = nil # Check out the latest version of the storage, forcing to Trunk system "dssc co -get -force '#{STORAGE_FILE};Trunk:Latest'" system "dssc setselector 'Trunk' #{STORAGE_FILE}" `chmod 666 #{STORAGE_FILE}` end
Force the storage container to the latest checked in version
Source
# File lib/origen/application/version_tracker.rb, line 37 def save File.open(STORAGE_FILE, 'w') do |f| Marshal.dump(storage, f) end end
Save the persisted storage container to disk
Source
# File lib/origen/application/version_tracker.rb, line 22 def storage return @storage if @storage if File.exist?(STORAGE_FILE) File.open(STORAGE_FILE) do |f| @storage = Marshal.load(f) rescue @storage = {} end else @storage = {} end end
Returns the persisted storage container (a Hash
)
Source
# File lib/origen/application/version_tracker.rb, line 9 def versions storage[:versions] ||= [] end
Returns an array containing all Production release tags since they started being tracked