Sha256: e838ed4725924904554ca6d45c38ab45502af282bc8e2672a510586a5eb9d73d
Contents?: true
Size: 1.08 KB
Versions: 1
Compression:
Stored size: 1.08 KB
Contents
module Saml module Kit module Cli class YamlRegistry < ::Saml::Kit::DefaultRegistry def initialize(path) @items = YAML::Store.new(path) end def register(metadata) with_transaction do |db| db[metadata.entity_id] = metadata.to_xml end metadata end def metadata_for(entity_id) with_transaction do |db| xml = db[entity_id] return nil if xml.nil? Saml::Kit::Metadata.from(xml) end end def each with_transaction do |db| db.roots.each do |key| yield metadata_for(key) end end end private def with_transaction if @in_transaction yield @items else begin @items.transaction do @in_transaction = true yield @items ensure @in_transaction = false end end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
saml-kit-cli-0.3.2 | lib/saml/kit/cli/yaml_registry.rb |