lode 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +15 -2
- data/lib/lode/client.rb +4 -3
- data/lib/lode/refines/persistent_store.rb +1 -1
- data/lode.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51471745bb0d6abb49d97534051fb85c58d61db18f547f963f96a7636132fa0a
|
4
|
+
data.tar.gz: 7aa1cd828b8f61ce29e7ed1ffba7ee1e820c7dfc4f96911880e158850a665f72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52baa436a259f122b8501cc3dc46a230a5b70f8d7389c3f39db2cf3c9d06da038bf931af05109f37bfd8dcdceee5569668b181fac12ac982e8584ae2731d4b37
|
7
|
+
data.tar.gz: 3869644daa4ff5a7a7b975557abe53d7e0dcc56d95c879b031f82e553332b50707e9c3c26d1378e5b26c55263a07ef9fb738c537ad487c2f489d7b7a500431f0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -9,9 +9,9 @@
|
|
9
9
|
|
10
10
|
= Lode
|
11
11
|
|
12
|
-
Lode -- as in
|
12
|
+
Lode -- as in geological deposit or a vein of minerals -- is a {pstore_link} of object data that can be mined for valuable information.
|
13
13
|
|
14
|
-
As noted in the {pstore_link} documentation all objects are marshaled which is not without caveats and dangers but, if you only need a simple object store, {pstore_link} is a solution. Lode takes this a step further by allowing you to have a pipeline workflow with a Domain Specific Language (DSL) for creating, updating, finding, and deleting records.
|
14
|
+
As noted in the {pstore_link} documentation all objects are marshaled which is not without caveats and dangers but, if you only need a simple object store, {pstore_link} is a solution. Lode takes this a step further by allowing you to have a pipeline workflow along with a Domain Specific Language (DSL) for creating, updating, finding, and deleting records.
|
15
15
|
|
16
16
|
toc::[]
|
17
17
|
|
@@ -141,6 +141,19 @@ Each key can be configured as follows:
|
|
141
141
|
* `primary_key`: Defines the primary key used when interacting with your table of records (useful when finding or upserting records). Default: `:id`.
|
142
142
|
* `registry`: Used for registering default settings for your tables. _This is not meant to be used directly_ but is documented for transparency.
|
143
143
|
|
144
|
+
=== Paths
|
145
|
+
|
146
|
+
Upon initialization, and when given a file, the file is only created once you start saving records. Although, when given a nested path, the full parent path will be created in anticipation of the file eventually being created. Example:
|
147
|
+
|
148
|
+
[source,ruby]
|
149
|
+
----
|
150
|
+
# The file, "demo.store", is not created until data is saved.
|
151
|
+
Lode.new "demo.store"
|
152
|
+
|
153
|
+
# The path, "a/nested/path", will be created so `demo.store` can eventually be saved.
|
154
|
+
Lode.new "a/nested/path/demo.store"
|
155
|
+
----
|
156
|
+
|
144
157
|
=== Registry
|
145
158
|
|
146
159
|
The registry is part of the configuration and directly accessible via a Lode instance. The registry allows you to customize individual table behavior as desired. For instance, you could have a `Hash` table or value table (i.e. `Data`, `Struct`, etc). Additionally, each table can have different primary keys too. The registry accepts three arguments in this format:
|
data/lib/lode/client.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "forwardable"
|
4
|
+
require "refinements/pathname"
|
4
5
|
|
5
6
|
module Lode
|
6
7
|
# Provides an enhanced PStore-based client.
|
7
8
|
class Client
|
8
9
|
extend Forwardable
|
9
10
|
|
11
|
+
using Refinements::Pathname
|
12
|
+
|
10
13
|
attr_reader :path, :store
|
11
14
|
|
12
15
|
delegate %i[register registry] => :configuration
|
@@ -14,7 +17,7 @@ module Lode
|
|
14
17
|
def initialize path, configuration: Configuration.new
|
15
18
|
yield configuration if block_given?
|
16
19
|
|
17
|
-
@path = path
|
20
|
+
@path = Pathname(path).make_ancestors
|
18
21
|
@configuration = configuration
|
19
22
|
@store = configuration.store_for path
|
20
23
|
end
|
@@ -27,12 +30,10 @@ module Lode
|
|
27
30
|
|
28
31
|
attr_reader :configuration
|
29
32
|
|
30
|
-
# rubocop:todo Naming/BlockForwarding
|
31
33
|
def transact mode, key, &block
|
32
34
|
store.transaction mode == :read do
|
33
35
|
configuration.table_for(store, key).instance_eval(&block)
|
34
36
|
end
|
35
37
|
end
|
36
|
-
# rubocop:enable Naming/BlockForwarding
|
37
38
|
end
|
38
39
|
end
|
data/lode.gemspec
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-
|
38
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: dry-monads
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
|
-
rubygems_version: 3.5.
|
128
|
+
rubygems_version: 3.5.6
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: A monadic store of marshaled objects.
|
metadata.gz.sig
CHANGED
Binary file
|