Class: Iglu::Registries::EmbeddedRegistryRef
- Inherits:
-
RegistryRef
- Object
- RegistryRef
- Iglu::Registries::EmbeddedRegistryRef
- Defined in:
- lib/iglu-client/registries.rb
Overview
This is not a replacement for JVM Embedded Registry It is something more like FileSystemRegistry if you pass absolute path, But by default it’s root is relative to gem
Instance Attribute Summary
Attributes inherited from RegistryRef
#class_priority, #config, #descriptor
Instance Method Summary collapse
-
#initialize(config, path) ⇒ EmbeddedRegistryRef
constructor
A new instance of EmbeddedRegistryRef.
- #lookup_schema(schema_key) ⇒ Object
Methods inherited from RegistryRef
Constructor Details
#initialize(config, path) ⇒ EmbeddedRegistryRef
Returns a new instance of EmbeddedRegistryRef.
73 74 75 76 77 78 79 |
# File 'lib/iglu-client/registries.rb', line 73 def initialize(config, path) @config = config @class_priority = 1 @descriptor = "embedded" @root = path end |
Instance Method Details
#lookup_schema(schema_key) ⇒ Object
81 82 83 84 85 86 87 |
# File 'lib/iglu-client/registries.rb', line 81 def lookup_schema(schema_key) schema_path = File.join(@root, 'schemas', schema_key.as_path) content = File.read(schema_path) JSON::parse(content) rescue Errno::ENOENT => _ nil end |