dddr 1.1.1 → 1.1.3

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 +9 -7
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac6037def8474e0a19cb71d65912d75c63d4ed0bf23a02f7a42d5ac6202b1fc3
4
- data.tar.gz: f706863b32ef9fb10038b36e45414027c1f3f6a31afdaf715de8c726fc897ba2
3
+ metadata.gz: 3f0b301e90995f597fe2eccbb90579528f09e20ac702e8ca5f18855c64047d95
4
+ data.tar.gz: 94a1d19f0a0f1d38b72453519396d231e8ed7d0184ab42b0d828149dd75780e6
5
5
  SHA512:
6
- metadata.gz: 4dcfc32439afd20298a0aa34c9d2db345ed3a0abf02cd8821c4e09a955c168e7a24a536e165e2c82ff99bf2548b3a710449c4900b1f88a9628839d159bc9ba8c
7
- data.tar.gz: '0096a5f6de876e4e4cafc4f12c18b3e42252699bfed22c0e1d1cfc6e62bf2ed825a50c5dd4f53fd4d2223460a10c872f4599b558a3f5505abce84b43ae74c876'
6
+ metadata.gz: 5eeabb4563c3bd63e1e62d1e84045b4dc62c8944de6a41942fefe71ebca46850b55bf2e8ddcfa7e319cb58c1df0010803f3ae9f9200550067183299ab363f451
7
+ data.tar.gz: b6c98d57d03fe35c3f4488cd1d661b19f79804c55c73592959fc12d5d9cd56acd288325c5d93262f622306f9a19d013e37326487aae9779c4ac72c4f726b43fc
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.1.1"
4
+ VERSION = "1.1.3"
5
5
  end
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
- `sudo mkdir -p #{data_dir}/#{container}/#{env}/`
75
- `sudo chown $USER #{data_dir}/#{container}/#{env}/`
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
- `mkdir -p #{data_dir}/#{container}/#{env}/`
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dddr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Burke