set/abstract/mod_assets.rb in card-mod-assets-0.14.2 vs set/abstract/mod_assets.rb in card-mod-assets-0.15.0
- old
+ new
@@ -1,6 +1,6 @@
-include_set Abstract::Pointer
+include_set Abstract::List
include_set Abstract::ReadOnly
def item_cards _args={}
local_group_cards
end
@@ -84,10 +84,11 @@
end
def load_manifest
return unless manifest_exists?
manifest = YAML.load_file manifest_path
+ return {} unless manifest # blank manifest
validate_manifest manifest
manifest
end
def validate_manifest manifest
@@ -113,17 +114,16 @@
[manifest_updated_at, local_manifest_group_cards.map(&:last_file_change)].flatten
else
folder_group_card&.paths&.map { |path| File.mtime(path) }
end
- return unless source_updates.present?
-
- source_updates.max > since
+ source_updates.present? && (source_updates.max > since)
end
def manifest_updated_at
return unless manifest_exists?
+
File.mtime(manifest_path)
end
def no_action?
new? && !assets_path
@@ -150,6 +150,15 @@
raise_manifest_error "items section \"#{name}\" must contain a list"
end
def raise_manifest_error msg
raise Card::Error, "invalid manifest format in #{manifest_path}: #{msg}"
+end
+
+format :html do
+ def map_remote_items
+ remote_items = card.manifest_group_items "remote"
+ return unless remote_items
+
+ remote_items.map { |args| yield args.clone }
+ end
end