stashify 2.1.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18e864a43d1dca35961fe21d01c9b93b9b79fc551f62925bb57f9727d92a3202
4
- data.tar.gz: 993f5ac9a60bcc4ab8a80ffa03a75001b57da60d7789a3426c666b61151bd822
3
+ metadata.gz: d58d66a14fbcb4c923eadefaf83b0df6a163c2a1fd78a204445e051d90609c8f
4
+ data.tar.gz: d677085f1b105082435520617d3e545d2d206c3e040b4fa21585d7b29ffe0c0f
5
5
  SHA512:
6
- metadata.gz: e7af61472c816f3120578e46cc6d70cbd3b4e616bfab8c85d664eeb5c77c2dbfab159325330800ab1ad746d7051394456f89276f267ef9811f867412232b38bc
7
- data.tar.gz: 3ca532d8fffcc24d4ac5bdbd2b49b4963a2da12fcb27774340372c9965efbcbfd05209cb877262565ec5b004f92c303c97493adb55b86260ea0e73ebd5414deb
6
+ metadata.gz: 374b7a1aacdaca2f0ea4a889670bccec77fbebeb7113bf396f16cdd9bb799606b0bfd4acecb809f73721399c4e32ee7b6a15b03610f30bc8bb0337131858ec93
7
+ data.tar.gz: cacebe50a69383c925921dea17cfaabec77b2ad7dc020a3c5b5922dbf43c8ca2bd7c63eb33aa200430e80992a65966fd8a9b8e597bff8d7e48693d9f6bcb9da5
data/.reek.yml CHANGED
@@ -12,6 +12,7 @@ detectors:
12
12
 
13
13
  FeatureEnvy:
14
14
  exclude:
15
+ - Stashify::Directory#write_file
15
16
  - Stashify::Directory::Local#write_file
16
17
  - Stashify::Directory#delete_directory
17
18
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stashify (2.1.1)
4
+ stashify (3.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -11,10 +11,6 @@ module Stashify
11
11
  super
12
12
  end
13
13
 
14
- def write_file(file)
15
- ::File.write(path_of(file.name), file.contents)
16
- end
17
-
18
14
  def files
19
15
  Dir.entries(path).grep_v(/^[.][.]?$/).map do |file_name|
20
16
  find(::File.basename(file_name))
@@ -42,10 +38,6 @@ module Stashify
42
38
  def delete_directory(name)
43
39
  FileUtils.rm_r(path_of(name))
44
40
  end
45
-
46
- def delete_file(name)
47
- ::File.delete(path_of(name))
48
- end
49
41
  end
50
42
  end
51
43
  end
@@ -33,6 +33,10 @@ module Stashify
33
33
  directory.files.each { |file| subdir.write(file) }
34
34
  end
35
35
 
36
+ def write_file(file)
37
+ file(file.name).write(file.contents)
38
+ end
39
+
36
40
  def delete(name)
37
41
  if directory?(name)
38
42
  delete_directory(name)
@@ -46,6 +50,10 @@ module Stashify
46
50
  subdir.files.each { |file| subdir.delete(file.name) }
47
51
  end
48
52
 
53
+ def delete_file(name)
54
+ file(name).delete
55
+ end
56
+
49
57
  def ==(other)
50
58
  files == other.files
51
59
  end
@@ -8,6 +8,14 @@ module Stashify
8
8
  def contents
9
9
  ::File.read(path)
10
10
  end
11
+
12
+ def write(contents)
13
+ ::File.write(path, contents)
14
+ end
15
+
16
+ def delete
17
+ ::File.delete(path)
18
+ end
11
19
  end
12
20
  end
13
21
  end
data/lib/stashify/file.rb CHANGED
@@ -15,6 +15,14 @@ module Stashify
15
15
  @contents = contents
16
16
  end
17
17
 
18
+ def write(contents)
19
+ @contents = contents
20
+ end
21
+
22
+ def delete
23
+ @contents = nil
24
+ end
25
+
18
26
  def ==(other)
19
27
  name == other.name && contents == other.contents
20
28
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stashify
4
- VERSION = "2.1.1"
4
+ VERSION = "3.0.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stashify
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lambda Null
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-29 00:00:00.000000000 Z
11
+ date: 2023-03-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Provides an abstraction to various services (local filesystem, S3, etc)
14
14
  email: