dddr 1.1.3 → 1.1.4
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 +15 -10
- 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: a61d06c6ebc3616c3da5cb9529144c21227a87c9cc16066c3d30676f689d6315
|
4
|
+
data.tar.gz: e3d69c17b85e80c0c8b78ed560c1921b4ccddb766908e2798b5fab10c998a009
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3439a0a2a18760fdc510927d336e3e42b17a1cb933f602f21e7ea938f60c8d8bcd4585f54d2f7fd44bcd9f12cee428e83c7b2b791aa7ea4b7b056035dd60ebbc
|
7
|
+
data.tar.gz: 7a0bfeb34044c07b29a584f7000be838f0f2b48a0bc98d08e815f112ba4baf9b65b326e6c24627ae77f4ab6e90d811488a73e4ef885dc4b14d19c6d1dcc9d513
|
data/lib/dddr/version.rb
CHANGED
data/lib/dddr.rb
CHANGED
@@ -68,19 +68,24 @@ module Dddr
|
|
68
68
|
data_dir = Dddr.configuration.data_dir
|
69
69
|
container = Dddr.configuration.container
|
70
70
|
raise Dddr::Error, "Container name is required" unless container
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
71
|
+
|
72
|
+
# Construct the target directory path
|
73
|
+
@name = "#{data_dir}/#{container}/#{env}/#{entity_class.name.downcase}"
|
74
|
+
|
75
|
+
begin
|
76
|
+
# Ensure all directories in the path are created
|
77
|
+
FileUtils.mkdir_p(@name)
|
78
|
+
|
79
|
+
# Change ownership only if the path starts with "/var/"
|
80
|
+
if @name.start_with?("/var/")
|
81
|
+
FileUtils.chown_R(ENV["USER"], nil, @name)
|
79
82
|
end
|
83
|
+
rescue Errno::ENOENT => e
|
84
|
+
# Log or handle the error
|
85
|
+
raise "Failed to create or access the directory: #{e.message}"
|
80
86
|
end
|
81
|
-
|
82
|
-
@name = "#{data_dir}/#{container}/#{env}/#{entity_class.name.downcase}"
|
83
87
|
end
|
88
|
+
|
84
89
|
|
85
90
|
def count
|
86
91
|
all.count
|