dddr 1.1.2 → 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 -9
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbf06845c3fffb2073721b00080de52829bd357ce8d38254f4cf871dc9411c1f
4
- data.tar.gz: 9db177525769ebca386819c550da01cce49557413994bd693a1d01e254a7a2aa
3
+ metadata.gz: 3f0b301e90995f597fe2eccbb90579528f09e20ac702e8ca5f18855c64047d95
4
+ data.tar.gz: 94a1d19f0a0f1d38b72453519396d231e8ed7d0184ab42b0d828149dd75780e6
5
5
  SHA512:
6
- metadata.gz: 2011c4bf79e2a2dff40478c86aa86c53f2e7b5ecd62416b51ed9d03ac21d11d993c395a30736b757f312376ca40a8f56a1f722150c9b5859c80a7e4123bbf68f
7
- data.tar.gz: 428d36d5cfa9d9c44487ac236c1f5a2573a637aadaaa73d9aa1d0251432885b079ff78c5e752941009bc04d70dd9fde7f62ee6bbead9b8134953b3132702a1ce
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.2"
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
 
@@ -68,17 +68,17 @@ 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
- puts `sudo mkdir -p /var/dddr/#{container}`
72
71
 
73
- unless Dir.exist?(data_dir)
72
+ unless Dir.exist?("#{data_dir}/#{container}")
74
73
  if data_dir.include?("/var/")
75
- `sudo chown $USER #{data_dir}/#{container}/`
76
- `sudo mkdir -p #{data_dir}/#{container}/#{env}/`
77
-
74
+ full_path = "/var/dddr/#{container}/#{env}"
75
+ FileUtils.mkdir_p(full_path)
76
+ FileUtils.chown_R(ENV["USER"], nil, full_path)
78
77
  else
79
- `mkdir -p #{data_dir}/#{container}/#{env}/`
78
+ FileUtils.mkdir_p("#{data_dir}/#{container}/#{env}")
80
79
  end
81
80
  end
81
+
82
82
  @name = "#{data_dir}/#{container}/#{env}/#{entity_class.name.downcase}"
83
83
  end
84
84
 
@@ -175,8 +175,8 @@ module Dddr
175
175
  self.uid = uid
176
176
  data_hash.each do |attribute, value|
177
177
  attribute = attribute.to_sym
178
- if respond_to?("#{attribute}=")
179
- send("#{attribute}=", value)
178
+ if respond_to?(:"#{attribute}=")
179
+ send(:"#{attribute}=", value)
180
180
  end
181
181
  end
182
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.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Burke