Module: Dor::Itemizable
- Extended by:
- ActiveSupport::Concern, Deprecation
- Included in:
- Item
- Defined in:
- lib/dor/models/concerns/itemizable.rb
Constant Summary collapse
- DIFF_FILENAME =
'cm_inv_diff'
Instance Method Summary collapse
-
#clear_diff_cache ⇒ Object
Deletes all cm_inv_diff files in the workspace for the Item.
-
#get_content_diff(subset = :all, version = nil) ⇒ Moab::FileInventoryDifference
Retrieves file difference manifest for contentMetadata from SDR.
Instance Method Details
#clear_diff_cache ⇒ Object
Deletes all cm_inv_diff files in the workspace for the Item
19 20 21 22 23 24 25 |
# File 'lib/dor/models/concerns/itemizable.rb', line 19 def clear_diff_cache raise ArgumentError, 'Missing Dor::Config.stacks.local_workspace_root' if Dor::Config.stacks.local_workspace_root.nil? druid = DruidTools::Druid.new(pid, Dor::Config.stacks.local_workspace_root) diff_pattern = File.join(druid.temp_dir, DIFF_FILENAME + '.*') FileUtils.rm_f Dir.glob(diff_pattern) end |
#get_content_diff(subset = :all, version = nil) ⇒ Moab::FileInventoryDifference
Retrieves file difference manifest for contentMetadata from SDR
33 34 35 36 37 38 39 |
# File 'lib/dor/models/concerns/itemizable.rb', line 33 def get_content_diff(subset = :all, version = nil) raise Dor::ParameterError, 'Missing Dor::Config.stacks.local_workspace_root' if Dor::Config.stacks.local_workspace_root.nil? raise Dor::Exception, 'Missing contentMetadata datastream' if !respond_to?(:contentMetadata) || contentMetadata.nil? Sdr::Client.get_content_diff(pid, contentMetadata.content, subset.to_s, version) end |