You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/kiba_extend_concepts.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,19 @@
3
3
# @title kiba-extend Concepts
4
4
-->
5
5
6
-
# `kiba-extend` Concepts
6
+
* TOC
7
+
{:toc}
7
8
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}
9
19
10
20
`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).
11
21
@@ -19,13 +29,13 @@ Zeitwerk provides ways to override almost all of its default assumptions via inf
19
29
20
30
**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`.
21
31
22
-
##dry-configurable
32
+
### Config settings via `dry-configurable` {#dry-configurable}
23
33
24
34
`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.
25
35
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.
27
37
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.
29
39
30
40
`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:
0 commit comments