smart_s3_sync 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/smart_s3_sync/file_table.rb +5 -1
- data/lib/smart_s3_sync/version.rb +1 -1
- data/lib/smart_s3_sync.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b681c8704ec7dedf9b0f913627c599c3f432cdb
|
4
|
+
data.tar.gz: d4d746948fb98f23fb27663be869a7c16d26fc18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b5a509bbaf42a85515108f0619608c9f2facebfd2a41455ecbb19f3f5cba3ae544e2e91589a4893018e0f3e749572d176b8aadba8076eb093ea2e7174d231d8
|
7
|
+
data.tar.gz: cc2fc30d19637dffea7f738b894d16ead18f4b55de0dd45bffe5d151057bd74797feaae39b9fb3ef0f56bfee7162982217c0a66ffb3d0bd07430c6dd08973b52
|
@@ -18,7 +18,11 @@ module SmartS3Sync
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def copy!(fog_dir)
|
21
|
-
@map.sort_by
|
21
|
+
@map.sort_by do |(k, target)|
|
22
|
+
1_000_000_000 * (target.local_source.nil? ? 0 : -1) -
|
23
|
+
1_000_000 * target.destinations.length +
|
24
|
+
1/1_048_576 * target.size
|
25
|
+
end.each do |(k, target)|
|
22
26
|
target.copy!(fog_dir)
|
23
27
|
end
|
24
28
|
end
|
data/lib/smart_s3_sync.rb
CHANGED
@@ -35,14 +35,14 @@ module SmartS3Sync
|
|
35
35
|
table.copy!(bucket)
|
36
36
|
|
37
37
|
# sweep through and remove all files not in the cloud
|
38
|
-
Dir
|
38
|
+
Dir.glob(File.join(dir, '**/*')) do |file|
|
39
39
|
if !File.directory?(file)
|
40
40
|
File.unlink(file) and $stderr.puts "DELETING: #{file}" unless table.keep?(file)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
# and then all empty directories
|
45
|
-
Dir
|
45
|
+
Dir.glob(File.join(dir, '**/*')) do |file|
|
46
46
|
if File.directory?(file) && Dir.entries(file).length == 0
|
47
47
|
$stderr.puts "DELETING: #{file}"
|
48
48
|
Dir.rmdir(file)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_s3_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Rhoden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|