stashify 1.0.2 → 1.0.4

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: 84f0655199b71b4079fc0405ed2bd68ccd65f0231f1531005c59f1ada5b88efe
4
- data.tar.gz: b8f4d4b7491ea3d51271579e455fcbe08e4e9a74040f3deba84581b2d1b02538
3
+ metadata.gz: ac39c7eaa7f0a6e924497457841cc2087d34cacda4d400d32d3fa3e95965de69
4
+ data.tar.gz: fcb7cef63717efdbcb91eb0e668282352f62581e3205423bb16cfb4be0077210
5
5
  SHA512:
6
- metadata.gz: 623475feb2be6768f59519458108029af6b244396d36d67c3d3529e60bbf231f8164921d1cd334a6a7eebdd6059578083be2f841e50e4b7dc20327e3853707ef
7
- data.tar.gz: 33b63c2878050f49c35d24d00f81917f35503353019dc7b23c3f4f1a4fcfb7f95897b66d5dbb288012fcbd57b0a91bd162d8015b89802b70e7b81840222b77ed
6
+ metadata.gz: 6e592aeefb27cd272449dc897ce23a59abd2f298f115280b5c5eac26d9b448c6169cb29280350ba4ab3f1c19746779b976c54a85aa95ca11bc61c20d451b0a3a
7
+ data.tar.gz: 15ed987a91e39127836c08b7a9f4099aab4a2b16b804e3f944f987ce50b62ed9a65516032e99c27cd10efc65f177840b66bde5e19b779cf6f053f34453a5c967
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stashify (1.0.2)
4
+ stashify (1.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -14,10 +14,8 @@ module Stashify
14
14
  end
15
15
 
16
16
  def write_directory(directory)
17
- path = path_of(directory.name)
18
- FileUtils.mkdir(path)
19
- subdir = Stashify::Directory::Local.new(path)
20
- directory.files.each { |file| subdir.write(file) }
17
+ FileUtils.mkdir(path_of(directory.name))
18
+ super
21
19
  end
22
20
 
23
21
  def write_file(file)
@@ -45,14 +43,18 @@ module Stashify
45
43
 
46
44
  private
47
45
 
48
- def directory?(name)
49
- ::File.directory?(path_of(name))
46
+ def file?(name)
47
+ ::File.exist?(path_of(name))
50
48
  end
51
49
 
52
50
  def file(name)
53
51
  Stashify::File::Local.new(path_of(name))
54
52
  end
55
53
 
54
+ def directory?(name)
55
+ ::File.directory?(path_of(name))
56
+ end
57
+
56
58
  def directory(name)
57
59
  Stashify::Directory::Local.new(path_of(name))
58
60
  end
@@ -12,7 +12,7 @@ module Stashify
12
12
  def find(name)
13
13
  if directory?(name)
14
14
  directory(name)
15
- else
15
+ elsif file?(name)
16
16
  file(name)
17
17
  end
18
18
  end
@@ -24,5 +24,10 @@ module Stashify
24
24
  write_file(file)
25
25
  end
26
26
  end
27
+
28
+ def write_directory(directory)
29
+ subdir = self.directory(directory.name)
30
+ directory.files.each { |file| subdir.write(file) }
31
+ end
27
32
  end
28
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stashify
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stashify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lambda Null