Skip to content

Commit f68f77e

Browse files
committed
docs: Fix yard
1 parent 8d6fd05 commit f68f77e

3 files changed

Lines changed: 19 additions & 13 deletions

File tree

doc/kiba_extend_concepts.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@
33
# @title kiba-extend Concepts
44
-->
55

6-
# `kiba-extend` Concepts
6+
* TOC
7+
{:toc}
78

8-
## Folder structure, file names, module/class name constants defined in files
9+
## Glossary {#glossary}
10+
11+
Full job key
12+
: A Ruby Symbol built from `FileRegistry` namespace (if used) and registry entry name, separated by the value of `Kiba::Extend.registry_namespace_separator` (defaults to `__` (two underscores)). Examples: With namespace: `:namespace__entry_name`; No namespace: `:unnamespaced_entry_name`.
13+
File registry key
14+
: Synonym for `Full job key`.
15+
16+
## Assumptions and concepts used in libraries used by `kiba-extend` {#other-libraries}
17+
18+
### Folder structure, file names, module/class name constants defined in files {#zeitwerk}
919

1020
`kiba-extend` uses [zeitwerk](https://github.com/fxn/zeitwerk) to automatically handle code loading, so you don't have to manually enter `require_relative` every time you refer to code in another file. (The manual way is tedious and horrible if you end up renaming files or moving them around).
1121

@@ -19,13 +29,13 @@ Zeitwerk provides ways to override almost all of its default assumptions via inf
1929

2030
**Inflections example:** kiba-tms defines inflectors for dealing with some TMS tables. Generally, kiba-tms defines a config module per TMS table. For clarity, the names of the tables and the config module constants should match. For a table like `ClassificationXRefs`, I would be annoyed to have to name my file `classification_x_refs.rb` (especially since there are other tables named like: `ConXrefs`). So I added an inflector to handle this in `setup_loader` method in `/lib/kiba/tms.rb`.
2131

22-
## dry-configurable
32+
### Config settings via `dry-configurable` {#dry-configurable}
2333

2434
`kiba-extend` and projects based on it make heavy use of the `dry-configurable` gem to add flexible but safe config settings to control application behavior.
2535

26-
This is particularly heavily used in projects like `kiba-tms` or `migrations-cspace-csu-base` which are used as middle layers between `kiba-extend` and individual client projects.
36+
This is particularly heavily used in "abstract" `kiba-extend` projects like `kiba-tms` or `migrations-cspace-csu-base` which are used as middle layers between `kiba-extend` and individual client projects.
2737

28-
However, even for one-off projects, it can be convenient to add settings for values used across your project to the main project module definition. See [migration-cspace-wpl](https://github.com/dts-hosting/migration-cspace-wpl/blob/main/lib/wpl.rb)'s `:post_mig_cleanup_label` and `:photos_coll_title` settings as an example.
38+
However, even for one-off projects, it can be convenient to add settings for values used across your project to the main project module definition.
2939

3040
`dry-configurable` is pretty simple. [Its documentation](https://dry-rb.org/gems/dry-configurable/main/) is only two pages, though it leaves some important things out, such as:
3141

lib/kiba/extend/jobs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module Extend
7070
# Kiba::Extend::Transforms::Clean::EnsureConsistentFields transform
7171
# can be added to the end of multi-source jobs to prevent this error.
7272
#
73-
# #### More flexible lookup file definition - since 5.1.0
73+
# #### More flexible lookup file definition - since 5.1.0 {#flex-lookup}
7474
#
7575
# Lookups defined as shown above depend upon a `:lookup_on` field being
7676
# configured for the job in the registry.

lib/kiba/extend/registry/file_registry.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ module Registry
1414
# Transforms a file_registry hash into an object that can return
1515
# source, lookup, or destination config for that file, for
1616
# passing to jobs
17-
#
18-
# An example of a file registry setup in a project can be found
19-
# at:
20-
# https://github.com/lyrasis/fwm-cspace-migration/blob/main/lib/fwm/registry_data.rb
2117
class FileRegistry
2218
include Dry::Container::Mixin
2319

@@ -57,9 +53,9 @@ def as_destination(filekey, for_job)
5753
end
5854

5955
# @param filekey [String, Symbol, Hash] file registry key for file to
60-
# be used as a lookup source. Alternately, a Hash containing
61-
# jobkey: {full jobkey symbol}, and additional key-value pairs may
62-
# be passed.
56+
# be used as a lookup source. Alternately, a Hash can be given as
57+
# described in [the "More flexible lookup file definition" section of
58+
# Jobs](https://lyrasis.github.io/kiba-extend/Kiba/Extend/Jobs.html#flex-lookup).
6359
# @return [Kiba::Extend::Registry::RegisteredLookup]
6460
def as_lookup(filekey, for_job)
6561
jobkey = filekey.is_a?(Hash) ? filekey[:jobkey] : filekey

0 commit comments

Comments
 (0)