dddr 1.1.1 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dddr/version.rb +1 -1
- data/lib/dddr.rb +9 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f0b301e90995f597fe2eccbb90579528f09e20ac702e8ca5f18855c64047d95
|
4
|
+
data.tar.gz: 94a1d19f0a0f1d38b72453519396d231e8ed7d0184ab42b0d828149dd75780e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eeabb4563c3bd63e1e62d1e84045b4dc62c8944de6a41942fefe71ebca46850b55bf2e8ddcfa7e319cb58c1df0010803f3ae9f9200550067183299ab363f451
|
7
|
+
data.tar.gz: b6c98d57d03fe35c3f4488cd1d661b19f79804c55c73592959fc12d5d9cd56acd288325c5d93262f622306f9a19d013e37326487aae9779c4ac72c4f726b43fc
|
data/lib/dddr/version.rb
CHANGED
data/lib/dddr.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
2
|
require "sdbm"
|
4
3
|
require "securerandom"
|
5
4
|
require "date"
|
6
5
|
require "ostruct"
|
6
|
+
require "fileutils"
|
7
7
|
|
8
8
|
require_relative "dddr/version"
|
9
9
|
|
@@ -69,14 +69,16 @@ module Dddr
|
|
69
69
|
container = Dddr.configuration.container
|
70
70
|
raise Dddr::Error, "Container name is required" unless container
|
71
71
|
|
72
|
-
unless Dir.exist?(data_dir)
|
72
|
+
unless Dir.exist?("#{data_dir}/#{container}")
|
73
73
|
if data_dir.include?("/var/")
|
74
|
-
|
75
|
-
|
74
|
+
full_path = "/var/dddr/#{container}/#{env}"
|
75
|
+
FileUtils.mkdir_p(full_path)
|
76
|
+
FileUtils.chown_R(ENV["USER"], nil, full_path)
|
76
77
|
else
|
77
|
-
|
78
|
+
FileUtils.mkdir_p("#{data_dir}/#{container}/#{env}")
|
78
79
|
end
|
79
80
|
end
|
81
|
+
|
80
82
|
@name = "#{data_dir}/#{container}/#{env}/#{entity_class.name.downcase}"
|
81
83
|
end
|
82
84
|
|
@@ -173,8 +175,8 @@ module Dddr
|
|
173
175
|
self.uid = uid
|
174
176
|
data_hash.each do |attribute, value|
|
175
177
|
attribute = attribute.to_sym
|
176
|
-
if respond_to?("#{attribute}=")
|
177
|
-
send("#{attribute}=", value)
|
178
|
+
if respond_to?(:"#{attribute}=")
|
179
|
+
send(:"#{attribute}=", value)
|
178
180
|
end
|
179
181
|
end
|
180
182
|
end
|