dddr 2.0.3 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dddr/version.rb +1 -1
  3. data/lib/dddr.rb +11 -1
  4. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da1458c32e2bba6a0a94f1014aac39675ca2267790a50d7fcb09e1c8af0cc2d9
4
- data.tar.gz: 96b8c4d7f5d2adea851ba8abd61d5a3e2a5dd587523a0b789459d1e1b9a76d64
3
+ metadata.gz: 348b677b23aa6781f82ed84d35a72e2cbb2873245380194cb2a33d017bd4eb29
4
+ data.tar.gz: 174ee9771fcb8633cf1661e96e1b419c78ba7dc98b47f333665c8bbf1b7d4cfa
5
5
  SHA512:
6
- metadata.gz: 390527b09424ef5cde4da811fbc32cab8823af20001473ca975c4d629842294133676000d9eefe1b1d606ecf286860fa4d5e284b55790bc0f7a4e2e750368ac2
7
- data.tar.gz: 66c3b7cd6f43cb8d6559e643c3627e9accb7e269d43b9b730398b8ad8b11e8e51047c76759566579a38ccb4847772f043172ef921b4aadcc680719a726794408
6
+ metadata.gz: 717aa4966cdf9b930d223b48257cef1b0de8a8397017b0d13dab766f662d1a1f91b55baf1e6d6de98a580e1f887d5fb57af5f5050fede90172b18a839e9b9216
7
+ data.tar.gz: a3fb0a6b030793c96a688abf6f803dfd9324132d53f479353fbe4edb67f30325110d17d57204dc295606f494eba8492784520fb9c3405c1aacc00d2568996136
data/lib/dddr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dddr
4
- VERSION = "2.0.3"
4
+ VERSION = "2.1.0"
5
5
  end
data/lib/dddr.rb CHANGED
@@ -7,6 +7,7 @@ require 'csv'
7
7
  require "ostruct"
8
8
  require "fileutils"
9
9
  require "oj"
10
+ require "msgpack"
10
11
 
11
12
  require_relative "dddr/sdbm"
12
13
  require_relative "dddr/sequel"
@@ -19,6 +20,15 @@ module Dddr
19
20
  @configuration ||= OpenStruct.new
20
21
  end
21
22
 
23
+ class MessagePack
24
+ def self.load(obj)
25
+ ::MessagePack.unpack(obj)
26
+ end
27
+ def self.dump(obj)
28
+ obj.to_msgpack
29
+ end
30
+ end
31
+
22
32
  class Serializer
23
33
  def initialize(engine)
24
34
  @engine = engine
@@ -37,7 +47,7 @@ module Dddr
37
47
  configuration.env = ENV["DDDR_ENV"] || "development"
38
48
  configuration.data_dir = "/var/dddr"
39
49
  configuration.engine = :sdbm
40
- configuration.serializer = Oj
50
+ configuration.serializer = MessagePack
41
51
  configuration.container = nil
42
52
  yield(configuration) if block_given?
43
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dddr
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Burke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-11 00:00:00.000000000 Z
11
+ date: 2024-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sdbm
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.11'
55
+ - !ruby/object:Gem::Dependency
56
+ name: msgpack
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: |
56
70
  DDDr stands for Domain Driven Design Repository. It's a Ruby gem that simplifies the implementation of data repositories in a Domain-Driven Design (DDD) architecture.
57
71
  It offers a clean interface for abstracting data access, allowing you to focus on your domain logic rather than database operations.