lode 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18f3728eb2391285467b9dbdf6cda694bdf8ee167b9f84b8d9f60e4869938d67
4
- data.tar.gz: cd5e03ccd6554d48c09e67514cd82c427cc636be527f351311089a6cbcdcfd93
3
+ metadata.gz: 53547ef20d061cc6875625c4a82430c5a7c6b6d1826b41b56f16446ec9202085
4
+ data.tar.gz: d22865856c792c76dee3e58b8106285683d0fc2e78f752c69bc7603bb3581eb8
5
5
  SHA512:
6
- metadata.gz: 0da905f28b4ac347b4bebe53a0bb58c87f185fe2f948bbf3e3e13af8f6a3461fe768848f69351f4767f50a10e34914ae71290125ab6e4af03affd7fcc0f851b0
7
- data.tar.gz: 63b9f264fd388402cfd00a5cfab3062c7bed11f49738ec3cae760b579d26a26d6a49b635482b8181b0a3b462b2f24dd693f7d764595a660c063eaadb585867e9
6
+ metadata.gz: b6cafe0d0ffdec73e06a76994bfdae4b9b4c9f3acb3e29a0415148ef6c00ea0163fef33afeef9224b2d1d468025385bc33fed160bc3b2708afbdab9f2433bd65
7
+ data.tar.gz: 590792995478977eb6e4abdf626a25e32d0c830154857f1fa6480d059acea8fdae0f6c968d6c655034e68c6ecbb642fed6208107e22c9d2e1595e25976b1702a
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 a geological deposit or a vein of minerals -- is a {pstore_link} of object data that can be mined for valuable information.
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
@@ -5,7 +5,7 @@ require "refinements/array"
5
5
 
6
6
  module Lode
7
7
  module Refines
8
- # Refined and enhanced PStore functionality.
8
+ # Refines and enhances PStore functionality.
9
9
  module PersistentStore
10
10
  using Refinements::Array
11
11
 
data/lode.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "lode"
5
- spec.version = "1.0.0"
5
+ spec.version = "1.0.1"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/lode"
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.0.0
4
+ version: 1.0.1
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-01-01 00:00:00.000000000 Z
38
+ date: 2024-01-07 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.3
128
+ rubygems_version: 3.5.4
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: A monadic store of marshaled objects.
metadata.gz.sig CHANGED
Binary file