dddr 1.0.5 → 1.0.8

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 +13 -2
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2da332f599be7d13a4adedc658585790e89e0858c4099fb99e9290ca037479c7
4
- data.tar.gz: b40d4436c2b3865c036ff66212bc9bb4bb848732d0092ed039155700c88858bf
3
+ metadata.gz: 4646e8a727ff71b363a29bf0efe1bc952e999ecc726c51e898e3013734992b4d
4
+ data.tar.gz: 31d7837d050a1cdba539cd7705a5ad52d2cbb1006998d0c34179bbdc99e82d1e
5
5
  SHA512:
6
- metadata.gz: 58d83c8ba4c954fda9ad24ab1dfc3990e388b882c0052184519f64aeb992430c029a22a7b26cd1cd6ec0e710e862fe59ec630560031b93ed9b1da70636756739
7
- data.tar.gz: bddfecd4503655e41c43eed62ee0108ff7ecb82fc97baf997deae8ac28584ae38dae3bb9b0ce2085e8f7643d5d9e0252df68f2b521136cc3c7a646a0a7a05e71
6
+ metadata.gz: ff6a74ec83c1846a561804fffe3d6d0e96a0b618ab0d9672b2fd130f8d3620a6dc105029a0d64e0639d0795ecfa1eb46a9ffc9c42fd775ef371db49d643809a5
7
+ data.tar.gz: ca5cfacbc23a24b65dc55c606d4052d213c53b84ee645e9f721c1052a05175ba5f29e84c6296810b8dbba898d27303dfb4a5cf549e4f77de295d2a98dde05085
data/lib/dddr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dddr
4
- VERSION = "1.0.5"
4
+ VERSION = "1.0.8"
5
5
  end
data/lib/dddr.rb CHANGED
@@ -40,7 +40,7 @@ module Dddr
40
40
  end
41
41
 
42
42
  def const_missing(name)
43
-
43
+
44
44
  @@context = self
45
45
 
46
46
  if defined?(self::Queries)
@@ -53,7 +53,18 @@ module Dddr
53
53
  def initialize(entity_class = @@context)
54
54
  @entity_class = entity_class
55
55
  env = Dddr.configuration.env
56
- `mkdir -p #{Dddr.configuration.data_dir}/#{Dddr.configuration.container}/#{env}/`
56
+
57
+ unless Dir.exist? Dddr.configuration.data_dir
58
+
59
+ if Dddr.configuration.data_dir.include? "/var/"
60
+ `sudo mkdir -p #{Dddr.configuration.data_dir}/#{Dddr.configuration.container}/#{env}/`
61
+ `sudo chown $USER #{Dddr.configuration.data_dir}/#{Dddr.configuration.container}/#{env}/`
62
+ else
63
+ `mkdir -p #{Dddr.configuration.data_dir}/#{Dddr.configuration.container}/#{env}/`
64
+ end
65
+
66
+ end
67
+
57
68
  @name = "#{Dddr.configuration.data_dir}/#{Dddr.configuration.container}/#{env}/#{entity_class.name.downcase}"
58
69
  end
59
70
 
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: 1.0.5
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Burke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-17 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sdbm
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  description: |
28
- DDDr stands for Domain Driven Design Data Repository. It's a Ruby gem that simplifies the implementation of data repositories in a Domain-Driven Design (DDD) architecture.
28
+ 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.
29
29
  It offers a clean interface for abstracting data access, allowing you to focus on your domain logic rather than database operations.
30
30
  With DDDr, you can easily swap out data sources without affecting your core business logic.
31
31
  email:
@@ -69,5 +69,5 @@ requirements: []
69
69
  rubygems_version: 3.4.21
70
70
  signing_key:
71
71
  specification_version: 4
72
- summary: Domain Driven Design Data Repository
72
+ summary: Domain Driven Design Repository
73
73
  test_files: []