directory-digest 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/directory-digest/digest.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5158fc3c02dd98fd36a9140933fde46c1706ea7b
|
4
|
+
data.tar.gz: abfc99b84aea8ec29243cfca60cdbd69d457374d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eab778312a16c04b66b41da0cbaf841a7d8f122d64fe25ccd7542188ec55c65eb09b7d0cc8bdea03fa5ffb765feec34d3c18c9572c6449f9ffa82c9ffb5d33ff
|
7
|
+
data.tar.gz: 3bbfd5e0044c950764b077ec870d6cb7bb52099191329c0e6abf1ad9a239cd77bb3bdeef3f5d10883c12b8e9bbd6b68216456bf2f022d4015062203891947a53
|
@@ -13,6 +13,7 @@ module DirectoryDigest
|
|
13
13
|
@directory = directory
|
14
14
|
@directory_digest = directory_digest
|
15
15
|
@file_digests = file_digests
|
16
|
+
freeze
|
16
17
|
end
|
17
18
|
|
18
19
|
def self.sha256(directory, glob = '**/*', includes = [])
|
@@ -88,6 +89,11 @@ module DirectoryDigest
|
|
88
89
|
|
89
90
|
# DirectoryDigest::MirrorActions - Provider for standard mirror making activities
|
90
91
|
class MirrorActions
|
92
|
+
def initialize(chunk_size = 4096)
|
93
|
+
@chunk_size = chunk_size
|
94
|
+
freeze
|
95
|
+
end
|
96
|
+
|
91
97
|
def create_directory(directory)
|
92
98
|
FileUtils.makedirs(directory)
|
93
99
|
end
|
@@ -95,7 +101,7 @@ module DirectoryDigest
|
|
95
101
|
def copy_file(source, destination)
|
96
102
|
File.open(source, 'rb') do |source_file|
|
97
103
|
File.open(destination, 'wb') do |destination_file|
|
98
|
-
destination_file.write(source_file.read(
|
104
|
+
destination_file.write(source_file.read(@chunk_size)) until source_file.eof?
|
99
105
|
end
|
100
106
|
end
|
101
107
|
end
|