Class: Ki::Component
Overview
Combine’s component’s information from all different repositories
Instance Method Summary collapse
- #find_status_info ⇒ Object
-
#find_versions ⇒ Object
Returns version list from first component which has a version list.
-
#version_by_id(version_str) ⇒ Object
Returns Version which references all existing version directories.
Instance Method Details
#find_status_info ⇒ Object
142 143 144 145 146 147 148 149 150 151 |
# File 'lib/data_access/repository_info.rb', line 142 def find_status_info ret = {} components.each do |c| si = c.status_info if si.exists? ret.merge!(si.cached_data) end end ret end |
#find_versions ⇒ Object
Returns version list from first component which has a version list
117 118 119 120 121 122 123 124 125 |
# File 'lib/data_access/repository_info.rb', line 117 def find_versions components.each do |c| version_list_file = c.versions if version_list_file.exists? return version_list_file end end nil end |
#version_by_id(version_str) ⇒ Object
Returns Version which references all existing version directories
129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/data_access/repository_info.rb', line 129 def version_by_id(version_str) version_id = File.join(component_id, version_str) finder.versions.cache(version_id) do info_versions = components.map do |c| Repository::Version.new(version_str).version_id(version_id).parent(c) end existing_versions = info_versions.select do |v| v.exists? end Version.new.component(self).version_id(version_id).name(version_str).versions(existing_versions) end end |